zhangzengfei
2021-12-01 3fdd5c558b1cf801ebd39ceb65d4b910e7d4aba0
scheduleLog.go
@@ -1,5 +1,7 @@
package logc
import "encoding/json"
type ScheduleLog struct {
   ID        string `gorm:"column:id;primaryKey;unique;autoIncrement" json:"id"` // 主键id
   Timestamp int64  `gorm:"column:timestamp" json:"timestamp"`                   // 时间戳Unix time
@@ -8,4 +10,14 @@
   Level     int    `gorm:"column:level" json:"level"`       // 日志等级
   Type      int    `gorm:"column:type" json:"type"`         // 操作类型:人工操作,登录退出,轮循摄像机及对应算法,数据栈处理情况,异常情况等
   Info      string `gorm:"column:info" json:"info"`         // 详情
   ScheduleStartTime string  `gorm:"column:schedule_start_time" json:"schedule_start_time"`                   // 时间戳Unix time
   ScheduleEndTime string  `gorm:"column:schedule_end_time" json:"schedule_end_time"`                   // 时间戳Unix time
}
func (l * ScheduleLog)Marshal()([]byte, error) {
   return json.Marshal(l)
}
func (l * ScheduleLog)Topic() string {
   return ScheduleLogTopic
}