This commit is contained in:
laodaming
2023-07-20 17:47:28 +08:00
parent 0e72027ff3
commit 421b63846a
5 changed files with 18 additions and 18 deletions

View File

@@ -20,21 +20,21 @@ import (
"github.com/zeromicro/go-zero/core/logx"
)
type HomePageRecommandProductListLogic struct {
type HomePageRecommendProductListLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewHomePageRecommandProductListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *HomePageRecommandProductListLogic {
return &HomePageRecommandProductListLogic{
func NewHomePageRecommendProductListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *HomePageRecommendProductListLogic {
return &HomePageRecommendProductListLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *HomePageRecommandProductListLogic) HomePageRecommandProductList(req *types.HomePageRecommandProductListReq, userinfo *auth.UserInfo) (resp *basic.Response) {
func (l *HomePageRecommendProductListLogic) HomePageRecommendProductList(req *types.HomePageRecommendProductListReq, userinfo *auth.UserInfo) (resp *basic.Response) {
//查询用户信息(不用判断存在)
user, err := l.svcCtx.AllModels.FsUser.FindUserById(l.ctx, userinfo.UserId)
if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) {
@@ -126,7 +126,7 @@ func (l *HomePageRecommandProductListLogic) HomePageRecommandProductList(req *ty
mapProductSizeCount[v.ProductId] = v.Num
}
//组装返回
listRsp := make([]types.HomePageRecommandProductListRsp, 0, len(recommendProductList))
listRsp := make([]types.HomePageRecommendProductListRsp, 0, len(recommendProductList))
for _, productInfo := range recommendProductList {
minPrice, ok := mapProductMinPrice[productInfo.Id]
_, tmpOk := mapProductTemplate[productInfo.Id]
@@ -143,7 +143,7 @@ func (l *HomePageRecommandProductListLogic) HomePageRecommandProductList(req *ty
if _, ok = mapProductHaveOptionFitting[productInfo.Id]; ok {
haveOptionalFitting = true
}
item := types.HomePageRecommandProductListRsp{
item := types.HomePageRecommendProductListRsp{
ProductId: productInfo.Id,
Sn: *productInfo.Sn,
Title: *productInfo.Title,