From 88ff5825ea4b45c28f920d940fd1a6750f4d5528 Mon Sep 17 00:00:00 2001 From: yuguojian <104118155@qq.com> Date: Wed, 11 Dec 2024 18:53:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 2 +- log.go | 21 +++++++++++++++++++++ order.go => rabbitmq_order.go | 2 +- product.go => rabbitmq_product.go | 2 +- 4 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 log.go rename order.go => rabbitmq_order.go (97%) rename product.go => rabbitmq_product.go (97%) diff --git a/go.mod b/go.mod index aaa9aee..aa44142 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/log.go b/log.go new file mode 100644 index 0000000..f085213 --- /dev/null +++ b/log.go @@ -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"` // 记录时间 +} diff --git a/order.go b/rabbitmq_order.go similarity index 97% rename from order.go rename to rabbitmq_order.go index 78d6af4..afe1f1d 100644 --- a/order.go +++ b/rabbitmq_order.go @@ -1,4 +1,4 @@ -package rabbitmq_common_structure +package common_structure type OrderCreate struct { ID uint `json:"id"` // 订单ID diff --git a/product.go b/rabbitmq_product.go similarity index 97% rename from product.go rename to rabbitmq_product.go index cf43237..df78bea 100644 --- a/product.go +++ b/rabbitmq_product.go @@ -1,4 +1,4 @@ -package rabbitmq_common_structure +package common_structure type ProductsIncreaseSoldType = int