fix
This commit is contained in:
parent
6ec89bc13a
commit
9e4703bd1f
|
@ -14,7 +14,7 @@ type FsShoppingCart struct {
|
|||
PriceId *int64 `gorm:"default:0;" json:"price_id"` // 价格id
|
||||
SizeId *int64 `gorm:"default:0;" json:"size_id"` // 尺寸id
|
||||
MaterialId *int64 `gorm:"default:0;" json:"material_id"` // 材质id
|
||||
FittingIds *string `gorm:"default:'';" json:"fitting_ids"` // 配件id集合
|
||||
FittingId *int64 `gorm:"default:0;" json:"fitting_id"` // 配件id
|
||||
PurchaseQuantity *int64 `gorm:"default:0;" json:"purchase_quantity"` // 购买数量
|
||||
UnitPrice *int64 `gorm:"default:0;" json:"unit_price"` // 当时加入购物车的单价,不作为支付计算,支付计算需要实时价格(厘)换算美元除以1000
|
||||
TotalPrice *int64 `gorm:"default:0;" json:"total_price"` // 当时加入购物车单价x数量的总价,不作为支付计算,支付计算需要实时价格
|
||||
|
|
48
server_api/shopping-cart.api
Normal file
48
server_api/shopping-cart.api
Normal file
|
@ -0,0 +1,48 @@
|
|||
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"` //当前页
|
||||
}
|
Loading…
Reference in New Issue
Block a user