218 lines
7.4 KiB
Plaintext
218 lines
7.4 KiB
Plaintext
syntax = "v1"
|
|
|
|
info (
|
|
title: "订单模块"
|
|
desc: "订单相关"
|
|
author: ""
|
|
email: ""
|
|
)
|
|
|
|
import "basic.api"
|
|
|
|
service orders {
|
|
|
|
@handler CreateOrderHandler
|
|
post /api/orders/create(CreateOrderReq) returns (response);
|
|
|
|
@handler CreatePrePaymentHandler
|
|
post /api/orders/create-prepayment(OrderRefundReq) returns (response);
|
|
|
|
@handler OrderListHandler
|
|
post /api/orders/list(OrderListReq) returns (response);
|
|
|
|
}
|
|
|
|
type CreateOrderReq struct {
|
|
CartIds []int64 `json:"cart_ids"`
|
|
DeliveryMethod string `json:"delivery_method"`
|
|
}
|
|
|
|
type OrderRefundReq struct {
|
|
OrderNo string `json:"order_no"`
|
|
DeliveryMethod int64 `json:"delivery_method"`
|
|
DeliveryAddres DeliveryAddres `json:"delivery_addres"`
|
|
}
|
|
type DeliveryAddres struct {
|
|
Address string `json:"address"`
|
|
Name string `json:"name"`
|
|
Mobile string `json:"mobile"`
|
|
}
|
|
|
|
type OrderDetail struct {
|
|
OrderProduct []OrderProduct `json:"order_product"`
|
|
OrderInfo OrderInfo `json:"order_info"`
|
|
OrderAmount OrderAmount `json:"order_amount"`
|
|
DeliveryAddres DeliveryAddres `json:"delivery_addres"`
|
|
}
|
|
|
|
type ProductLogoResource struct {
|
|
ResourceID string `json:"resource_id"`
|
|
ResourceType string `json:"resource_type"`
|
|
ResourceURL string `json:"resource_url"`
|
|
Metadata map[string]interface{} `json:"metadata"`
|
|
}
|
|
|
|
type TemplateInfo struct {
|
|
TemplateJSON string `json:"template_json"`
|
|
TemplateTag string `json:"template_tag"`
|
|
}
|
|
type ModelInfo struct {
|
|
ModelJSON string `json:"model_json"`
|
|
}
|
|
type FittingInfo struct {
|
|
FittingJSON string `json:"fitting_json"`
|
|
}
|
|
type SizeInfo struct {
|
|
Inch string `json:"inch"`
|
|
Cm string `json:"cm"`
|
|
}
|
|
type UserDiyInformation struct {
|
|
Phone string `json:"phone"`
|
|
Address string `json:"address"`
|
|
Website string `json:"website"`
|
|
Qrcode string `json:"qrcode"`
|
|
Slogan string `json:"slogan"`
|
|
}
|
|
type Snapshot struct {
|
|
Logo string `json:"logo"`
|
|
CombineImage string `json:"combine_image"`
|
|
RenderImage string `json:"render_image"`
|
|
TemplateInfo TemplateInfo `json:"template_info"`
|
|
ModelInfo ModelInfo `json:"model_info"`
|
|
FittingInfo FittingInfo `json:"fitting_info"`
|
|
SizeInfo SizeInfo `json:"size_info"`
|
|
UserDiyInformation UserDiyInformation `json:"user_diy_information"`
|
|
}
|
|
type ShoppingCartSnapshot struct {
|
|
ID int64 `json:"id"`
|
|
UserID int64 `json:"user_id"`
|
|
ProductID int64 `json:"product_id"`
|
|
TemplateID int64 `json:"template_id"`
|
|
ModelID int64 `json:"model_id"`
|
|
SizeID int64 `json:"size_id"`
|
|
FittingID int64 `json:"fitting_id"`
|
|
PurchaseQuantity int64 `json:"purchase_quantity"`
|
|
Snapshot Snapshot `json:"snapshot"`
|
|
IsHighlyCustomized int64 `json:"is_highly_customized"`
|
|
Ctime string `json:"ctime"`
|
|
Utime string `json:"utime"`
|
|
}
|
|
type OrderProduct struct {
|
|
ProductID string `json:"product_id"`
|
|
ProductName string `json:"product_name"`
|
|
ProductPrice string `json:"product_price"`
|
|
ProductLogo string `json:"product_logo"`
|
|
ProductLogoResource ProductLogoResource `json:"product_logo_resource"`
|
|
ProductSnapshot map[string]interface{} `json:"product_snapshot"`
|
|
Number int64 `json:"number"`
|
|
Amount string `json:"amount"`
|
|
Unit string `json:"unit"`
|
|
ExpectedDeliveryTime string `json:"expected_delivery_time"`
|
|
ShoppingCartSnapshot ShoppingCartSnapshot `json:"shopping_cart_snapshot"`
|
|
}
|
|
|
|
type OrderStatus struct {
|
|
StatusCode int64 `json:"status_code"`
|
|
StatusTitle string `json:"status_title"`
|
|
ExpectedTime string `json:"expected_time"`
|
|
Ctime string `json:"ctime"`
|
|
Utime string `json:"utime"`
|
|
Metadata map[string]interface{} `json:"metadata"`
|
|
Children []*OrderStatus `json:"children"`
|
|
}
|
|
type OrderInfo struct {
|
|
OrderNo string `json:"order_no"`
|
|
DeliveryMethod int64 `json:"delivery_method"`
|
|
Ctime string `json:"ctime"`
|
|
Utime string `json:"utime"`
|
|
Status OrderStatus `json:"status"`
|
|
StatusLink []OrderStatus `json:"status_link"`
|
|
Metadata map[string]interface{} `json:"metadata"`
|
|
}
|
|
type Subtotal struct {
|
|
Currency string `json:"currency"`
|
|
Current string `json:"current"`
|
|
Initiate string `json:"initiate"`
|
|
Change string `json:"change"`
|
|
ChangeRemark string `json:"change_remark"`
|
|
Metadata map[string]interface{} `json:"metadata"`
|
|
}
|
|
type ShippingFee struct {
|
|
Currency string `json:"currency"`
|
|
Current string `json:"current"`
|
|
Initiate string `json:"initiate"`
|
|
Change string `json:"change"`
|
|
ChangeRemark string `json:"change_remark"`
|
|
Metadata map[string]interface{} `json:"metadata"`
|
|
}
|
|
type Tax struct {
|
|
Currency string `json:"currency"`
|
|
Current string `json:"current"`
|
|
Initiate string `json:"initiate"`
|
|
Change string `json:"change"`
|
|
ChangeRemark string `json:"change_remark"`
|
|
Metadata map[string]interface{} `json:"metadata"`
|
|
}
|
|
type Discount struct {
|
|
Currency string `json:"currency"`
|
|
Current string `json:"current"`
|
|
Initiate string `json:"initiate"`
|
|
Change string `json:"change"`
|
|
ChangeRemark string `json:"change_remark"`
|
|
Metadata map[string]interface{} `json:"metadata"`
|
|
}
|
|
type Total struct {
|
|
Currency string `json:"currency"`
|
|
Current string `json:"current"`
|
|
Initiate string `json:"initiate"`
|
|
Change string `json:"change"`
|
|
ChangeRemark string `json:"change_remark"`
|
|
Metadata map[string]interface{} `json:"metadata"`
|
|
}
|
|
type PayStatus struct {
|
|
StatusCode int64 `json:"status_code"`
|
|
StatusTitle string `json:"status_title"`
|
|
Metadata map[string]interface{} `json:"metadata"`
|
|
}
|
|
|
|
type PayAmount struct {
|
|
Currency string `json:"currency"`
|
|
Current string `json:"current"`
|
|
Initiate string `json:"initiate"`
|
|
Change string `json:"change"`
|
|
ChangeRemark string `json:"change_remark"`
|
|
Metadata map[string]interface{} `json:"metadata"`
|
|
}
|
|
type Deposit struct {
|
|
TradeNo string `json:"trade_no"`
|
|
Status Status `json:"status"`
|
|
StatusLink []PayStatus `json:"status_link"`
|
|
PayTime string `json:"pay_time"`
|
|
PayAmount PayAmount `json:"pay_amount"`
|
|
PayMethod string `json:"pay_method"`
|
|
Metadata map[string]interface{} `json:"metadata"`
|
|
}
|
|
type RemainingBalance struct {
|
|
TradeNo string `json:"trade_no"`
|
|
Status PayStatus `json:"status"`
|
|
StatusLink []PayStatus `json:"status_link"`
|
|
PayTime string `json:"pay_time"`
|
|
PayAmount PayAmount `json:"pay_amount"`
|
|
PayMethod string `json:"pay_method"`
|
|
Metadata map[string]interface{} `json:"metadata"`
|
|
}
|
|
type OrderAmount struct {
|
|
Subtotal Subtotal `json:"subtotal"`
|
|
ShippingFee ShippingFee `json:"shipping_fee"`
|
|
Tax Tax `json:"tax"`
|
|
Discount Discount `json:"discount"`
|
|
Total Total `json:"total"`
|
|
Deposit Deposit `json:"deposit"`
|
|
RemainingBalance RemainingBalance `json:"remaining_balance"`
|
|
}
|
|
type DeliveryAddres struct {
|
|
Address string `json:"address"`
|
|
Name string `json:"name"`
|
|
Mobile string `json:"mobile"`
|
|
}
|