From 4d3f1512ac6b50487df659ef0176cf3cb3592747 Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Wed, 20 Sep 2023 16:37:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=B4=AD=E7=89=A9=E8=BD=A6=E4=B8=8B?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/gmodel/fs_order_logic.go | 46 +++++++++++++++++++++++----------- service/repositories/order.go | 16 +++++++++--- 2 files changed, 44 insertions(+), 18 deletions(-) diff --git a/model/gmodel/fs_order_logic.go b/model/gmodel/fs_order_logic.go index b24d4cc2..582c0ab6 100644 --- a/model/gmodel/fs_order_logic.go +++ b/model/gmodel/fs_order_logic.go @@ -108,19 +108,35 @@ type OrderStatus struct { // 订单商品 type OrderProduct struct { - TotalPrice AmountInfo `json:"amount"` // 商品总价 - ExpectedDeliveryTime time.Time `json:"expected_delivery_time"` // 预计到货时间 - PurchaseQuantity int64 `json:"purchase_quantity"` // 购买数量 - ProductID int64 `json:"product_id"` // 商品ID - ProductName string `json:"product_name"` // 商品名称 - ItemPrice AmountInfo `json:"product_price"` // 商品单价 - ProductSnapshot map[string]interface{} `json:"product_snapshot"` // 商品快照 - ShoppingCartSnapshot *FsShoppingCart `json:"shopping_cart_snapshot"` // 购物车快照 - DiyInformation *UserDiyInformation `json:"diy_information"` - FittingInfo *FittingInfo `json:"fitting_info"` - ProductCover string `json:"product_cover"` // 商品封面 - ProductCoverMetadata map[string]interface{} `json:"product_cover_metadata"` // 商品封面 - ProductSn string `json:"product_sn"` // 商品编码 - SizeInfo *SizeInfo `json:"size_info"` - StepNum []int `json:"step_num"` // 阶梯数量 + TotalPrice AmountInfo `json:"amount"` // 商品总价 + ExpectedDeliveryTime time.Time `json:"expected_delivery_time"` // 预计到货时间 + PurchaseQuantity int64 `json:"purchase_quantity"` // 购买数量 + ProductID int64 `json:"product_id"` // 商品ID + ProductName string `json:"product_name"` // 商品名称 + ItemPrice AmountInfo `json:"product_price"` // 商品单价 + ProductSnapshot map[string]interface{} `json:"product_snapshot"` // 商品快照 + ShoppingCartSnapshot *FsShoppingCart `json:"shopping_cart_snapshot"` // 购物车快照 + ProductCover string `json:"product_cover"` // 商品封面 + ProductCoverMetadata map[string]interface{} `json:"product_cover_metadata"` // 商品封面 + ProductSn string `json:"product_sn"` // 商品编码 + DiyInformation *UserDiyInformation `json:"diy_information"` + SizeInfo *OrderProductSizeInfo `json:"size_info"` + FittingInfo *OrderProductFittingInfo `json:"fitting_info"` + StepNum []int `json:"step_num"` // 阶梯数量 +} + +type OrderProductSizeInfo struct { + SizeID int64 `json:"size_id"` + Capacity string `json:"capacity"` + Title OrderProductSizeInfoTitle `json:"title"` +} + +type OrderProductSizeInfoTitle struct { + Inch string `json:"inch"` + Cm string `json:"cm"` +} + +type OrderProductFittingInfo struct { + FittingID int64 `json:"fitting_id"` //配件ID + FittingName string `json:"fitting_name"` //配件名称 } diff --git a/service/repositories/order.go b/service/repositories/order.go index 1a45e42f..e821d2d9 100644 --- a/service/repositories/order.go +++ b/service/repositories/order.go @@ -247,9 +247,19 @@ func (d *defaultOrder) Create(ctx context.Context, in *CreateReq) (res *CreateRe ShoppingCartSnapshot: &shoppingCart.FsShoppingCart, ProductSn: *shoppingCart.ShoppingCartProduct.Sn, DiyInformation: &shoppingCartSnapshot.UserDiyInformation, - FittingInfo: &shoppingCartSnapshot.FittingInfo, - SizeInfo: &shoppingCartSnapshot.SizeInfo, - StepNum: stepNum, + FittingInfo: &gmodel.OrderProductFittingInfo{ + FittingID: *shoppingCart.FittingId, + FittingName: shoppingCartSnapshot.FittingInfo.FittingName, + }, + SizeInfo: &gmodel.OrderProductSizeInfo{ + SizeID: *shoppingCart.SizeId, + Capacity: shoppingCartSnapshot.SizeInfo.Capacity, + Title: gmodel.OrderProductSizeInfoTitle{ + Inch: shoppingCartSnapshot.SizeInfo.Inch, + Cm: shoppingCartSnapshot.SizeInfo.Cm, + }, + }, + StepNum: stepNum, }) }