magic_user_logs.go 1.3 KB

123456789101112131415161718192021222324252627
  1. package app
  2. // 引入关联包
  3. type MagicUserLogs struct {
  4. Id int64 `json:"id" gorm:"column:id;type:bigint;comment:id;primarykey;NOT NULL"`
  5. CreatedAt int64 `json:"createdAt" gorm:"column:created_at;type:bigint;comment:创建时间"`
  6. UpdatedAt int64 `json:"updatedAt" gorm:"column:updated_at;type:bigint;comment:更新时间"`
  7. UserId int64 `json:"userId" gorm:"column:user_id;type:bigint;comment:用户Id"`
  8. UserAgent string `json:"userAgent" gorm:"column:user_agent;type:varchar(1024);comment:客户端信息"`
  9. Ip string `json:"ip" gorm:"column:ip;type:varchar(64);comment:ip"`
  10. Action string `json:"action" gorm:"column:action;type:varchar(20);comment:请求方法"`
  11. Query string `json:"query" gorm:"column:query;type:text;comment:query"`
  12. Path string `json:"path" gorm:"column:path;type:varchar(200);comment:path"`
  13. Status int64 `json:"status" gorm:"column:status;type:bigint;comment:状态"`
  14. Request string `json:"request" gorm:"column:request;type:text;comment:请求内容消息"`
  15. Response string `json:"response" gorm:"column:response;type:text;comment:请求返回信息"`
  16. Elapsed string `json:"elapsed" gorm:"column:elapsed;type:varchar(50);comment:耗时"`
  17. }
  18. func (*MagicUserLogs) TableName() string {
  19. return "magic_user_logs"
  20. }
  21. func NewMagicUserLogs() *MagicUserLogs {
  22. return &MagicUserLogs{}
  23. }