From 1915dc0a2a5e5fad54922277579c83ff35c022b7 Mon Sep 17 00:00:00 2001 From: yuguojian <18126816215> Date: Thu, 8 May 2025 16:40:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- log.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/log.go b/log.go index 7f96206..29be57a 100644 --- a/log.go +++ b/log.go @@ -17,20 +17,19 @@ const ( ) type LogInfo struct { - InfoType LogType `json:"info_type"` // 日志类型,按被操作对象划分 - Operator Operator `json:"operator"` // 操作人 - ObjectorID int `json:"objector_id"` // 被操作对象ID,如果是gps,短信等服务则为0 - Title string `json:"title"` // 标题,做什么事情 - Param interface{} `json:"param"` // 参数,请求参数,函数、方法就是参数 - Result interface{} `json:"result"` // 结果,返回值 - ErrStr string `json:"err_str"` // 错误信息,json转义error没有自动存储,需要手动转义 - At time.Time `json:"at"` // 记录时间 + InfoType LogType `json:"info_type"` // 日志类型,按被操作对象划分 + Operator *Operator `json:"operator,omitempty"` // 操作人,系统操作不用填写操作人,写日志类型就可以 + ObjectorID int `json:"objector_id,omitempty"` // 被操作对象ID,如果是gps,短信等服务则为0 + Title string `json:"title"` // 必填,标题,做什么事情 + Param interface{} `json:"param,omitempty"` // 参数,请求参数,传指针 + Result interface{} `json:"result,omitempty"` // 结果,返回值,传指针 + ErrStr string `json:"err_str,omitempty"` // 错误信息,json转义error没有自动存储,需要手动转义 + At time.Time `json:"at"` // 记录时间 } type OperatorType = string const ( - SystemOperatorType OperatorType = "system" // 系统 AdminOperatorType OperatorType = "admin" // 管理员 MerchantOperatorType OperatorType = "merchant" // 商家 UserOperatorType OperatorType = "user" // 用户