From 4aaf1a1587ef653d3ebf402de1740d4daf386377 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Fri, 20 Oct 2023 10:59:36 +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, 5 insertions(+), 8 deletions(-) diff --git a/server/product/internal/logic/getrecommandproductlistlogic.go b/server/product/internal/logic/getrecommandproductlistlogic.go index ed54cd25..1954ec6f 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.FindOneBySn(l.ctx, req.Sn) + productInfo, err := l.svcCtx.AllModels.FsProduct.FindOne(l.ctx, req.ProductId) 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 eecc51dd..5e8cde0b 100644 --- a/server/product/internal/types/types.go +++ b/server/product/internal/types/types.go @@ -6,9 +6,8 @@ import ( ) type GetRecommandProductListReq struct { - Num int64 `form:"num,optional"` - Size int64 `form:"size"` - Sn string `form:"sn"` + Num int64 `form:"num,optional"` + ProductId int64 `form:"product_id"` } type GetRecommandProductListRsp struct { diff --git a/server_api/product.api b/server_api/product.api index 3cdb685c..37a929fb 100644 --- a/server_api/product.api +++ b/server_api/product.api @@ -50,10 +50,8 @@ service product { //获取详情页推荐产品列表 type GetRecommandProductListReq { - Num int64 `form:"num,optional"` - Size int64 `form:"size"` - Sn string `form:"sn"` - //ProductId int64 `form:"product_id"` + Num int64 `form:"num,optional"` + ProductId int64 `form:"product_id"` } type GetRecommandProductListRsp { Id int64 `json:"id"`