This commit is contained in:
laodaming
2023-06-05 18:32:14 +08:00
parent b1dc8c7841
commit 32cd46a14a
4 changed files with 172 additions and 2 deletions

View File

@@ -2,9 +2,15 @@ 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"
)
@@ -26,7 +32,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, " ")
@@ -61,6 +67,14 @@ func (l *GetProductInfoLogic) GetProductInfo(req *types.GetProductInfoReq, login
sizeIds := make([]string, 0, len(productSizeList))
for _, v := range productSizeList {
sizeIds = append(sizeIds, fmt.Sprintf("%d", v.Id))
}*/
}
//获取这些尺寸下的模型数据
productModelModel := model.NewFsProductModelModel(l.svcCtx.MysqlConn)
models, err := productModelModel.ListBySizeIdsTag(l.ctx, sizeIds, 1)
if err != nil {
logx.Error(err)
return &types.Response{Code: 510, Message: "failed to get product models"}
}
//通过产品id和模型id获取模板信息
return
}