From 1a9f117530301a8271b843a6f7ad79d62d356e3d Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Fri, 20 Oct 2023 10:53:37 +0800 Subject: [PATCH] fix --- .../product/internal/logic/getrecommandproductlistlogic.go | 2 +- server/product/internal/types/types.go | 5 +++-- server_api/product.api | 6 ++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/server/product/internal/logic/getrecommandproductlistlogic.go b/server/product/internal/logic/getrecommandproductlistlogic.go index 1954ec6f..ed54cd25 100644 --- a/server/product/internal/logic/getrecommandproductlistlogic.go +++ b/server/product/internal/logic/getrecommandproductlistlogic.go @@ -38,7 +38,7 @@ func (l *GetRecommandProductListLogic) GetRecommandProductList(req *types.GetRec if req.Num > 100 || req.Num < 0 { req.Num = 4 } - productInfo, err := l.svcCtx.AllModels.FsProduct.FindOne(l.ctx, req.ProductId) + productInfo, err := l.svcCtx.AllModels.FsProduct.FindOneBySn(l.ctx, req.Sn) if err != nil { if errors.Is(err, gorm.ErrRecordNotFound) { return resp.SetStatusWithMessage(basic.CodeDbRecordNotFoundErr, "detail`s product is not found") diff --git a/server/product/internal/types/types.go b/server/product/internal/types/types.go index 5e8cde0b..f0e56e4a 100644 --- a/server/product/internal/types/types.go +++ b/server/product/internal/types/types.go @@ -6,8 +6,9 @@ import ( ) type GetRecommandProductListReq struct { - Num int64 `form:"num,optional"` - ProductId int64 `form:"product_id"` + Num int64 `form:"num,optional"` + Size int64 `json:"size"` + Sn string `form:"sn"` } type GetRecommandProductListRsp struct { diff --git a/server_api/product.api b/server_api/product.api index 37a929fb..4b18e1ad 100644 --- a/server_api/product.api +++ b/server_api/product.api @@ -50,8 +50,10 @@ service product { //获取详情页推荐产品列表 type GetRecommandProductListReq { - Num int64 `form:"num,optional"` - ProductId int64 `form:"product_id"` + Num int64 `form:"num,optional"` + Size int64 `json:"size"` + Sn string `form:"sn"` + //ProductId int64 `form:"product_id"` } type GetRecommandProductListRsp { Id int64 `json:"id"`