fix
This commit is contained in:
@@ -20,21 +20,21 @@ import (
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetRecommandProductListLogic struct {
|
||||
type GetRecommendProductListLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewGetRecommandProductListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetRecommandProductListLogic {
|
||||
return &GetRecommandProductListLogic{
|
||||
func NewGetRecommendProductListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetRecommendProductListLogic {
|
||||
return &GetRecommendProductListLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetRecommandProductListLogic) GetRecommandProductList(req *types.GetRecommandProductListReq, userinfo *auth.UserInfo) (resp *basic.Response) {
|
||||
func (l *GetRecommendProductListLogic) GetRecommendProductList(req *types.GetRecommendProductListReq, userinfo *auth.UserInfo) (resp *basic.Response) {
|
||||
if req.Num > 100 || req.Num < 0 {
|
||||
req.Num = 4
|
||||
}
|
||||
@@ -60,10 +60,6 @@ func (l *GetRecommandProductListLogic) GetRecommandProductList(req *types.GetRec
|
||||
logx.Error(err)
|
||||
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get recommend product list")
|
||||
}
|
||||
//超过了截取
|
||||
if len(recommendProductList) > int(req.Num) {
|
||||
recommendProductList = recommendProductList[:req.Num]
|
||||
}
|
||||
}
|
||||
//资源id集合
|
||||
resourceIds := make([]string, 0, 50)
|
||||
Reference in New Issue
Block a user