ok
yanghui
2021-06-16 75f02abb87a7e4207d32a17e12c04ec28add7e6d
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
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
}