fusenapi/server_api/shopping-cart-confirmation.api

72 lines
1.8 KiB
Plaintext
Raw Normal View History

2023-05-31 03:38:17 +00:00
syntax = "v1"
info (
2023-06-13 04:15:06 +00:00
title: "购物车服务"
2023-05-31 03:38:17 +00:00
desc: // TODO: add description
2023-06-13 04:15:06 +00:00
author: "ldm"
2023-05-31 03:38:17 +00:00
email: ""
)
2023-06-13 04:15:06 +00:00
import "basic.api"
service shopping-cart-confirmation {
//添加入购物车
@handler CartAddHandler
post /cart/add (CartAddReq) returns (response);
2023-06-13 06:13:40 +00:00
//删除购物车
@handler CartDeleteHandler
post /cart/del (CartDeleteReq) returns (response);
2023-06-13 06:29:44 +00:00
//获取用户购物车数量
@handler CartNumberHandler
get /cart/num ( ) returns (response);
2023-06-13 09:47:48 +00:00
//获取用户购物车列表
@handler CartListHandler
get /cart/list (CartListReq) returns (response);
2023-05-31 03:38:17 +00:00
}
2023-06-13 04:15:06 +00:00
//添加入购物车
type CartAddReq {
DesignId string `json:"design_id"` //设计sn
BuyNum int64 `json:"buy_num"` //购买数量
2023-06-13 05:07:09 +00:00
IsCheck int64 `json:"is_check,optional"`
2023-06-13 06:13:40 +00:00
}
//删除购物车
type CartDeleteReq {
Id int64 `json:"id"`
2023-06-13 06:29:44 +00:00
}
//获取用户购物车数量
type CartNumberRsp {
Num int64 `json:"num"`
2023-06-13 09:47:48 +00:00
}
//获取用户购物车列表
type CartListReq {
Size uint32 `form:"size"`
}
type CartListRsp {
Id int64 `json:"id"`
Cover string `json:"cover"`
Name string `json:"name"`
Capacity string `json:"capacity"`
ETA string `json:"ETA"`
Pcs int64 `json:"pcs"`
ProductSn string `json:"product_sn"`
DesignSn string `json:"designSn"`
Option CartOption `json:"option"`
IsCheck int64 `json:"is_check"`
TsTime string `json:"ts_time"`
PcsList []PcsItem `json:"pcs_list"`
Size CartSizeItem `json:"size"`
}
type CartOption {
Id int64 `json:"id"`
Title string `json:"title"`
Price float64 `json:"price"`
}
type PcsItem {
Num int64 `json:"num"`
TotalNum int64 `json:"total_num"`
Title string `json:"title"`
Price float64 `json:"price"`
}
type CartSizeItem {
Cm string `json:"cm"`
Inch string `json:"inch"`
2023-05-31 03:38:17 +00:00
}