49 lines
1.4 KiB
Plaintext
49 lines
1.4 KiB
Plaintext
|
syntax = "v1"
|
||
|
|
||
|
info (
|
||
|
title: "shopping-cart"// TODO: add title
|
||
|
desc: "购物车服务"// TODO: add description
|
||
|
author: ""
|
||
|
email: ""
|
||
|
)
|
||
|
|
||
|
import "basic.api"
|
||
|
service shopping-cart {
|
||
|
//加入购物车
|
||
|
@handler AddToCartHandler
|
||
|
post /api/shopping-cart/add_to_cart(AddToCartReq) returns (response);
|
||
|
//删除购物车
|
||
|
@handler DeleteCartHandler
|
||
|
post /api/shopping-cart/delete_cart(DeleteCartReq) returns (response);
|
||
|
//修改购物车购买数量
|
||
|
@handler ModifyCartPurchaseQuantityHandler
|
||
|
post /api/shopping-cart/modify_cart_purchase_quantity(ModifyCartPurchaseQuantityReq) returns (response);
|
||
|
//获取购物车列表
|
||
|
@handler GetCartsHandler
|
||
|
get /api/shopping-cart/get_carts(GetCartsReq) returns (response);
|
||
|
}
|
||
|
//加入购物车
|
||
|
type AddToCartReq{
|
||
|
ProductId int64 `json:"product_id"`//产品id
|
||
|
TemplateId int64 `json:"template_id"` //模板id
|
||
|
SizeId int64 `json:"size_id"` //尺寸id
|
||
|
FittingId int64 `json:"fitting_id"` //配件id
|
||
|
PurchaseQuantity int64 `json:"purchase_quantity"` //购买数量
|
||
|
Logo string `json:"logo"` //logo地址
|
||
|
CombineImage string `json:"combine_image"` //合图地址
|
||
|
RenderImage string `json:"render_image"` //渲染结果图
|
||
|
}
|
||
|
//删除购物车
|
||
|
type DeleteCartReq{
|
||
|
Id int64 `json:"id"`//购物车id
|
||
|
}
|
||
|
//修改购物车购买数量
|
||
|
type ModifyCartPurchaseQuantityReq{
|
||
|
Id int64 `json:"id"` //购物车id
|
||
|
Quantity int64 `json:"quantity"` //数量
|
||
|
}
|
||
|
//获取购物车列表
|
||
|
type GetCartsReq{
|
||
|
Page int `form:"page"` //当前页
|
||
|
}
|