This commit is contained in:
laodaming 2023-06-06 15:30:12 +08:00
parent e8aabdb3cf
commit d31f3a1e41
3 changed files with 39 additions and 0 deletions

View File

@ -17,6 +17,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
Path: "/product/list",
Handler: GetProductListHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/product/success-recommand",
Handler: GetSuccessRecommandHandler(serverCtx),
},
},
)
}

View File

@ -56,6 +56,22 @@ type Items struct {
CoverDefault string `json:"coverDefault"`
}
type GetSuccessRecommandReq struct {
Num uint32 `form:"num"`
Size uint32 `form:"size"`
Sn string `form:"sn"`
}
type GetSuccessRecommandRsp struct {
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 Response struct {
Code int `json:"code"`
Message string `json:"msg"`

View File

@ -12,6 +12,9 @@ service product {
//获取产品列表
@handler GetProductListHandler
get /product/list(GetProductListReq) returns (response);
//获取成功后的推荐产品
@handler GetSuccessRecommand
get /product/success-recommand (GetSuccessRecommandReq) returns (response);
}
//获取产品列表
@ -58,4 +61,19 @@ type Items {
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"`
}