haozhifeng
2021-06-30 6c71ed49668ae5e7711b337d57051f82a3dd65cc
operationlog.go
@@ -1,5 +1,7 @@
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
@@ -12,6 +14,15 @@
   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
}