415 lines
		
	
	
		
			14 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			415 lines
		
	
	
		
			14 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| syntax = "v1"
 | |
| 
 | |
| info (
 | |
| 	title: // TODO: add title
 | |
| 	desc: // TODO: add description
 | |
| 	author: ""
 | |
| 	email: ""
 | |
| )
 | |
| 
 | |
| import "basic.api"
 | |
| 
 | |
| service product {
 | |
| 	//获取产品列表
 | |
| 	@handler GetProductListHandler
 | |
| 	get /api/product/list(GetProductListReq) returns (response);
 | |
| 	//获取支付成功后推荐产品
 | |
| 	@handler GetSuccessRecommandHandler
 | |
| 	get /api/product/success-recommand (GetSuccessRecommandReq) returns (response);
 | |
| 	//获取分类下的产品以及尺寸
 | |
| 	@handler GetSizeByProductHandler
 | |
| 	get /api/product/get-size-by-product  returns (response);
 | |
| 	//获取保存的设计信息
 | |
| 	@handler GetProductDesignHandler
 | |
| 	get /api/product/design(GetProductDesignReq)  returns (response);
 | |
| 	//产品设计数据采集
 | |
| 	@handler DesignGatherHandler
 | |
| 	post /api/product/design-gather  (DesignGatherReq)  returns (response);
 | |
| 	//获取产品信息
 | |
| 	@handler GetProductInfoHandler
 | |
| 	get /api/product/info(GetProductInfoReq) returns (response);
 | |
| 	//保存设计信息
 | |
| 	@handler SaveDesignHandler
 | |
| 	post /api/product/save-design(SaveDesignReq) returns (response);
 | |
| 	//其他产品推荐列表
 | |
| 	@handler OtherProductListHandler
 | |
| 	get /api/product/other-list (OtherProductListReq) returns (response);
 | |
| 	//获取详情页推荐产品列表
 | |
| 	@handler GetRecommandProductListHandler
 | |
| 	get /api/product/recommand (GetRecommandProductListReq) returns (response);
 | |
| 	//获取分类产品列表
 | |
| 	@handler GetTagProductListHandler
 | |
| 	get /api/product/tag_product_list(GetTagProductListReq) returns (response);
 | |
| 	//*********************产品详情分解接口开始***********************
 | |
| 	//获取云渲染设计方案信息
 | |
| 	@handler GetRenderDesignHandler
 | |
| 	get /api/product/render_design(GetRenderDesignReq) returns (response);
 | |
| 	//获取产品模型信息
 | |
| 	@handler GetModelByPidHandler
 | |
| 	get /api/product/get_model_by_pid(GetModelByPidReq) returns (response);
 | |
| 	//获取产品阶梯价格列表
 | |
| 	@handler GetPriceByPidHandler
 | |
| 	get /api/product/get_price_by_pid(GetPriceByPidReq) returns (response);
 | |
| 	//获取产品尺寸列表
 | |
| 	@handler GetSizeByPidHandler
 | |
| 	get /api/product/get_size_by_pid(GetSizeByPidReq) returns (response);
 | |
| 	//获取产品模板列表
 | |
| 	@handler GetTemplateByPidHandler
 | |
| 	get /api/product/get_template_by_pid(GetTemplateByPidReq) returns (response);
 | |
| 	//获取产品配件数据
 | |
| 	@handler GetFittingByPidHandler
 | |
| 	get /api/product/get_fitting_by_pid(GetFittingByPidReq) returns (response);
 | |
| 	//获取产品灯光数据
 | |
| 	@handler GetLightByPidHandler
 | |
| 	get /api/product/get_light_by_pid(GetLightByPidReq) returns (response);
 | |
| 	//获取产品渲染设置
 | |
| 	@handler GetRenderSettingByPidHandler
 | |
| 	get /api/product/get_render_setting_by_pid(GetRenderSettingByPidReq) returns (response);
 | |
| 	//获取产品千人千面设计方案
 | |
| 	@handler GetLastProductDesignHandler
 | |
| 	get /api/product/get_last_product_design(request) returns (response);
 | |
| 	//*********************产品详情分解接口结束***********************
 | |
| }
 | |
