增加日志,修改命名

This commit is contained in:
yuguojian 2024-12-11 18:53:32 +08:00
parent 7b557072f3
commit 88ff5825ea
4 changed files with 24 additions and 3 deletions

2
go.mod
View File

@ -1,3 +1,3 @@
module gitee.com/shenzhen-jinhuatai-network/rabbitmq_common_structure
module gitee.com/shenzhen-jinhuatai-network/common_structure
go 1.18.0

21
log.go Normal file
View File

@ -0,0 +1,21 @@
package common_structure
import "time"
type LogInfoType = string
const (
LogInfoTypeOrder LogInfoType = "order"
LogInfoTypeProduct LogInfoType = "product"
)
type LogInfo struct {
InfoType LogInfoType `json:"info_type"` // 类型
ID int `json:"id"` // ID订单ID商品ID商品SKUID之类的id
Operator interface{} `json:"operator"` // 操作人
Title string `json:"title"` // 标题,做什么事情
Param interface{} `json:"param"` // 参数,请求参数,函数、方法就是参数
Result interface{} `json:"result"` // 结果,返回值
Err error `json:"err"` // 错误
At time.Time `json:"at"` // 记录时间
}

View File

@ -1,4 +1,4 @@
package rabbitmq_common_structure
package common_structure
type OrderCreate struct {
ID uint `json:"id"` // 订单ID

View File

@ -1,4 +1,4 @@
package rabbitmq_common_structure
package common_structure
type ProductsIncreaseSoldType = int