syntax = "v1" info ( title: // TODO: add title desc: // TODO: add description author: "" email: "" ) import "basic.api" //验证登录 @server( jwt: Auth ) service product { //获取产品列表 @handler GetProductListHandler get /product/list(GetProductListReq) returns (response); //获取成功后的推荐产品 @handler GetSuccessRecommand get /product/success-recommand (GetSuccessRecommandReq) returns (response); } //非登录接口 service product { //获取分类下的产品以及尺寸 @handler GetSizeByProduct get /product/get-size-by-product () returns (response); } //获取产品列表 type GetProductListReq { Cid int64 `form:"cid"` Size uint32 `form:"size"` Page uint32 `form:"page"` IsDemo uint32 `form:"is_demo" , options=0|1"` } type GetProductListRsp { Ob Ob `json:"ob"` TypeName string `json:"typeName"` Description string `json:"description"` } type Ob { Items []Items `json:"items"` Links Links `json:"_links"` Meta Meta `json:"_meta"` } type Meta { TotalCount int32 `json:"totalCount"` PageCount int32 `json:"pageCount"` CurrentPage int32 `json:"currentPage"` PerPage int32 `json:"perPage"` } type Links { Self HrefUrl `json:"self"` First HrefUrl `json:"first"` Last HrefUrl `json:"last"` Next HrefUrl `json:"next"` } type HrefUrl { Href string `json:"href"` } 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 float64 `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"` }