fusenapi/server_api/product.api

224 lines
8.7 KiB
Plaintext
Raw Normal View History

2023-05-31 03:38:17 +00:00
syntax = "v1"
info (
title: // TODO: add title
desc: // TODO: add description
author: ""
email: ""
)
2023-06-21 08:39:55 +00:00
2023-06-01 07:32:28 +00:00
import "basic.api"
2023-06-21 08:39:55 +00:00
2023-06-05 03:27:01 +00:00
service product {
2023-07-13 11:05:13 +00:00
//获取分类产品列表
@handler GetTagProductListHandler
get /api/product/tag_product_list(GetTagProductListReq) returns (response);
2023-07-14 08:48:04 +00:00
//获取产品模型信息
@handler GetModelByPidHandler
get /api/product/get_model_by_pid(GetModelByPidReq) returns (response);
2023-09-26 06:23:09 +00:00
//获取产品阶梯价格列表(即将废弃)
2023-07-14 11:25:52 +00:00
@handler GetPriceByPidHandler
get /api/product/get_price_by_pid(GetPriceByPidReq) returns (response);
2023-09-26 02:54:11 +00:00
//获取产品阶梯价格信息
@handler GetProductStepPriceHandler
get /api/product/get_product_step_price(GetProductStepPriceReq) returns (response);
2023-09-26 03:10:41 +00:00
//根据产品+配件搭配计算价格
2023-09-26 03:40:27 +00:00
@handler CalculateProductPriceHandler
post /api/product/calculate_product_price(CalculateProductPriceReq) returns (response);
2023-07-17 03:28:59 +00:00
//获取产品尺寸列表
@handler GetSizeByPidHandler
get /api/product/get_size_by_pid(GetSizeByPidReq) returns (response);
2023-08-11 06:52:16 +00:00
//获取产品模板
2023-07-17 06:40:24 +00:00
@handler GetTemplateByPidHandler
get /api/product/get_template_by_pid(GetTemplateByPidReq) returns (response);
2023-07-17 07:38:41 +00:00
//获取产品配件数据
@handler GetFittingByPidHandler
get /api/product/get_fitting_by_pid(GetFittingByPidReq) returns (response);
2023-07-17 08:04:53 +00:00
//获取产品灯光数据
@handler GetLightByPidHandler
get /api/product/get_light_by_pid(GetLightByPidReq) returns (response);
2023-07-17 09:08:45 +00:00
//获取产品渲染设置
@handler GetRenderSettingByPidHandler
get /api/product/get_render_setting_by_pid(GetRenderSettingByPidReq) returns (response);
2023-07-20 07:45:58 +00:00
//获取详情页推荐产品列表
@handler GetRecommandProductListHandler
get /api/product/recommand(GetRecommandProductListReq) returns (response);
2023-07-20 09:35:13 +00:00
//获取列表页推荐产品列表
2023-07-20 09:47:28 +00:00
@handler HomePageRecommendProductListHandler
get /api/product/home_page_recommend(HomePageRecommendProductListReq) returns (response);
2023-06-07 09:27:17 +00:00
}
2023-07-11 09:08:19 +00:00
//获取详情页推荐产品列表
type GetRecommandProductListReq {
2023-08-15 11:43:50 +00:00
Size int32 `form:"size,optional"`
2023-07-21 06:15:43 +00:00
Num int64 `form:"num,optional"`
2023-07-11 09:08:19 +00:00
Sn string `form:"sn"`
}
type GetRecommandProductListRsp {
2023-09-06 04:21:58 +00:00
Id int64 `json:"id"`
Sn string `json:"sn"`
Title string `json:"title"`
TitleCn string `json:"title_cn"`
Cover string `json:"cover"`
CoverMetadata interface{} `json:"cover_metadata"`
CoverImg string `json:"cover_img"`
CoverImgMetadata interface{} `json:"cover_img_metadata"`
CoverDefault []CoverDefaultItem `json:"cover_default"`
Intro string `json:"intro"`
2023-10-08 02:33:25 +00:00
Recommend bool `json:"recommend"`
2023-09-06 04:21:58 +00:00
MinPrice int64 `json:"min_price"`
2023-09-07 10:28:19 +00:00
IsCustomization int64 `json:"is_customization"`
2023-07-13 11:05:13 +00:00
}
//获取分类产品列表
type GetTagProductListReq {
2023-07-19 11:29:50 +00:00
Cid int64 `form:"cid,optional"` //分类id
Size uint32 `form:"size,optional"` //尺寸
2023-08-21 02:21:02 +00:00
TemplateTag string `form:"template_tag,optional"` //模板标签
2023-07-19 11:29:50 +00:00
WithProduct bool `form:"with_product,optional"` //是否携带分类下的产品
2023-07-13 11:05:13 +00:00
}
type GetTagProductListRsp {
2023-07-19 11:33:26 +00:00
TotalCategoryProduct int `json:"total_category_product"`
TagList []TagItem `json:"tag_list"`
2023-07-13 11:05:13 +00:00
}
type TagItem {
2023-07-24 10:02:30 +00:00
TypeName string `json:"type_name"`
TypeId int64 `json:"type_id"`
Icon string `json:"icon"`
Sort int64 `json:"sort"`
LevelPrefix string `json:"level_prefix"`
TagProductList []interface{} `json:"tag_product_list"` //分类下的产品
ChildTagList []*TagItem `json:"child_tag_list"`
2023-07-13 11:05:13 +00:00
}
type TagProduct {
2023-09-05 10:29:44 +00:00
ProductId int64 `json:"product_id"`
Sn string `json:"sn"`
Title string `json:"title"`
Cover string `json:"cover"`
CoverMetadata interface{} `json:"cover_metadata"`
SizeNum uint32 `json:"size_num"`
MinPrice int64 `json:"min_price"`
2023-08-08 04:56:53 +00:00
//彩膜列表
CoverDefault []CoverDefaultItem `json:"cover_default"`
HaveOptionalFitting bool `json:"have_optional_fitting"`
Recommended bool `json:"recommended"`
2023-09-07 10:28:19 +00:00
IsCustomization int64 `json:"is_customization"`
2023-08-08 04:56:53 +00:00
}
type CoverDefaultItem {
2023-09-06 07:06:50 +00:00
TemplateTag string `json:"template_tag"`
2023-09-05 08:35:02 +00:00
Cover string `json:"cover"`
CoverMetadata interface{} `json:"cover_metadata"`
2023-07-14 07:57:27 +00:00
}
2023-07-14 08:48:04 +00:00
//获取产品模型信息
type GetModelByPidReq {
Pid string `form:"pid"` //实际上是产品sn
2023-07-14 11:25:52 +00:00
}
//获取产品阶梯价格
type GetPriceByPidReq {
Pid string `form:"pid"`
2023-07-17 02:54:37 +00:00
}
type GetPriceByPidRsp {
2023-07-21 03:34:36 +00:00
Items []PriceItem `json:"items"`
MinPrice float64 `json:"min_price"`
MaxPrice float64 `json:"max_price"`
2023-07-21 09:32:15 +00:00
StepRange []StepRange `json:"step_range"`
2023-07-21 03:34:36 +00:00
}
2023-07-21 09:31:28 +00:00
type StepRange {
2023-07-21 09:49:02 +00:00
Begin int64 `json:"begin"`
End int64 `json:"end"`
Price float64 `json:"price"`
2023-07-17 02:54:37 +00:00
}
type PriceItem {
Num int64 `json:"num"`
TotalNum int64 `json:"total_num"`
Price int64 `json:"price"`
2023-07-17 03:28:59 +00:00
}
2023-09-26 02:54:11 +00:00
//获取产品阶梯价格信息
type GetProductStepPriceReq {
ProductId int64 `form:"product_id"`
}
2023-09-26 03:10:41 +00:00
//根据产品+配件搭配计算价格
2023-09-26 03:40:27 +00:00
type CalculateProductPriceReq {
2023-09-26 03:10:41 +00:00
ProductId int64 `json:"product_id"`
SizeId int64 `json:"size_id"`
FittingId int64 `json:"fitting_id,optional"`
PurchaseQuantity int64 `json:"purchase_quantity"`
}
2023-09-26 03:40:27 +00:00
type CalculateProductPriceRsp {
2023-10-07 06:24:57 +00:00
ItemPrice string `json:"item_price"`
TotalPrice string `json:"total_price"`
StepRange interface{} `json:"step_range"`
2023-09-26 03:40:27 +00:00
}
2023-07-17 03:28:59 +00:00
//获取产品尺寸列表
type GetSizeByPidReq {
2023-09-12 09:05:41 +00:00
Pid string `form:"pid"`
TemplateTag string `form:"template_tag"`
2023-07-17 03:28:59 +00:00
}
type GetSizeByPidRsp {
Id int64 `json:"id"` //尺寸id
Title interface{} `json:"title"`
Capacity string `json:"capacity"` //容量、尺寸、尺码描述
Cover string `json:"cover"` //缩略图
PartsCanDeleted bool `json:"parts_can_deleted"` //用户可否删除配件
ModelId int64 `json:"model_id"` //产品主模型id
2023-07-21 06:07:42 +00:00
IsPopular bool `json:"is_popular"` //是否受欢迎
2023-09-27 09:52:03 +00:00
MinPrice string `json:"min_price"` //最小价格
2023-09-12 10:09:38 +00:00
IsDefault bool `json:"is_default"` //是否默认(这里的默认是跟列表页一致)
2023-07-17 06:40:24 +00:00
}
2023-08-11 06:52:16 +00:00
//获取产品模板
2023-07-17 06:40:24 +00:00
type GetTemplateByPidReq {
2023-08-18 02:26:33 +00:00
Pid string `form:"pid"`
ProductSizeId int64 `form:"product_size_id,optional"`
TemplateTag string `form:"template_tag"`
2023-07-17 07:38:41 +00:00
}
//获取产品配件数据
type GetFittingByPidReq {
Pid string `form:"pid"`
}
type GetFittingByPidRsp {
Id int64 `json:"id"`
MaterialImg string `json:"material_img"`
Title string `json:"title"`
2023-09-27 09:52:03 +00:00
Price string `json:"price"`
2023-07-21 06:07:42 +00:00
IsPopular bool `json:"is_popular"`
2023-07-17 07:38:41 +00:00
ModelInfo interface{} `json:"model_info"`
2023-07-17 08:04:53 +00:00
}
//获取产品灯光数据
type GetLightByPidReq {
Pid string `form:"pid"`
2023-07-17 09:08:45 +00:00
}
//获取产品渲染设置
type GetRenderSettingByPidReq {
Pid string `form:"pid"`
ClientNo string `form:"client_no,optional"`
}
type GetRenderSettingByPidRsp {
2023-09-11 08:20:09 +00:00
Id int64 `json:"id"` //产品id
Type int64 `json:"type"` //产品typeid
Title string `json:"title"` //产品名称
IsEnv int64 `json:"isEnv"` //产品标签之一
IsMicro int64 `json:"isMicro"` //产品标签之一
TypeName string `json:"typeName"` //产品类型名称
IsLowRendering bool `json:"is_low_rendering"` //低质量画质渲染开关
IsCustomization int64 `json:"is_customization"` //产品是否可定制
IsRemoveBg bool `json:"is_remove_bg"` //logo上传是否去背景
RenderDesign bool `json:"render_design"` //是否拥有云渲染设计方案
LastDesign bool `json:"last_design"` //是否拥有千人千面设计方案
Colors interface{} `json:"colors"`
2023-07-17 11:39:35 +00:00
}
2023-07-20 09:35:13 +00:00
//获取列表页推荐产品(返回是这个维度数组)
2023-07-20 09:47:28 +00:00
type HomePageRecommendProductListReq {
2023-08-14 03:04:25 +00:00
Size uint32 `form:"size"`
MerchantType int64 `form:"merchant_type"`
2023-07-20 09:35:13 +00:00
}
2023-07-20 09:47:28 +00:00
type HomePageRecommendProductListRsp {
2023-08-14 04:30:14 +00:00
Id int64 `json:"id"`
Sn string `json:"sn"`
Title string `json:"title"`
Cover string `json:"cover"`
2023-09-05 08:35:02 +00:00
CoverMetadata interface{} `json:"cover_metadata"`
2023-08-14 04:30:14 +00:00
SizeNum uint32 `json:"size_num"`
MinPrice int64 `json:"min_price"`
CoverDefault []CoverDefaultItem `json:"cover_default"`
HaveOptionalFitting bool `json:"have_optional_fitting"`
2023-09-07 10:28:19 +00:00
IsCustomization int64 `json:"is_customization"`
2023-07-20 06:56:28 +00:00
}