fix:合图调整

This commit is contained in:
momo
2023-09-19 14:55:26 +08:00
161 changed files with 4621 additions and 1502 deletions

View File

@@ -33,11 +33,10 @@ type File {
Data []byte `fsfile:"data"`
}
// 统一分页
type Meta struct {
TotalCount int64 `json:"totalCount"`
PageCount int64 `json:"pageCount"`
CurrentPage int `json:"currentPage"`
PerPage int `json:"perPage"`
TotalCount int64 `json:"total_count"`
PageCount int64 `json:"page_count"`
CurrentPage int `json:"current_page"`
PerPage int `json:"per_page"`
}

42
server_api/order.api Normal file
View File

@@ -0,0 +1,42 @@
syntax = "v1"
info (
title: "订单模块"
desc: "订单相关"
author: ""
email: ""
)
import "basic.api"
service order {
@handler CreateOrderHandler
post /api/order/create(CreateOrderReq) returns (response);
@handler CreatePrePaymentHandler
post /api/order/create-prepayment(CreatePrePaymentReq) returns (response);
@handler OrderListHandler
post /api/order/list(OrderListReq) returns (response);
}
type CreateOrderReq struct {
CartIds []int64 `json:"cart_ids"`
DeliveryMethod string `json:"delivery_method,options=[1,2]"`
}
type CreatePrePaymentReq struct {
OrderSn string `json:"order_sn"`
DeliveryMethod int `json:"delivery_method"`
DeliveryAddres struct {
Address string `json:"address,optional"`
Name string `json:"name,optional"`
Mobile string `json:"mobile,optional"`
} `json:"delivery_addres,optional"`
}
type OrderListReq struct {
}

View File

@@ -20,8 +20,14 @@ type GetProductTemplateTagsReq {
Limit int `form:"limit"`
}
type GetProductTemplateTagsRsp {
Id int64 `json:"id"`
TemplateTag string `json:"template_tag"`
Cover string `json:"cover"`
CoverMetadata interface{} `json:"cover_metadata"`
Id int64 `json:"id"`
TemplateTag string `json:"template_tag"`
IsDefaultTemplateTag bool `json:"is_default_template_tag"`
Cover string `json:"cover"`
CoverMetadata interface{} `json:"cover_metadata"`
Colors []ColorsItem `json:"colors"`
SelectedColorIndex int `json:"selected_color_index"`
}
type ColorsItem {
Color []string `json:"color"`
}

View File

@@ -0,0 +1,121 @@
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(AddToCartReq) returns (response);
//删除购物车
@handler DeleteCartHandler
post /api/shopping-cart/delete(DeleteCartReq) returns (response);
//修改购物车购买数量
@handler ModifyCartPurchaseQuantityHandler
post /api/shopping-cart/modify(ModifyCartPurchaseQuantityReq) returns (response);
//获取购物车列表
@handler GetCartsHandler
get /api/shopping-cart/get_carts(GetCartsReq) returns (response);
//计算购物车价格
@handler CalculateCartPriceHandler
post /api/shopping-cart/calculate_cart_price(CalculateCartPriceReq) returns (response);
}
//加入购物车
type AddToCartReq {
ProductId int64 `json:"product_id"` //产品id
TemplateId int64 `json:"template_id,optional"` //模板id(不可定制的不传)
SizeId int64 `json:"size_id"` //尺寸id
FittingId int64 `json:"fitting_id,optional"` //配件id(没有可以不传)
PurchaseQuantity int64 `json:"purchase_quantity"` //购买数量
Logo string `json:"logo,optional"` //logo地址(没有可以不传)
CombineImage string `json:"combine_image,optional"` //合图地址 (没有可以不传)
RenderImage string `json:"render_image,optional"` //渲染结果图 (没有可以不传)
DiyInfo DiyInfo `json:"diy_info,optional"` //用户diy数据可选
}
type DiyInfo {
Phone string `json:"phone,optional"` //电话(可选)
Address string `json:"address,optional"` //地址 (可选)
Website string `json:"website,optional"` //网站 (可选)
Qrcode string `json:"qrcode,optional"` //二维码 (可选)
Slogan string `json:"slogan,optional"` //slogan (可选)
}
//删除购物车
type DeleteCartReq {
Id int64 `json:"id"` //购物车id
}
//修改购物车购买数量
type ModifyCartPurchaseQuantityReq {
Id int64 `json:"id"` //购物车id
PurchaseQuantity int64 `json:"purchase_quantity"` //数量
}
//获取购物车列表
type GetCartsReq {
CurrentPage int `form:"current_page"` //当前页
}
type GetCartsRsp {
Meta Meta `json:"meta"` //分页信息
CartList []CartItem `json:"cart_list"`
}
type CartItem {
ProductInfo ProductInfo `json:"product_info"` //产品信息
SizeInfo SizeInfo `json:"size_info"` //尺寸信息
FittingInfo FittingInfo `json:"fitting_info"` //配件信息
ItemPrice string `json:"item_price"` //单价
TotalPrice string `json:"total_price"` //单价X数量=总价
DiyInformation DiyInformation `json:"diy_information"` //diy信息
StepNum []int64 `json:"step_num"` //阶梯数量
PurchaseQuantity int64 `json:"purchase_quantity"` //当前购买数量
IsInvalid bool `json:"is_invalid"` //是否无效
InvalidDescription string `json:"invalid_description"` //无效原因
}
type ProductInfo {
ProductId int64 `json:"product_id"` //产品id
ProductName string `json:"product_name"`
ProductSn string `json:"product_sn"`
ProductCover string `json:"product_cover"` //产品图
ProductCoverMetadata interface{} `json:"product_cover_metadata"` //产品图元数据
}
type SizeInfo {
SizeId int64 `json:"size_id"` //尺寸id
Capacity string `json:"capacity"` //尺寸名称
Title SizeTitle `json:"title"`
}
type FittingInfo {
FittingId int64 `json:"fitting_id"` //配件id
FittingName string `json:"fitting_name"` //配件名称
}
type SizeTitle {
Cm string `json:"cm"`
Inch string `json:"inch"`
}
type DiyInformation {
Phone string `json:"phone"`
Address string `json:"address"`
Website string `json:"website"`
Qrcode string `json:"qrcode"`
Slogan string `json:"slogan"`
}
//计算购物车价格
type CalculateCartPriceReq {
CalculateList []CalculateItem `json:"calculate_list"`
}
type CalculateItem {
CartId int64 `json:"cart_id"` //购物车id
PurchaseQuantity int64 `json:"purchase_quantity"` //数量
}
type CalculateCartPriceRsp {
SubTotalPrice string `json:"sub_total_price"`
CalculateResultList []CalculateResultItem `json:"calculate_result_list"`
}
type CalculateResultItem {
CartId int64 `json:"cart_id"` //购物车id
ItemPrice string `json:"item_price"` //单价
TotalPrice string `json:"total_price"` //总价
}