fusenapi/server_api/basic.api
2023-09-14 18:43:10 +08:00

224 lines
7.6 KiB
Plaintext

syntax = "v1"
info (
title: // TODO: add title
desc: // TODO: add description
author: ""
email: ""
)
type request {}
// response 统一返回码
type response {
Code int `json:"code"`
Message string `json:"msg"`
Data interface{} `json:"data"`
}
// Auth 认证结构
type Auth {
AccessSecret string `json:"accessSecret"`
AccessExpire int64 `json:"accessExpire"`
RefreshAfter int64 `json:"refreshAfter"`
}
// File 文件
type File {
Filename string `fsfile:"filename"`
Header map[string][]string `fsfile:"header"`
Size int64 `fsfile:"size"`
Data []byte `fsfile:"data"`
}
// 统一分页
type Meta struct {
TotalCount int64 `json:"totalCount"`
PageCount int64 `json:"pageCount"`
CurrentPage int `json:"currentPage"`
PerPage int `json:"perPage"`
}
type ProductLogoResource struct {
ResourceID string `json:"resource_id"`
ResourceType string `json:"resource_type"`
ResourceURL string `json:"resource_url"`
Metadata map[string]int64erface{} `json:"metadata"`
}
type ProductSnapshot struct {
}
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 ProductSnapshot `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 Children struct {
}
type Status 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]int64erface{} `json:"metadata"`
Children []Children `json:"children"`
}
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]int64erface{} `json:"metadata"`
Children []Children `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]int64erface{} `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]int64erface{} `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]int64erface{} `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]int64erface{} `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]int64erface{} `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]int64erface{} `json:"metadata"`
}
type PayStatus struct {
StatusCode int64 `json:"status_code"`
StatusTitle string `json:"status_title"`
Metadata map[string]int64erface{} `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]int64erface{} `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]int64erface{} `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]int64erface{} `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"`
}