fix
This commit is contained in:
@@ -3,6 +3,7 @@ package logic
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"fusenapi/model"
|
||||
"fusenapi/utils/auth"
|
||||
"fusenapi/utils/image"
|
||||
@@ -50,5 +51,23 @@ func (l *GetProductInfoLogic) GetProductInfo(req *types.GetProductInfoReq, login
|
||||
if productInfo == nil {
|
||||
return &types.Response{Code: 510, Message: "product not found"}, nil
|
||||
}
|
||||
//获取产品标签
|
||||
tagModel := model.NewFsTagsModel(l.svcCtx.MysqlConn)
|
||||
tagInfo, err := tagModel.FindOne(l.ctx, productInfo.Type)
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
return &types.Response{Code: 510, Message: "failed to get product tag"}, nil
|
||||
}
|
||||
//获取产品尺寸列表
|
||||
productSizeModel := model.NewFsProductSizeModel(l.svcCtx.MysqlConn)
|
||||
productSizeList, err := productSizeModel.FindAllByStatus(l.ctx, 1, 1)
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
return &types.Response{Code: 510, Message: "failed to get product size list"}, nil
|
||||
}
|
||||
sizeIds := make([]string, 0, len(productSizeList))
|
||||
for _, v := range productSizeList {
|
||||
sizeIds = append(sizeIds, fmt.Sprintf("%d", v.Id))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user