fusenapi/server_api/shopping-cart-confirmation.api

139 lines
3.9 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-21 08:39:55 +00:00
2023-06-13 04:15:06 +00:00
import "basic.api"
2023-06-21 08:39:55 +00:00
2023-06-13 04:15:06 +00:00
service shopping-cart-confirmation {
//添加入购物车
@handler CartAddHandler
2023-07-12 03:09:43 +00:00
post /api/cart/add (CartAddReq) returns (response);
2023-06-13 06:13:40 +00:00
//删除购物车
@handler CartDeleteHandler
2023-07-12 03:09:43 +00:00
post /api/cart/del (CartDeleteReq) returns (response);
2023-06-13 06:29:44 +00:00
//获取用户购物车数量
@handler CartNumberHandler
2023-07-12 06:11:04 +00:00
get /api/cart/num (request) returns (response);
2023-06-13 09:47:48 +00:00
//获取用户购物车列表
@handler CartListHandler
2023-07-12 03:09:43 +00:00
get /api/cart/list (CartListReq) returns (response);
2023-06-14 06:05:27 +00:00
//获取用户购物车订单详情
@handler CartOrderDetailHandler
2023-07-12 03:09:43 +00:00
get /api/cart/order-detail (CartOrderDetailReq) returns (response);
2023-06-14 09:59:48 +00:00
//变更发货方式和地址
@handler ChangeOrderMethodHandler
2023-07-12 03:09:43 +00:00
post /api/cart/chang-order-method (ChangeOrderMethodReq) returns (response);
2023-07-03 09:33:59 +00:00
//创建购物车订单
@handler CreateOrderHandler
2023-07-12 03:09:43 +00:00
post /api/cart/create-order (CreateOrderReq) 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 {
2023-06-20 10:37:56 +00:00
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"`
2023-06-13 09:47:48 +00:00
}
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-06-14 06:05:27 +00:00
}
//获取用户购物车订单详情
type CartOrderDetailReq {
Sn string `form:"sn"`
}
type CartOrderDetailRsp {
2023-06-20 10:37:56 +00:00
DeliveryMethod int64 `json:"delivery_method"`
AddressId int64 `json:"address_id"`
PayTime string `json:"pay_time"`
PayMethod int64 `json:"pay_method"`
PayStep int64 `json:"pay_step"`
Subtotal string `json:"subtotal"`
Total string `json:"total"`
Remaining string `json:"remaining"`
AddrList []*CartAddr `json:"addr_list"`
Items []*CartDetailItem `json:"items"`
2023-06-14 06:05:27 +00:00
}
type CartDetailItem {
Cover string `json:"cover"`
Pcs int64 `json:"pcs"`
Amount string `json:"amount"`
Option string `json:"option"`
Size string `json:"size"`
Name string `json:"name"`
}
type CartAddr {
Id int64 `json:"id"`
Name string `json:"name"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Mobile string `json:"mobile"`
Street string `json:"street"`
Suite string `json:"suite"`
City string `json:"city"`
State string `json:"state"`
ZipCode string `json:"zip_code"`
IsDefault int64 `json:"is_default"`
2023-06-14 09:59:48 +00:00
}
//变更发货方式和地址
type ChangeOrderMethodReq {
Sn string `json:"sn"`
DeliveryMethod int64 `json:"delivery_method , options=1|2"`
AddressId int64 `json:"address_id"`
PayMethod int64 `json:"pay_method"`
2023-07-03 09:33:59 +00:00
}
//创建购物车订单
type CreateOrderReq {
Form []OrderFormItem `json:"form"`
}
type OrderFormItem {
Id int64 `json:"id"`
Num int64 `json:"num"`
}
type CreateOrderRsp {
Sn string `json:"sn"`
2023-05-31 03:38:17 +00:00
}