This commit is contained in:
laodaming
2023-09-15 17:59:33 +08:00
parent da8f88b3e6
commit ab6f3249a2
3 changed files with 44 additions and 0 deletions

View File

@@ -32,6 +32,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
Path: "/api/shopping-cart/get_carts",
Handler: GetCartsHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/api/shopping-cart/calculate_cart_price",
Handler: CalculateCartPriceHandler(serverCtx),
},
},
)
}

View File

@@ -80,6 +80,25 @@ type DiyInformation struct {
Slogan string `json:"slogan"`
}
type CalculateCartPriceReq struct {
CalculateList []CalculateItem `json:"calculate_list"`
}
type CalculateItem struct {
CartId int64 `json:"cart_id"` //购物车id
PurchaseQuantity int64 `json:"purchase_quantity"` //数量
}
type CalculateCartPriceRsp struct {
CalculateResultList []CalculateResultItem `json:"calculate_result_list"`
}
type CalculateResultItem struct {
CartId int64 `json:"cart_id"` //购物车id
ItemPrice string `json:"item_price"` //单价
TotalPrice string `json:"total_price"` //总价
}
type Request struct {
}