11

操作记录精细到字段级别,有比较干净的方案么?

 3 years ago
source link: https://www.v2ex.com/t/818291
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  程序员

操作记录精细到字段级别,有比较干净的方案么?

  taloricag · 2 小时 15 分钟前 · 93 次点击
就是 post 请求,需要知道修改到数据库改了什么字段做操作记录
实际上现在操作记录的实现已经是 AOP ,在路由层丢给一个单独的控制层去解决操作记录的问题
但是在路由层不可能记录到字段级别,毕竟也不可能在这个地方去查数据
所以有没啥干净一点的方案,实在是不想在业务逻辑的 controller 里再去逐个字段做对比...

或许最理想的方案是在 ORM 去做,但是目前对 ORM 的控制力实在有点弱...(go / gorm

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK