Merge branch 'develop' of https://gitee.com/fusenpack/fusenapi into feature/auth

This commit is contained in:
eson
2023-08-17 14:10:20 +08:00
48 changed files with 444 additions and 471 deletions

View File

@@ -8,7 +8,6 @@ import (
"fusenapi/utils/basic"
"fusenapi/utils/format"
"gorm.io/gorm"
"strconv"
"strings"
"context"
@@ -62,13 +61,7 @@ func (l *GetTemplatevDetailLogic) GetTemplatevDetail(req *types.GetTemplatevDeta
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get product template info")
}
//获取模板标签
templateTagModel := gmodel.NewFsProductTemplateTagsModel(l.svcCtx.MysqlConn)
tagId, err := strconv.ParseInt(*templatev2Info.Tag, 10, 64)
if err != nil {
logx.Error(err)
return resp.SetStatusWithMessage(basic.CodeServiceErr, "parse int tag id err")
}
templateTagInfo, err := templateTagModel.FindOne(l.ctx, tagId, "id,title")
templateTagInfo, err := l.svcCtx.AllModels.FsProductTemplateTags.FindOneByTagName(l.ctx, *templatev2Info.TemplateTag, "id,title")
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
return resp.SetStatusWithMessage(basic.CodeDbRecordNotFoundErr, "template tag info is not exists")
@@ -125,7 +118,7 @@ func (l *GetTemplatevDetailLogic) GetTemplatevDetail(req *types.GetTemplatevDeta
}
templateInfoRsp["tag"] = map[string]interface{}{
"id": templateTagInfo.Id,
"title": *templateTagInfo.Title,
"title": *templateTagInfo.TemplateTag,
}
response := types.GetTemplatevDetailRsp{
ProductModelInfo: productModelInfoRsp,