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))) }