diff --git a/product/internal/handler/routes.go b/product/internal/handler/routes.go index 18f67cbc..b0cca7a2 100644 --- a/product/internal/handler/routes.go +++ b/product/internal/handler/routes.go @@ -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), + }, }, ) } diff --git a/product/internal/types/types.go b/product/internal/types/types.go index 0c24482f..46d0aefb 100644 --- a/product/internal/types/types.go +++ b/product/internal/types/types.go @@ -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"` diff --git a/server_api/product.api b/server_api/product.api index 12fc635c..32a96e38 100644 --- a/server_api/product.api +++ b/server_api/product.api @@ -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"` } \ No newline at end of file