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
|
UserName string `gorm:"column:userName" json:"userName"` // 用户名字
|
Module string `gorm:"column:module" json:"module"` // 模块
|
ProcName string `gorm:"column:procName" json:"procName"`
|
ProcID string `gorm:"column:procID" json:"procID"`
|
Function string `gorm:"column:function" json:"function"` // 功能
|
Result string `gorm:"column:result" json:"result"` // 操作结果
|
Para string `gorm:"column:para" json:"para"` // 参数
|
Msg string `gorm:"column:msg" json:"msg"` // 错误消息
|
Ip string `gorm:"column:ip" json:"ip"` // 详情
|
}
|
|
func (l * OperationLog)Marshal()([]byte, error) {
|
return json.Marshal(l)
|
}
|
|
func (l * OperationLog)Topic() string {
|
return OperationLogTopic
|
}
|