| 
 | |
| //获取产品列表
 | |
| type GetProductListReq {
 | |
| 	Cid    int64  `form:"cid"`
 | |
| 	Size   uint32 `form:"size"`
 | |
| 	Page   uint32 `form:"page,optional"`
 | |
| 	IsDemo uint32 `form:"is_demo,optional"`
 | |
| }
 | |
| type GetProductListRsp {
 | |
| 	Ob          Ob     `json:"ob"`
 | |
| 	TypeName    string `json:"typeName"`
 | |
| 	Description string `json:"description"`
 | |
| }
 | |
| type Ob {
 | |
| 	Items []Items `json:"items"`
 | |
| 	Meta  Meta    `json:"_meta"`
 | |
| }
 | |
| type Items {
 | |
| 	Id           int64  `json:"id"`
 | |
| 	Sn           string `json:"sn"`
 | |
| 	Title        string `json:"title"`
 | |
| 	Cover        string `json:"cover"`
 | |
| 	Intro        string `json:"intro"`
 | |
| 	CoverImg     string `json:"cover_img"`
 | |
| 	IsEnv        int64  `json:"isEnv"`
 | |
| 	IsMicro      int64  `json:"isMicro"`
 | |
| 	SizeNum      uint32 `json:"sizeNum"`
 | |
| 	MiniPrice    int64  `json:"miniPrice"`
 | |
| 	CoverDefault string `json:"coverDefault"`
 | |
| }
 | |
| //获取支付成功后推荐产品
 | |
| type GetSuccessRecommandReq {
 | |
| 	Num  uint32 `form:"num"`
 | |
| 	Size uint32 `form:"size"`
 | |
| 	Sn   string `form:"sn"`
 | |
| }
 | |
| type GetSuccessRecommandRsp {
 | |
| 	Title        string `json:"title"`
 | |
| 	Cover        string `json:"cover"`
 | |
| 	CoverImg     string `json:"coverImg"`
 | |
| 	Sn           string `json:"sn"`
 | |
| 	Id           int64  `json:"id"`
 | |
| 	SkuId        int64  `json:"skuId"`
 | |
| 	CoverDefault string `json:"coverDefault"`
 | |
| }
 | |
| 
 | |
| //获取分类下的产品以及尺寸
 | |
| type GetSizeByProductRsp {
 | |
| 	Id       int64      `json:"id"`
 | |
| 	Name     string     `json:"name"`
 | |
| 	Children []Children `json:"children"`
 | |
| }
 | |
| type Children {
 | |
| 	Id           int64         `json:"id"`
 | |
| 	Name         string        `json:"name"`
 | |
| 	Cycle        int           `json:"cycle"`
 | |
| 	ChildrenList []ChildrenObj `json:"children"`
 | |
| }
 | |
| type ChildrenObj {
 | |
| 	Id        int64      `json:"id"`
 | |
| 	Name      string     `json:"name"`
 | |
| 	PriceList []PriceObj `json:"price_list"`
 | |
| }
 | |
| type PriceObj {
 | |
| 	Num   int     `json:"num"`
 | |
| 	Price float64 `json:"price"`
 | |
| }
 | |
| //获取保存的设计信息
 | |
| type GetProductDesignReq {
 | |
| 	Sn string `form:"sn"`
 | |
| }
 | |
| type GetProductDesignRsp {
 | |
| 	ProductId  int64 `json:"product_id"`
 | |
| 	TemplateId int64 `json:"template_id"`
 | |
| 	//MaterialId int64  `json:"material_id"`
 | |
| 	SizeId     int64  `json:"size_id"`
 | |
| 	OptionalId int64  `json:"optional_id"`
 | |
| 	Cover      string `json:"cover"`
 | |
| 	Info       string `json:"info"`
 | |
| }
 | |
| //产品设计数据采集
 | |
| type DesignGatherReq {
 | |
| 	Data string `json:"data"`
 | |
| }
 | |
| type DesignGatherRsp {
 | |
| 	Sn string `json:"sn"`
 | |
| }
 | |
