From 76ae3b2cb0d53afa4834071760fd53ec56bcb602 Mon Sep 17 00:00:00 2001 From: yuguojian <104118155@qq.com> Date: Fri, 6 Dec 2024 16:03:01 +0800 Subject: [PATCH] init --- .gitignore | 1 + go.mod | 3 +++ order.go | 45 +++++++++++++++++++++++++++++++++++++++++++++ product.go | 30 ++++++++++++++++++++++++++++++ 4 files changed, 79 insertions(+) create mode 100644 .gitignore create mode 100644 go.mod create mode 100644 order.go create mode 100644 product.go diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..723ef36 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..aaa9aee --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module gitee.com/shenzhen-jinhuatai-network/rabbitmq_common_structure + +go 1.18.0 diff --git a/order.go b/order.go new file mode 100644 index 0000000..dbe5676 --- /dev/null +++ b/order.go @@ -0,0 +1,45 @@ +package rabbitmq_common_structure + +type OrderCreate struct { + ID string `json:"id"` // 订单ID +} + +type OrderClose struct { + ID string `json:"id"` // 订单ID +} + +type OrderPay struct { + ID string `json:"id"` // 订单ID +} + +type OrderSent struct { + ID string `json:"id"` // 订单ID +} + +type CloseRefund struct { + ID string `json:"id"` // 订单ID +} + +type OrderFinished struct { + ID string `json:"id"` // 订单ID +} + +type OrderReconciliationPrecheck struct { + ID string `json:"id"` // 订单ID +} + +type OrderReconciliation struct { + ID string `json:"id"` // 订单ID +} + +type OrderConsumptionAward struct { + ID string `json:"id"` // 订单ID +} + +type OrderConsumptionAwardRedPacketQualification struct { + ID string `json:"id"` // 订单ID +} + +type OrderConsumptionAwardRedPacketMoney struct { + ID string `json:"id"` // 订单ID +} diff --git a/product.go b/product.go new file mode 100644 index 0000000..b1285ed --- /dev/null +++ b/product.go @@ -0,0 +1,30 @@ +package rabbitmq_common_structure + +type ProductsIncreaseSold struct { + ID uint `json:"id"` // 订单ID + ProductID uint `json:"product_id"` // 商品ID +} + +// StockState 库存增减标识 +type StockState = string + +const ( + StockStateIncrease StockState = "increase_inventory" //增加库存 + StockStateDecrease StockState = "reduce_inventory" //减少库存 +) + +type ProductsChange struct { + OrderId int64 `json:"order_id"` + State StockState `json:"state"` + SkuItems []*SkuItem +} + +type SkuItem struct { + SkuID uint `json:"sku_id"` + Num int `json:"num"` + Remark string `json:"remark"` +} + +type ProductsStockWarn struct { + ID string `json:"id"` // skuID +}