You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
1.2 KiB

  1. // 自动生成模板SysOperationRecord
  2. package model
  3. import (
  4. "gorm.io/gorm"
  5. "time"
  6. )
  7. // 如果含有time.Time 请自行import time包
  8. type SysOperationRecord struct {
  9. gorm.Model
  10. Ip string `json:"ip" form:"ip" gorm:"column:ip;comment:请求ip"`
  11. Method string `json:"method" form:"method" gorm:"column:method;comment:请求方法"`
  12. Path string `json:"path" form:"path" gorm:"column:path;comment:请求路径"`
  13. Status int `json:"status" form:"status" gorm:"column:status;comment:请求状态"`
  14. Latency time.Duration `json:"latency" form:"latency" gorm:"column:latency;comment:延迟"`
  15. Agent string `json:"agent" form:"agent" gorm:"column:agent;comment:代理"`
  16. ErrorMessage string `json:"error_message" form:"error_message" gorm:"column:error_message;comment:错误信息"`
  17. Body string `json:"body" form:"body" gorm:"column:body;comment:请求Body"`
  18. Resp string `json:"resp" form:"resp" gorm:"type:longtext;column:resp;comment:响应Body"`
  19. UserID int `json:"user_id" form:"user_id" gorm:"column:user_id;comment:用户id"`
  20. User SysUser `json:"user"`
  21. }