fix
This commit is contained in:
parent
b81a3682c2
commit
dc959ec49b
|
@ -32,6 +32,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||||
Path: "/api/shopping-cart/calculate_cart_price",
|
Path: "/api/shopping-cart/calculate_cart_price",
|
||||||
Handler: CalculateCartPriceHandler(serverCtx),
|
Handler: CalculateCartPriceHandler(serverCtx),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Method: http.MethodGet,
|
||||||
|
Path: "/api/shopping-cart/get_cart_num",
|
||||||
|
Handler: GetCartNumHandler(serverCtx),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,6 +114,10 @@ type CalculateResultItem struct {
|
||||||
TotalPrice string `json:"total_price"` //总价
|
TotalPrice string `json:"total_price"` //总价
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type GetCartNumRsp struct {
|
||||||
|
TotalCount int64 `json:"total_count"`
|
||||||
|
}
|
||||||
|
|
||||||
type Request struct {
|
type Request struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,9 @@ service shopping-cart {
|
||||||
//计算购物车价格
|
//计算购物车价格
|
||||||
@handler CalculateCartPriceHandler
|
@handler CalculateCartPriceHandler
|
||||||
post /api/shopping-cart/calculate_cart_price(CalculateCartPriceReq) returns (response);
|
post /api/shopping-cart/calculate_cart_price(CalculateCartPriceReq) returns (response);
|
||||||
|
//获取购物车数量
|
||||||
|
@handler GetCartNumHandler
|
||||||
|
get /api/shopping-cart/get_cart_num(request) returns (response);
|
||||||
}
|
}
|
||||||
|
|
||||||
//加入购物车
|
//加入购物车
|
||||||
|
@ -123,3 +126,7 @@ type CalculateResultItem {
|
||||||
ItemPrice string `json:"item_price"` //单价
|
ItemPrice string `json:"item_price"` //单价
|
||||||
TotalPrice string `json:"total_price"` //总价
|
TotalPrice string `json:"total_price"` //总价
|
||||||
}
|
}
|
||||||
|
//获取购物车数量
|
||||||
|
type GetCartNumRsp {
|
||||||
|
TotalCount int64 `json:"total_count"`
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user