11
This commit is contained in:
parent
40e04c70b8
commit
3f4d808fda
server/product-template-tag/internal
server_api
|
@ -124,19 +124,17 @@ func (l *GetProductTemplateTagsLogic) GetProductTemplateTags(req *types.GetProdu
|
|||
}
|
||||
list := make([]types.GetProductTemplateTagsRsp, 0, len(productTemplateTags))
|
||||
for _, templateInfo := range productTemplateTags {
|
||||
colors := make([]types.ColorsItem, 0, 10)
|
||||
colors := make([][]string, 0, 10)
|
||||
SelectedColorIndex := 0
|
||||
isDefaultTemplateTag := false
|
||||
for _, colorsSet := range mapTemplateTag[*templateInfo.TemplateTag] {
|
||||
if colorsSet, ok := mapTemplateTag[*templateInfo.TemplateTag]; ok {
|
||||
if selectIndex, ok := mapSelectColor[*templateInfo.TemplateTag]; ok {
|
||||
isDefaultTemplateTag = true
|
||||
SelectedColorIndex = selectIndex
|
||||
}
|
||||
colors = append(colors, types.ColorsItem{
|
||||
Color: colorsSet,
|
||||
})
|
||||
colors = colorsSet
|
||||
}
|
||||
var templateTagGroups interface{}
|
||||
var templateTagGroups []interface{}
|
||||
if templateInfo.Groups != nil && *templateInfo.Groups != "" {
|
||||
if err = json.Unmarshal([]byte(*templateInfo.Groups), &templateTagGroups); err != nil {
|
||||
logx.Error(err)
|
||||
|
|
|
@ -16,14 +16,10 @@ type GetProductTemplateTagsRsp struct {
|
|||
TemplateTagGroups interface{} `json:"template_tag_groups"`
|
||||
Cover string `json:"cover"`
|
||||
CoverMetadata interface{} `json:"cover_metadata"`
|
||||
Colors []ColorsItem `json:"colors"`
|
||||
Colors [][]string `json:"colors"`
|
||||
SelectedColorIndex int `json:"selected_color_index"`
|
||||
}
|
||||
|
||||
type ColorsItem struct {
|
||||
Color []string `json:"color"`
|
||||
}
|
||||
|
||||
type Request struct {
|
||||
}
|
||||
|
||||
|
|
|
@ -26,9 +26,6 @@ type GetProductTemplateTagsRsp {
|
|||
TemplateTagGroups interface{} `json:"template_tag_groups"`
|
||||
Cover string `json:"cover"`
|
||||
CoverMetadata interface{} `json:"cover_metadata"`
|
||||
Colors []ColorsItem `json:"colors"`
|
||||
Colors [][]string `json:"colors"`
|
||||
SelectedColorIndex int `json:"selected_color_index"`
|
||||
}
|
||||
type ColorsItem {
|
||||
Color []string `json:"color"`
|
||||
}
|
Loading…
Reference in New Issue
Block a user