Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
88dd6fbdf5 | |||
![]() |
e0f73fc058 | ||
![]() |
88ff5825ea | ||
![]() |
7b557072f3 | ||
![]() |
8d6f2b31f2 | ||
![]() |
777f826a32 |
2
go.mod
2
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
|
go 1.18.0
|
||||||
|
21
log.go
Normal file
21
log.go
Normal 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"` // 记录时间
|
||||||
|
}
|
@@ -1,4 +1,4 @@
|
|||||||
package rabbitmq_common_structure
|
package common_structure
|
||||||
|
|
||||||
type OrderCreate struct {
|
type OrderCreate struct {
|
||||||
ID uint `json:"id"` // 订单ID
|
ID uint `json:"id"` // 订单ID
|
||||||
@@ -22,8 +22,8 @@ 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 {
|
||||||
@@ -69,3 +69,8 @@ type OrderUpdateSuccess struct {
|
|||||||
type ThirdOrderRefund struct {
|
type ThirdOrderRefund struct {
|
||||||
ID uint `json:"id"` // 订单ID
|
ID uint `json:"id"` // 订单ID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type RedPacketRefund struct {
|
||||||
|
ID uint `json:"id"` // 订单ID
|
||||||
|
OrderProductsID uint `json:"order_products_id"` // 订单商品ID
|
||||||
|
}
|
@@ -1,4 +1,4 @@
|
|||||||
package rabbitmq_common_structure
|
package common_structure
|
||||||
|
|
||||||
type ProductsIncreaseSoldType = int
|
type ProductsIncreaseSoldType = int
|
||||||
|
|
||||||
@@ -21,10 +21,20 @@ 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
|
DecreaseChangeStockType ProductsChangeStockType `json:"decrease_change_stock_type"`
|
||||||
|
OrderProductsIDs []uint `json:"order_products_ids"` // 对应的订单商品ID集合加减库存,如果为0,整个订单商品加减库存
|
||||||
|
|
||||||
|
SkuItems []*SkuItem `json:"sku_items"` // 商家修改商品数量使用,旧逻辑兼容
|
||||||
}
|
}
|
||||||
|
|
||||||
type SkuItem struct {
|
type SkuItem struct {
|
Reference in New Issue
Block a user