common_structure/rabbitmq_product.go
2025-05-08 14:39:42 +08:00

49 lines
1.6 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package common_structure
type ProductsIncreaseSoldType = int
const (
ProductsIncreaseSoldTypePaied ProductsIncreaseSoldType = 10 // 已支付
ProductsIncreaseSoldTypeSent ProductsIncreaseSoldType = 20 // 已发货
)
type ProductsIncreaseSold struct {
ID uint `json:"id"` // 订单ID
ProductID uint `json:"product_id"` // 商品ID
IncreaseSoldType ProductsIncreaseSoldType `json:"increase_sold_type"` // 增加销量类型
}
// StockState 库存增减标识
type StockState = string
const (
StockStateIncrease StockState = "increase_inventory" // 增加库存
StockStateDecrease StockState = "reduce_inventory" // 减少库存
)
type ProductsChangeStockType = int
const (
ProductsChangeStockTypePlaced ProductsChangeStockType = 10 // 下单时
ProductsChangeStockTypeSent ProductsChangeStockType = 20 // 已发货
)
type ProductsChangeStock struct {
OrderId uint `json:"order_id"`
State StockState `json:"state"`
DecreaseChangeStockType ProductsChangeStockType `json:"decrease_change_stock_type"`
OrderProductsIDs []uint `json:"order_products_ids"` // 对应的订单商品ID集合加减库存如果为0整个订单商品加减库存
SkuItems []*SkuItem `json:"sku_items"` // 商家修改商品数量使用,旧逻辑兼容
}
type SkuItem struct {
SkuID uint `json:"sku_id"`
Num int `json:"num"`
Remark string `json:"remark"`
}
type ProductsStockWarn struct {
ID uint `json:"id"` // skuID
}