From cfd5dcd423731e1c8d47fe53a8de90676c715538 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Thu, 19 Oct 2023 11:08:45 +0800 Subject: [PATCH] fix --- server/product/internal/logic/getrecommandproductlistlogic.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/product/internal/logic/getrecommandproductlistlogic.go b/server/product/internal/logic/getrecommandproductlistlogic.go index 0debe6e8..258edca5 100644 --- a/server/product/internal/logic/getrecommandproductlistlogic.go +++ b/server/product/internal/logic/getrecommandproductlistlogic.go @@ -36,7 +36,9 @@ func NewGetRecommandProductListLogic(ctx context.Context, svcCtx *svc.ServiceCon } func (l *GetRecommandProductListLogic) GetRecommandProductList(req *types.GetRecommandProductListReq, userinfo *auth.UserInfo) (resp *basic.Response) { - req.Num = 4 //写死4个 + if req.Num > 100 || req.Num < 0 { + req.Num = 4 + } if req.Size > 0 { req.Size = int32(image.GetCurrentSize(uint32(req.Size))) }