package entity // 用户访问日志 // 记录敏感接口请求 type UserLogs struct { MysqlBaseModel UserId int64 `json:"userId" gorm:"comment:用户Id"` UserAgent string `json:"userAgent" gorm:"type:varchar(1024);comment:客户端信息"` Ip string `json:"ip" gorm:"type:varchar(64);comment:ip"` Action string `json:"action" gorm:"type:varchar(20);comment:请求方法"` Query string `json:"query" gorm:"type:text;comment:query"` Path string `json:"path" gorm:"type:varchar(200);comment:path"` Status int `json:"status" gorm:"comment:状态"` Request string `json:"request" gorm:"type:text;comment:请求内容消息"` Response string `json:"response" gorm:"type:text;comment:请求返回信息"` Elapsed string `json:"elapsed" gorm:"type:varchar(50);comment:耗时"` } func (*UserLogs) TableName() string { return ModelPrefix + "user_logs" } func (*UserLogs) Comment() string { return "用户操作日志" } func NewUserLogs() *UserLogs { return &UserLogs{} }