139 lines
3.8 KiB
Plaintext
139 lines
3.8 KiB
Plaintext
syntax = "v1"
|
|
|
|
info (
|
|
title: "购物车服务"
|
|
desc: // TODO: add description
|
|
author: "ldm"
|
|
email: ""
|
|
)
|
|
|
|
import "basic.api"
|
|
|
|
service shopping-cart-confirmation {
|
|
//添加入购物车
|
|
@handler CartAddHandler
|
|
post /cart/add (CartAddReq) returns (response);
|
|
//删除购物车
|
|
@handler CartDeleteHandler
|
|
post /cart/del (CartDeleteReq) returns (response);
|
|
//获取用户购物车数量
|
|
@handler CartNumberHandler
|
|
get /cart/num ( ) returns (response);
|
|
//获取用户购物车列表
|
|
@handler CartListHandler
|
|
get /cart/list (CartListReq) returns (response);
|
|
//获取用户购物车订单详情
|
|
@handler CartOrderDetailHandler
|
|
get /cart/order-detail (CartOrderDetailReq) returns (response);
|
|
//变更发货方式和地址
|
|
@handler ChangeOrderMethodHandler
|
|
post /cart/chang-order-method (ChangeOrderMethodReq) returns (response);
|
|
//创建购物车订单
|
|
@handler CreateOrderHandler
|
|
post /cart/create-order (CreateOrderReq) returns (response);
|
|
}
|
|
|
|
//添加入购物车
|
|
type CartAddReq {
|
|
DesignId string `json:"design_id"` //设计sn
|
|
BuyNum int64 `json:"buy_num"` //购买数量
|
|
IsCheck int64 `json:"is_check,optional"`
|
|
}
|
|
//删除购物车
|
|
type CartDeleteReq {
|
|
Id int64 `json:"id"`
|
|
}
|
|
//获取用户购物车数量
|
|
type CartNumberRsp {
|
|
Num int64 `json:"num"`
|
|
}
|
|
//获取用户购物车列表
|
|
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"`
|
|
}
|
|
//获取用户购物车订单详情
|
|
type CartOrderDetailReq {
|
|
Sn string `form:"sn"`
|
|
}
|
|
type CartOrderDetailRsp {
|
|
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"`
|
|
}
|
|
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"`
|
|
}
|
|
|
|
//变更发货方式和地址
|
|
type ChangeOrderMethodReq {
|
|
Sn string `json:"sn"`
|
|
DeliveryMethod int64 `json:"delivery_method , options=1|2"`
|
|
AddressId int64 `json:"address_id"`
|
|
PayMethod int64 `json:"pay_method"`
|
|
}
|
|
//创建购物车订单
|
|
type CreateOrderReq {
|
|
Form []OrderFormItem `json:"form"`
|
|
}
|
|
type OrderFormItem {
|
|
Id int64 `json:"id"`
|
|
Num int64 `json:"num"`
|
|
}
|
|
type CreateOrderRsp {
|
|
Sn string `json:"sn"`
|
|
} |