Browse Source

gormv2升级 第一阶段

main
QM303176530 4 years ago
parent
commit
9cb2a470fb
  1. 2
      server/middleware/operation.go
  2. 2
      server/model/sys_operation_record.go

2
server/middleware/operation.go

@ -34,7 +34,7 @@ func OperationRecord() gin.HandlerFunc {
Path: c.Request.URL.Path, Path: c.Request.URL.Path,
Agent: c.Request.UserAgent(), Agent: c.Request.UserAgent(),
Body: string(body), Body: string(body),
UserId: userId,
UserID: userId,
} }
writer := responseBodyWriter{ writer := responseBodyWriter{
ResponseWriter: c.Writer, ResponseWriter: c.Writer,

2
server/model/sys_operation_record.go

@ -18,6 +18,6 @@ type SysOperationRecord struct {
ErrorMessage string `json:"error_message" form:"error_message" gorm:"column:error_message;comment:''"` ErrorMessage string `json:"error_message" form:"error_message" gorm:"column:error_message;comment:''"`
Body string `json:"body" form:"body" gorm:"column:body;comment:'请求Body'"` Body string `json:"body" form:"body" gorm:"column:body;comment:'请求Body'"`
Resp string `json:"resp" form:"resp" gorm:"column:resp;comment:'响应Body'"` Resp string `json:"resp" form:"resp" gorm:"column:resp;comment:'响应Body'"`
UserId int `json:"user_id" form:"user_id" gorm:"column:user_id;comment:''"`
UserID int `json:"user_id" form:"user_id" gorm:"column:user_id;comment:''"`
User SysUser `json:"user"` User SysUser `json:"user"`
} }
Loading…
Cancel
Save