From bbf5cb03ade4bfbad999f8ac0153965db5960259 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Thu, 19 Oct 2023 11:21:25 +0800 Subject: [PATCH] fix --- .../product/internal/logic/getrecommandproductlistlogic.go | 6 +----- server/product/internal/types/types.go | 5 ++--- server_api/product.api | 5 ++--- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/server/product/internal/logic/getrecommandproductlistlogic.go b/server/product/internal/logic/getrecommandproductlistlogic.go index 258edca5..1a1cd03e 100644 --- a/server/product/internal/logic/getrecommandproductlistlogic.go +++ b/server/product/internal/logic/getrecommandproductlistlogic.go @@ -8,7 +8,6 @@ import ( "fusenapi/utils/auth" "fusenapi/utils/basic" "fusenapi/utils/format" - "fusenapi/utils/image" "fusenapi/utils/s3url_to_s3id" "gorm.io/gorm" "strings" @@ -39,10 +38,7 @@ func (l *GetRecommandProductListLogic) GetRecommandProductList(req *types.GetRec if req.Num > 100 || req.Num < 0 { req.Num = 4 } - if req.Size > 0 { - req.Size = int32(image.GetCurrentSize(uint32(req.Size))) - } - 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 cb6e6448..b3e58289 100644 --- a/server/product/internal/types/types.go +++ b/server/product/internal/types/types.go @@ -6,9 +6,8 @@ import ( ) type GetRecommandProductListReq struct { - Size int32 `form:"size,optional"` - Num int64 `form:"num,optional"` - 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 8180ee6b..d43853e1 100644 --- a/server_api/product.api +++ b/server_api/product.api @@ -53,9 +53,8 @@ service product { //获取详情页推荐产品列表 type GetRecommandProductListReq { - Size int32 `form:"size,optional"` - Num int64 `form:"num,optional"` - Sn string `form:"sn"` + Num int64 `form:"num,optional"` + ProductId int64 `form:"product_id"` } type GetRecommandProductListRsp { Id int64 `json:"id"`