This commit is contained in:
laodaming
2023-06-06 11:14:13 +08:00
parent 0ce9c3d8c2
commit 25418e7be5
5 changed files with 54 additions and 61 deletions

View File

@@ -2,16 +2,9 @@ package logic
import (
"context"
"errors"
"fmt"
"fusenapi/model"
"fusenapi/product/internal/svc"
"fusenapi/product/internal/types"
"fusenapi/utils/auth"
"fusenapi/utils/image"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"strings"
"github.com/zeromicro/go-zero/core/logx"
)
@@ -32,7 +25,7 @@ func NewGetProductInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge
// 获取产品详情
func (l *GetProductInfoLogic) GetProductInfo(req *types.GetProductInfoReq, loginInfo auth.UserInfo) (resp *types.Response) {
//校验前台登录情况
if loginInfo.UserId == 0 {
/*if loginInfo.UserId == 0 {
return &types.Response{Code: 402, Message: "please sign in"}
}
req.Pid = strings.Trim(req.Pid, " ")
@@ -69,8 +62,8 @@ func (l *GetProductInfoLogic) GetProductInfo(req *types.GetProductInfoReq, login
sizeIds = append(sizeIds, fmt.Sprintf("%d", v.Id))
}
//获取这些尺寸下的模型数据
productModelModel := model.NewFsProductModelModel(l.svcCtx.MysqlConn)
models, err := productModelModel.ListBySizeIdsTag(l.ctx, sizeIds, 1)
productModel3dModel := model.NewFsProductModel3dModel(l.svcCtx.MysqlConn)
models, err := productModel3dModel.ListBySizeIdsTag(l.ctx, sizeIds, 1)
if err != nil {
logx.Error(err)
return &types.Response{Code: 510, Message: "failed to get product models"}
@@ -90,6 +83,6 @@ func (l *GetProductInfoLogic) GetProductInfo(req *types.GetProductInfoReq, login
templateModelIds := make([]string, 0, len(templateV2List))
for _, v := range templateV2List {
templateModelIds = append(templateModelIds, fmt.Sprintf("%d", v.ModelId))
}
}*/
return
}