gomod引用
This commit is contained in:
@@ -19,11 +19,19 @@ type CreateOrderReq struct {
|
||||
// OrderItemReq 创建订单商品项请求
|
||||
|
||||
type OrderItemReq struct {
|
||||
ProductID string `json:"product_id" binding:"required"` // 商品ID
|
||||
ProductName string `json:"product_name" binding:"required"` // 商品名称
|
||||
Price int64 `json:"price" binding:"required,min=1"` // 单价(分)
|
||||
Quantity int `json:"quantity" binding:"required,min=1"` // 数量
|
||||
ImageURL string `json:"image_url"` // 商品图片
|
||||
AssetID string `json:"asset_id" binding:"required"` // 资产ID
|
||||
AssetName string `json:"asset_name" binding:"required"` // 资产名称
|
||||
AssetType string `json:"asset_type" binding:"required"` // 资产类型:product-商品型,service-服务型,software-软件型
|
||||
ImageURL string `json:"image_url"` // 资产图片
|
||||
Stocks []OrderItemStockReq `json:"stocks" binding:"required"` // 库存项列表
|
||||
}
|
||||
|
||||
// OrderItemStockReq 创建订单商品项库存明细请求
|
||||
|
||||
type OrderItemStockReq struct {
|
||||
StockID string `json:"stock_id" binding:"required"` // 库存ID
|
||||
Price int64 `json:"price" binding:"required,min=1"` // 单价(分)
|
||||
StockAttrs map[string]interface{} `json:"stock_attrs"` // 库存项属性(动态字段)
|
||||
}
|
||||
|
||||
// ShippingInfoReq 收货信息请求
|
||||
@@ -111,12 +119,21 @@ type OrderDetail struct {
|
||||
// OrderItem 订单商品项(响应)
|
||||
|
||||
type OrderItem struct {
|
||||
ProductID string `json:"product_id"` // 商品ID
|
||||
ProductName string `json:"product_name"` // 商品名称
|
||||
Price int64 `json:"price"` // 单价(分)
|
||||
Quantity int `json:"quantity"` // 数量
|
||||
TotalPrice int64 `json:"total_price"` // 小计(分)
|
||||
ImageURL string `json:"image_url"` // 商品图片
|
||||
AssetID string `json:"asset_id"` // 资产ID
|
||||
AssetName string `json:"asset_name"` // 资产名称
|
||||
AssetType string `json:"asset_type"` // 资产类型:product-商品型,service-服务型,software-软件型
|
||||
ImageURL string `json:"image_url"` // 资产图片
|
||||
Quantity int `json:"quantity"` // 总数量
|
||||
TotalPrice int64 `json:"total_price"` // 小计(分)
|
||||
Stocks []OrderItemStock `json:"stocks"` // 库存项列表
|
||||
}
|
||||
|
||||
// OrderItemStock 订单商品项库存明细(响应)
|
||||
|
||||
type OrderItemStock struct {
|
||||
StockID string `json:"stock_id"` // 库存ID
|
||||
Price int64 `json:"price"` // 单价(分)
|
||||
StockAttrs map[string]interface{} `json:"stock_attrs"` // 库存项属性(动态字段)
|
||||
}
|
||||
|
||||
// ShippingInfo 收货信息(响应)
|
||||
|
||||
@@ -31,12 +31,21 @@ type OrderBase struct {
|
||||
// 按状态拆分的订单表会包含这个结构
|
||||
|
||||
type OrderItem struct {
|
||||
ProductID string `bson:"product_id" json:"product_id"` // 商品ID
|
||||
ProductName string `bson:"product_name" json:"product_name"` // 商品名称
|
||||
Price int64 `bson:"price" json:"price"` // 单价(分)
|
||||
Quantity int `bson:"quantity" json:"quantity"` // 数量
|
||||
TotalPrice int64 `bson:"total_price" json:"total_price"` // 小计(分)
|
||||
ImageURL string `bson:"image_url,omitempty" json:"image_url"` // 商品图片
|
||||
AssetID string `bson:"asset_id" json:"asset_id"` // 资产ID
|
||||
AssetName string `bson:"asset_name" json:"asset_name"` // 资产名称
|
||||
AssetType string `bson:"asset_type" json:"asset_type"` // 资产类型:product-商品型,service-服务型,software-软件型
|
||||
ImageURL string `bson:"image_url,omitempty" json:"image_url"` // 资产图片
|
||||
Quantity int `bson:"quantity" json:"quantity"` // 总数量
|
||||
TotalPrice int64 `bson:"total_price" json:"total_price"` // 小计(分)
|
||||
Stocks []OrderItemStock `bson:"stocks" json:"stocks"` // 库存项列表
|
||||
}
|
||||
|
||||
// OrderItemStock 订单商品项库存明细
|
||||
// 用于追溯具体使用了哪些库存项,一个库存项只会有一个实例
|
||||
type OrderItemStock struct {
|
||||
StockID string `bson:"stock_id" json:"stock_id"` // 库存ID
|
||||
Price int64 `bson:"price" json:"price"` // 该库存项的单价(分)
|
||||
StockAttrs map[string]interface{} `bson:"stock_attrs,omitempty" json:"stock_attrs"` // 库存项属性(动态字段,存储该库存项的具体规格属性)
|
||||
}
|
||||
|
||||
// ShippingInfo 收货信息
|
||||
|
||||
Reference in New Issue
Block a user