| //获取产品信息
 | |
| type GetProductInfoReq {
 | |
| 	Pid                string `form:"pid"`
 | |
| 	Size               uint32 `form:"size"`
 | |
| 	ClientNo           string `form:"client_no"`
 | |
| 	HaveCloudRendering bool   `form:"haveCloudRendering,optional"`
 | |
| }
 | |
| type GetProductInfoRsp {
 | |
| 	Id             int64          `json:"id"`
 | |
| 	Type           int64          `json:"type"`
 | |
| 	Title          string         `json:"title"`
 | |
| 	IsEnv          int64          `json:"isEnv"`
 | |
| 	IsMicro        int64          `json:"isMicro"`
 | |
| 	TypeName       string         `json:"typeName"`
 | |
| 	IsLowRendering bool           `json:"is_low_rendering"`
 | |
| 	IsRemoveBg     bool           `json:"is_remove_bg"`
 | |
| 	Materials      []MaterialItem `json:"materials"`
 | |
| 	Sizes          []SizeItem     `json:"sizes"`
 | |
| 	Templates      interface{}    `json:"templates"`
 | |
| 	Prices         interface{}    `json:"prices"`
 | |
| 	LastDesign     interface{}    `json:"last_design"`
 | |
| 	RenderDesign   interface{}    `json:"render_design"`
 | |
| 	Colors         interface{}    `json:"colors"`
 | |
| }
 | |
| type SizeItem {
 | |
| 	Id              int64     `json:"id"`
 | |
| 	Title           SizeTitle `json:"title"`
 | |
| 	Capacity        string    `json:"capacity"`
 | |
| 	Cover           string    `json:"cover"`
 | |
| 	Sort            int64     `json:"sort"`
 | |
| 	PartsCanDeleted bool      `json:"parts_can_deleted"`
 | |
| }
 | |
| type SizeTitle {
 | |
| 	Cm   string `json:"cm"`
 | |
| 	Inch string `json:"inch"`
 | |
| }
 | |
| type MaterialItem {
 | |
| 	Id    int64  `json:"id"`
 | |
| 	Title string `json:"title"`
 | |
| }
 | |
| //保存设计信息
 | |
| type SaveDesignReq {
 | |
| 	Data string `json:"data"` //加密信息
 | |
| }
 | |
| type SaveDesignRsp {
 | |
| 	Sn string `json:"sn"`
 | |
| }
 | |
| //保存设计信息(解密结构体)
 | |
| type SaveDesignReqRealStruct {
 | |
| 	ProductId  int64      `json:"product_id"`
 | |
| 	SizeId     int64      `json:"size_id"`
 | |
| 	OptionalId int64      `json:"optional_id"`
 | |
| 	TemplateId int64      `json:"template_id"`
 | |
| 	Sn         string     `json:"sn"`
 | |
| 	Data       DesignData `json:"data"`
 | |
| 	Cover      string     `json:"cover"`
 | |
| 	PageGuid   string     `json:"pageGuid"`
 | |
| }
 | |
| 
 | |
| type DesignData {
 | |
| 	MainColor      ColorFill     `json:"MainColor"`
 | |
| 	SecondaryColor ColorFill     `json:"SecondaryColor"`
 | |
| 	Logo           DesignLogo    `json:"Logo"`
 | |
| 	Slogan         DesignSlogan  `json:"Slogan"`
 | |
| 	QRcode         DesignQRcode  `json:"QRcode"`
 | |
| 	Website        DesignWebsite `json:"Website"`
 | |
| 	Phone          DesignPhone   `json:"Phone"`
 | |
| 	Address        DesignAddress `json:"Address"`
 | |
| }
 | |
| type DesignAddress {
 | |
| 	Text   string `json:"text"`
 | |
| 	IfShow bool   `json:"ifShow"`
 | |
| }
 | |
| type DesignPhone {
 | |
| 	Text   string `json:"text"`
 | |
| 	IfShow bool   `json:"ifShow"`
 | |
| }
 | |
