diff --git a/server/product/internal/logic/getsuccessrecommandlogic.go b/server/product/internal/logic/getsuccessrecommandlogic.go index 4564156e..f13ccba7 100644 --- a/server/product/internal/logic/getsuccessrecommandlogic.go +++ b/server/product/internal/logic/getsuccessrecommandlogic.go @@ -26,15 +26,15 @@ func NewGetSuccessRecommandLogic(ctx context.Context, svcCtx *svc.ServiceContext } // 获取推荐的产品列表 -func (l *GetSuccessRecommandLogic) GetSuccessRecommand(req *types.GetSuccessRecommandReq, loginInfo *auth.UserInfo) (resp *basic.Response) { +func (l *GetSuccessRecommandLogic) GetSuccessRecommand(req *types.GetSuccessRecommandReq, userInfo *auth.UserInfo) (resp *basic.Response) { //获取用户信息 userModel := gmodel.NewFsUserModel(l.svcCtx.MysqlConn) - userInfo, err := userModel.FindOne(l.ctx, loginInfo.UserId) + user, err := userModel.FindOne(l.ctx, userInfo.UserId) if err != nil { logx.Error(err) return resp.SetStatusWithMessage(basic.CodeServiceErr, "failed to get user info") } - if userInfo.Id == 0 { + if user.Id == 0 { return resp.SetStatusWithMessage(basic.CodeUnAuth, "failed to get user info") } if req.Num == 0 || req.Num > 500 { @@ -65,12 +65,12 @@ func (l *GetSuccessRecommandLogic) GetSuccessRecommand(req *types.GetSuccessReco //千人千面处理 thousandFaceImageFormatReq := image.ThousandFaceImageFormatReq{ Size: int(req.Size), - IsThousandFace: int(userInfo.IsThousandFace), + IsThousandFace: int(user.IsThousandFace), Cover: *v.Cover, CoverImg: *v.CoverImg, CoverDefault: *v.CoverImg, ProductId: v.Id, - UserInfo: userInfo, + UserInfo: user, } image.ThousandFaceImageFormat(&thousandFaceImageFormatReq) data.Cover = thousandFaceImageFormatReq.Cover