yanghui
2021-04-27 a1c14d8d1b467bfb726a7029a3fe4beed33956cb
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
@@ -14,4 +16,12 @@
   Ip        string `gorm:"column:ip" json:"ip"`                                 // 详情
}
func (l * OperationLog)Marshal()([]byte, error) {
   return json.Marshal(l)
}
func (l * OperationLog)Topic() string {
   return OperationLogTopic
}