| | |
| | | package logc |
| | | |
| | | import "encoding/json" |
| | | |
| | | type OperationLog struct { |
| | | ID string `gorm:"column:id;primaryKey;unique;autoIncrement" json:"id"` // 主键id |
| | | Timestamp int64 `gorm:"column:timestamp" json:"timestamp"` // 时间戳Unix time |
| | |
| | | Para string `gorm:"column:para" json:"para"` // 参数 |
| | | Msg string `gorm:"column:msg" json:"msg"` // 错误消息 |
| | | Ip string `gorm:"column:ip" json:"ip"` // 详情 |
| | | AddTime string `gorm:"column:add_time" json:"add_time"` // 详情 |
| | | } |
| | | |
| | | func (l * OperationLog)Marshal()([]byte, error) { |
| | | return json.Marshal(l) |
| | | } |
| | | |
| | | func (l * OperationLog)Topic() string { |
| | | return OperationLogTopic |
| | | } |
| | | |
| | | |