更新日志

This commit is contained in:
yuguojian 2025-05-08 16:40:03 +08:00
parent f8ebbff9d8
commit 1915dc0a2a

13
log.go
View File

@ -18,19 +18,18 @@ const (
type LogInfo struct { type LogInfo struct {
InfoType LogType `json:"info_type"` // 日志类型,按被操作对象划分 InfoType LogType `json:"info_type"` // 日志类型,按被操作对象划分
Operator Operator `json:"operator"` // 操作人 Operator *Operator `json:"operator,omitempty"` // 操作人,系统操作不用填写操作人,写日志类型就可以
ObjectorID int `json:"objector_id"` // 被操作对象ID如果是gps短信等服务则为0 ObjectorID int `json:"objector_id,omitempty"` // 被操作对象ID如果是gps短信等服务则为0
Title string `json:"title"` // 标题,做什么事情 Title string `json:"title"` // 必填,标题,做什么事情
Param interface{} `json:"param"` // 参数,请求参数,函数、方法就是参数 Param interface{} `json:"param,omitempty"` // 参数,请求参数,传指针
Result interface{} `json:"result"` // 结果,返回值 Result interface{} `json:"result,omitempty"` // 结果,返回值,传指针
ErrStr string `json:"err_str"` // 错误信息json转义error没有自动存储需要手动转义 ErrStr string `json:"err_str,omitempty"` // 错误信息json转义error没有自动存储需要手动转义
At time.Time `json:"at"` // 记录时间 At time.Time `json:"at"` // 记录时间
} }
type OperatorType = string type OperatorType = string
const ( const (
SystemOperatorType OperatorType = "system" // 系统
AdminOperatorType OperatorType = "admin" // 管理员 AdminOperatorType OperatorType = "admin" // 管理员
MerchantOperatorType OperatorType = "merchant" // 商家 MerchantOperatorType OperatorType = "merchant" // 商家
UserOperatorType OperatorType = "user" // 用户 UserOperatorType OperatorType = "user" // 用户