fix
This commit is contained in:
parent
532b35b864
commit
5e2760849c
server/product-template-tag/internal
server_api
|
@ -54,6 +54,7 @@ func (l *GetProductTemplateTagsLogic) GetProductTemplateTags(req *types.GetProdu
|
||||||
logx.Error(err)
|
logx.Error(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
var colors interface{}
|
||||||
if logoInfo.Metadata == nil || *logoInfo.Metadata == "" {
|
if logoInfo.Metadata == nil || *logoInfo.Metadata == "" {
|
||||||
// 返回固定模板A1a
|
// 返回固定模板A1a
|
||||||
productTemplateTags, err = l.svcCtx.AllModels.FsProductTemplateTags.GetListByTagNames(l.ctx, []string{"A1"}, req.Limit, 1, "`id` DESC")
|
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)
|
logx.Error(err)
|
||||||
return resp.SetStatusWithMessage(basic.CodeJsonErr, "failed to parse user metadata")
|
return resp.SetStatusWithMessage(basic.CodeJsonErr, "failed to parse user metadata")
|
||||||
}
|
}
|
||||||
|
colors = metaData["colors"]
|
||||||
var templateTagNameList []string
|
var templateTagNameList []string
|
||||||
b, _ := json.Marshal(metaData["template_tagid"])
|
b, _ := json.Marshal(metaData["template_tagid"])
|
||||||
if err = json.Unmarshal(b, &templateTagNameList); err != nil {
|
if err = json.Unmarshal(b, &templateTagNameList); err != nil {
|
||||||
|
@ -106,6 +108,7 @@ func (l *GetProductTemplateTagsLogic) GetProductTemplateTags(req *types.GetProdu
|
||||||
TemplateTag: *v.TemplateTag,
|
TemplateTag: *v.TemplateTag,
|
||||||
Cover: *v.Cover,
|
Cover: *v.Cover,
|
||||||
CoverMetadata: mapResourceMetadata[*v.Cover],
|
CoverMetadata: mapResourceMetadata[*v.Cover],
|
||||||
|
Colors: colors,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return resp.SetStatusWithMessage(basic.CodeOK, "success", list)
|
return resp.SetStatusWithMessage(basic.CodeOK, "success", list)
|
||||||
|
|
|
@ -14,6 +14,7 @@ type GetProductTemplateTagsRsp struct {
|
||||||
TemplateTag string `json:"template_tag"`
|
TemplateTag string `json:"template_tag"`
|
||||||
Cover string `json:"cover"`
|
Cover string `json:"cover"`
|
||||||
CoverMetadata interface{} `json:"cover_metadata"`
|
CoverMetadata interface{} `json:"cover_metadata"`
|
||||||
|
Colors interface{} `json:"colors"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Request struct {
|
type Request struct {
|
||||||
|
@ -39,10 +40,10 @@ type File struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type Meta struct {
|
type Meta struct {
|
||||||
TotalCount int64 `json:"totalCount"`
|
TotalCount int64 `json:"total_count"`
|
||||||
PageCount int64 `json:"pageCount"`
|
PageCount int64 `json:"page_count"`
|
||||||
CurrentPage int `json:"currentPage"`
|
CurrentPage int `json:"current_page"`
|
||||||
PerPage int `json:"perPage"`
|
PerPage int `json:"per_page"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set 设置Response的Code和Message值
|
// Set 设置Response的Code和Message值
|
||||||
|
|
|
@ -24,4 +24,5 @@ type GetProductTemplateTagsRsp {
|
||||||
TemplateTag string `json:"template_tag"`
|
TemplateTag string `json:"template_tag"`
|
||||||
Cover string `json:"cover"`
|
Cover string `json:"cover"`
|
||||||
CoverMetadata interface{} `json:"cover_metadata"`
|
CoverMetadata interface{} `json:"cover_metadata"`
|
||||||
|
Colors interface{} `json:"colors"`
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user