zhangzengfei
2022-01-24 d329992729098670124003a8f8558c9447981e7c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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"`             // 详情
    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
}