| type DesignWebsite {
 | |
| 	Text   string `json:"text"`
 | |
| 	IfShow bool   `json:"ifShow"`
 | |
| }
 | |
| type DesignQRcode {
 | |
| 	Text    string `json:"text"`
 | |
| 	SvgPath string `json:"svgPath"`
 | |
| 	IfShow  bool   `json:"ifShow"`
 | |
| }
 | |
| type DesignSlogan {
 | |
| 	Text   string `json:"text"`
 | |
| 	IfShow bool   `json:"ifShow"`
 | |
| }
 | |
| type DesignLogo {
 | |
| 	Material     string   `json:"material"`
 | |
| 	MaterialName string   `json:"materialName"`
 | |
| 	MaterialTime string   `json:"materialTime"`
 | |
| 	Fill         string   `json:"fill"`
 | |
| 	FillName     string   `json:"fill_name"`
 | |
| 	Colors       []string `json:"colors"`
 | |
| }
 | |
| type ColorFill {
 | |
| 	Fill string `json:"fill"`
 | |
| }
 | |
| //其他产品推荐列表
 | |
| type OtherProductListReq {
 | |
| 	Cid  int64  `form:"cid"`
 | |
| 	Num  int64  `form:"num"`
 | |
| 	Size uint32 `form:"size"`
 | |
| }
 | |
| type OtherProductListRsp {
 | |
| 	Title        string `json:"title"`
 | |
| 	Cover        string `json:"cover"`
 | |
| 	CoverImg     string `json:"cover_img"`
 | |
| 	CoverDefault string `json:"cover_default"`
 | |
| 	Sn           string `json:"sn"`
 | |
| 	Id           int64  `json:"id"`
 | |
| 	SkuId        int64  `json:"sku_id"`
 | |
| }
 | |
| //获取详情页推荐产品列表
 | |
| type GetRecommandProductListReq {
 | |
| 	Size uint32 `form:"size"`
 | |
| 	Num  int64  `form:"num"`
 | |
| 	Sn   string `form:"sn"`
 | |
| }
 | |
| type GetRecommandProductListRsp {
 | |
| 	Id           int64  `json:"id"`
 | |
| 	Sn           string `json:"sn"`
 | |
| 	Title        string `json:"title"`
 | |
| 	TitleCn      string `json:"title_cn"`
 | |
| 	Cover        string `json:"cover"`
 | |
| 	CoverImg     string `json:"cover_img"`
 | |
| 	CoverDefault string `json:"cover_default"`
 | |
| 	Intro        string `json:"intro"`
 | |
| }
 | |
| //获取分类产品列表
 | |
| type GetTagProductListReq {
 | |
| 	Cid         int64  `form:"cid,optional"`          //分类id
 | |
| 	Size        uint32 `form:"size,optional"`         //尺寸
 | |
| 	WithProduct bool   `form:"with_product,optional"` //是否携带分类下的产品
 | |
| }
 | |
| type GetTagProductListRsp {
 | |
| 	TotalCategoryProduct int       `json:"total_category_product"`
 | |
| 	TagList              []TagItem `json:"tag_list"`
 | |
| }
 | |
| type TagItem {
 | |
| 	TypeName       string       `json:"type_name"`
 | |
| 	TypeId         int64        `json:"type_id"`
 | |
| 	Description    string       `json:"description"`
 | |
| 	Level          int64        `json:"level"`
 | |
| 	LevelPrefix    string       `json:"level_prefix"`
 | |
| 	Icon           string       `json:"icon"`
 | |
| 	Sort           int64        `json:"sort"`
 | |
| 	TagProductList []TagProduct `json:"tag_product_list"` //分类下的产品
 | |
| 	ChildTagList   []*TagItem   `json:"child_tag_list"`
 | |
| }
 | |
