fix
This commit is contained in:
@@ -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),
|
||||
},
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user