Compare commits

..

4 Commits

Author SHA1 Message Date
yuguojian
7b557072f3 订单减库存选项,下单时,发货时 2024-12-09 15:54:49 +08:00
yuguojian
8d6f2b31f2 订单发货通知修改商品id为订单商品id 2024-12-09 15:27:41 +08:00
余国健
777f826a32 增加减库存类型 2024-12-08 22:31:37 +08:00
余国健
3d8b82f0fd 增加关闭订单类型,增加增加商品销量类型 2024-12-08 01:51:41 +08:00
2 changed files with 33 additions and 8 deletions

View File

@@ -4,8 +4,17 @@ type OrderCreate struct {
ID uint `json:"id"` // 订单ID ID uint `json:"id"` // 订单ID
} }
type OrderCloseType = int
const (
OrderCloseTypePayTimeout OrderCloseType = 10 // 支付超时
OrderCloseTypeRefundClose OrderCloseType = 20 // 退款关闭,判断商品是否仅退款
OrderCloseTypeMerchantClose OrderCloseType = 30 // 商家关闭
)
type OrderClose struct { type OrderClose struct {
ID uint `json:"id"` // 订单ID ID uint `json:"id"` // 订单ID
CloseType OrderCloseType `json:"close_type"` // 关闭类型
} }
type OrderPay struct { type OrderPay struct {
@@ -14,7 +23,7 @@ type OrderPay struct {
type OrderSent struct { type OrderSent struct {
ID uint `json:"id"` // 订单ID ID uint `json:"id"` // 订单ID
ProductID uint `json:"product_id"` // 商品ID OrderProductsID uint `json:"order_products_id"` // 订单商品ID
} }
type OrderCloseRefund struct { type OrderCloseRefund struct {

View File

@@ -1,8 +1,16 @@
package rabbitmq_common_structure package rabbitmq_common_structure
type ProductsIncreaseSoldType = int
const (
ProductsIncreaseSoldTypePaied ProductsIncreaseSoldType = 10 // 已支付
ProductsIncreaseSoldTypeSent ProductsIncreaseSoldType = 20 // 已发货
)
type ProductsIncreaseSold struct { type ProductsIncreaseSold struct {
ID uint `json:"id"` // 订单ID ID uint `json:"id"` // 订单ID
ProductID uint `json:"product_id"` // 商品ID ProductID uint `json:"product_id"` // 商品ID
IncreaseSoldType ProductsIncreaseSoldType `json:"increase_sold_type"` // 增加销量类型
} }
// StockState 库存增减标识 // StockState 库存增减标识
@@ -13,10 +21,18 @@ const (
StockStateDecrease StockState = "reduce_inventory" //减少库存 StockStateDecrease StockState = "reduce_inventory" //减少库存
) )
type ProductsChangeStockType = int
const (
ProductsChangeStockTypePlaced ProductsChangeStockType = 10 // 下单时
ProductsChangeStockTypeSent ProductsChangeStockType = 20 // 已发货
)
type ProductsChangeStock struct { type ProductsChangeStock struct {
OrderId uint `json:"order_id"` OrderId uint `json:"order_id"`
State StockState `json:"state"` State StockState `json:"state"`
SkuItems []*SkuItem SkuItems []*SkuItem `json:"sku_items"`
DecreaseChangeStockType ProductsChangeStockType `json:"decrease_change_stock_type"`
} }
type SkuItem struct { type SkuItem struct {