| type TagProduct {
 | |
| 	ProductId           int64  `json:"product_id"`
 | |
| 	Sn                  string `json:"sn"`
 | |
| 	Title               string `json:"title"`
 | |
| 	Cover               string `json:"cover"`
 | |
| 	Intro               string `json:"intro"`
 | |
| 	CoverImg            string `json:"cover_img"`
 | |
| 	IsEnv               int64  `json:"is_env"`
 | |
| 	IsMicro             int64  `json:"is_micro"`
 | |
| 	SizeNum             uint32 `json:"size_num"`
 | |
| 	MiniPrice           int64  `json:"mini_price"`
 | |
| 	CoverDefault        string `json:"cover_default"`
 | |
| 	HaveOptionalFitting bool   `json:"have_optional_fitting"`
 | |
| }
 | |
| //获取云渲染设计方案信息
 | |
| type GetRenderDesignReq {
 | |
| 	Sn string `form:"sn"`
 | |
| }
 | |
| type GetRenderDesignRsp {
 | |
| 	Id         int64       `json:"id"`
 | |
| 	Info       interface{} `json:"info"`
 | |
| 	OptionalId int64       `json:"optional_id"`
 | |
| 	SizeId     int64       `json:"size_id"`
 | |
| 	TemplateId int64       `json:"template_id"`
 | |
| 	LogoColor  []string    `json:"logo_color"`
 | |
| }
 | |
| 
 | |
| //获取产品模型信息
 | |
| type GetModelByPidReq {
 | |
| 	Pid string `form:"pid"` //实际上是产品sn
 | |
| }
 | |
| //获取产品阶梯价格
 | |
| type GetPriceByPidReq {
 | |
| 	Pid string `form:"pid"`
 | |
| }
 | |
| type GetPriceByPidRsp {
 | |
| 	Items    []PriceItem `json:"items"`
 | |
| 	MinPrice float64     `json:"min_price"`
 | |
| 	MaxPrice float64     `json:"max_price"`
 | |
| }
 | |
| type PriceItem {
 | |
| 	Num      int64 `json:"num"`
 | |
| 	TotalNum int64 `json:"total_num"`
 | |
| 	Price    int64 `json:"price"`
 | |
| }
 | |
| //获取产品尺寸列表
 | |
| type GetSizeByPidReq {
 | |
| 	Pid string `form:"pid"`
 | |
| }
 | |
| 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
 | |
| }
 | |
| //获取产品模板列表
 | |
| type GetTemplateByPidReq {
 | |
| 	Pid  string `form:"pid"`
 | |
| 	Size uint32 `form:"size"`
 | |
| }
 | |
| //获取产品配件数据
 | |
| type GetFittingByPidReq {
 | |
| 	Pid string `form:"pid"`
 | |
| }
 | |
| type GetFittingByPidRsp {
 | |
| 	Id          int64       `json:"id"`
 | |
| 	MaterialImg string      `json:"material_img"`
 | |
| 	Title       string      `json:"title"`
 | |
| 	Price       int64       `json:"price"`
 | |
| 	ModelInfo   interface{} `json:"model_info"`
 | |
| }
 | |
| //获取产品灯光数据
 | |
| type GetLightByPidReq {
 | |
| 	Pid string `form:"pid"`
 | |
| }
 | |
| //获取产品渲染设置
 | |
| type GetRenderSettingByPidReq {
 | |
| 	Pid      string `form:"pid"`
 | |
| 	ClientNo string `form:"client_no,optional"`
 | |
| }
 | |
| type GetRenderSettingByPidRsp {
 | |
| 	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"` //低质量画质渲染开关
 | |
| 	IsRemoveBg     bool        `json:"is_remove_bg"`     //logo上传是否去背景
 | |
| 	RenderDesign   bool        `json:"render_design"`    //是否拥有云渲染设计方案
 | |
| 	LastDesign     bool        `json:"last_design"`      //是否拥有千人千面设计方案
 | |
| 	Colors         interface{} `json:"colors"`
 | |
| }
 | |
| //获取产品千人千面设计方案
 | |
| type GetLastProductDesignRsp {
 | |
| 	Id         int64       `json:"id"`
 | |
| 	OptionalId int64       `json:"optional_id"`
 | |
| 	SizeId     int64       `json:"size_id"`
 | |
| 	LogoColor  interface{} `json:"logo_color"`
 | |
| 	Info       interface{} `json:"info"`
 | |
| } |