Merge branch 'develop' into feature/mhw-v1.01

This commit is contained in:
laodaming 2023-09-18 14:44:28 +08:00
commit 464218ad62
4 changed files with 11 additions and 5 deletions

View File

@ -1,8 +1,9 @@
package gmodel
import (
"gorm.io/gorm"
"time"
"gorm.io/gorm"
)
// fs_order 订单表

View File

@ -54,6 +54,7 @@ func (l *GetProductTemplateTagsLogic) GetProductTemplateTags(req *types.GetProdu
logx.Error(err)
return
}
var colors interface{}
if logoInfo.Metadata == nil || *logoInfo.Metadata == "" {
// 返回固定模板A1a
productTemplateTags, err = l.svcCtx.AllModels.FsProductTemplateTags.GetListByTagNames(l.ctx, []string{"A1"}, req.Limit, 1, "`id` DESC")
@ -68,6 +69,7 @@ func (l *GetProductTemplateTagsLogic) GetProductTemplateTags(req *types.GetProdu
logx.Error(err)
return resp.SetStatusWithMessage(basic.CodeJsonErr, "failed to parse user metadata")
}
colors = metaData["colors"]
var templateTagNameList []string
b, _ := json.Marshal(metaData["template_tagid"])
if err = json.Unmarshal(b, &templateTagNameList); err != nil {
@ -106,6 +108,7 @@ func (l *GetProductTemplateTagsLogic) GetProductTemplateTags(req *types.GetProdu
TemplateTag: *v.TemplateTag,
Cover: *v.Cover,
CoverMetadata: mapResourceMetadata[*v.Cover],
Colors: colors,
})
}
return resp.SetStatusWithMessage(basic.CodeOK, "success", list)

View File

@ -14,6 +14,7 @@ type GetProductTemplateTagsRsp struct {
TemplateTag string `json:"template_tag"`
Cover string `json:"cover"`
CoverMetadata interface{} `json:"cover_metadata"`
Colors interface{} `json:"colors"`
}
type Request struct {
@ -39,10 +40,10 @@ type File struct {
}
type Meta struct {
TotalCount int64 `json:"totalCount"`
PageCount int64 `json:"pageCount"`
CurrentPage int `json:"currentPage"`
PerPage int `json:"perPage"`
TotalCount int64 `json:"total_count"`
PageCount int64 `json:"page_count"`
CurrentPage int `json:"current_page"`
PerPage int `json:"per_page"`
}
// Set 设置Response的Code和Message值

View File

@ -24,4 +24,5 @@ type GetProductTemplateTagsRsp {
TemplateTag string `json:"template_tag"`
Cover string `json:"cover"`
CoverMetadata interface{} `json:"cover_metadata"`
Colors interface{} `json:"colors"`
}