diff --git a/server/product-template-tag/internal/logic/getproducttemplatetagslogic.go b/server/product-template-tag/internal/logic/getproducttemplatetagslogic.go index c9c30a7d..cd43c5af 100644 --- a/server/product-template-tag/internal/logic/getproducttemplatetagslogic.go +++ b/server/product-template-tag/internal/logic/getproducttemplatetagslogic.go @@ -136,10 +136,18 @@ func (l *GetProductTemplateTagsLogic) GetProductTemplateTags(req *types.GetProdu Color: colorsSet, }) } + var templateTagGroups interface{} + if templateInfo.Groups != nil && *templateInfo.Groups != "" { + if err = json.Unmarshal([]byte(*templateInfo.Groups), &templateTagGroups); err != nil { + logx.Error(err) + return resp.SetStatusWithMessage(basic.CodeJsonErr, "failed to parse groups") + } + } list = append(list, types.GetProductTemplateTagsRsp{ Id: templateInfo.Id, TemplateTag: *templateInfo.TemplateTag, IsDefaultTemplateTag: isDefaultTemplateTag, + TemplateTagGroups: templateTagGroups, Cover: *templateInfo.Cover, CoverMetadata: mapResourceMetadata[*templateInfo.Cover], Colors: colors, diff --git a/server/product-template-tag/internal/types/types.go b/server/product-template-tag/internal/types/types.go index 037e6966..b24c9f6b 100644 --- a/server/product-template-tag/internal/types/types.go +++ b/server/product-template-tag/internal/types/types.go @@ -13,6 +13,7 @@ type GetProductTemplateTagsRsp struct { Id int64 `json:"id"` TemplateTag string `json:"template_tag"` IsDefaultTemplateTag bool `json:"is_default_template_tag"` + TemplateTagGroups interface{} `json:"template_tag_groups"` Cover string `json:"cover"` CoverMetadata interface{} `json:"cover_metadata"` Colors []ColorsItem `json:"colors"` diff --git a/server_api/product-template-tag.api b/server_api/product-template-tag.api index ab06b272..2c290067 100644 --- a/server_api/product-template-tag.api +++ b/server_api/product-template-tag.api @@ -23,6 +23,7 @@ type GetProductTemplateTagsRsp { Id int64 `json:"id"` TemplateTag string `json:"template_tag"` IsDefaultTemplateTag bool `json:"is_default_template_tag"` + TemplateTagGroups interface{} `json:"template_tag_groups"` Cover string `json:"cover"` CoverMetadata interface{} `json:"cover_metadata"` Colors []ColorsItem `json:"colors"` diff --git a/utils/websocket_data/render_data.go b/utils/websocket_data/render_data.go index d79032d5..8ff17311 100644 --- a/utils/websocket_data/render_data.go +++ b/utils/websocket_data/render_data.go @@ -15,18 +15,19 @@ type RenderImageReqMsg struct { RenderData RenderData `json:"render_data"` } type RenderData struct { - TemplateTag string `json:"template_tag"` //模板标签(必须) - TemplateTagColor TemplateTagColor `json:"template_tag_color"` //模板标签组合颜色 - ProductId int64 `json:"product_id"` //产品id(必须) - Website string `json:"website"` //网站(可选) - Slogan string `json:"slogan"` //slogan(可选) - Address string `json:"address"` //地址(可选) - Phone string `json:"phone"` //电话(可选) - Qrcode string `json:"qrcode"` //二维码(可选) - ProductSizeId int64 `json:"product_size_id"` //尺寸id(可选) - UserId int64 `json:"user_id"` //用户id(websocket连接建立再赋值) - GuestId int64 `json:"guest_id"` //游客id(websocket连接建立再赋值) - Logo string `json:"logo"` //log资源地址(websocket连接建立再赋值) + TemplateTag string `json:"template_tag"` //模板标签(必须) + TemplateTagColor TemplateTagColor `json:"template_tag_color"` //模板标签组合颜色(必须) + TemplateTagGroups interface{} `json:"template_tag_groups"` //模板标签分组信息(必须) + Logo string `json:"logo"` //log资源地址(必须) + ProductId int64 `json:"product_id"` //产品id(必须) + Website string `json:"website"` //网站(可选) + Slogan string `json:"slogan"` //slogan(可选) + Address string `json:"address"` //地址(可选) + Phone string `json:"phone"` //电话(可选) + Qrcode string `json:"qrcode"` //二维码(可选) + ProductSizeId int64 `json:"product_size_id"` //尺寸id(可选) + UserId int64 `json:"user_id"` //用户id(websocket连接建立再赋值) + GuestId int64 `json:"guest_id"` //游客id(websocket连接建立再赋值) } type TemplateTagColor struct { Color [][]string `json:"color"` //颜色组合