This commit is contained in:
laodaming 2023-10-20 10:47:24 +08:00
parent ff1698a49c
commit f739f7bc0e
3 changed files with 11 additions and 11 deletions

View File

@ -339,7 +339,7 @@ func (l *GetProductDetailLogic) getRenderDefaultSize(productId int64, templateTa
// 获取对应模板标签颜色信息 // 获取对应模板标签颜色信息
func (l *GetProductDetailLogic) GetTemplateTagColor(req *types.GetProductDetailReq, userinfo *auth.UserInfo) (resp types.TemplateTagColorInfo, err error) { func (l *GetProductDetailLogic) GetTemplateTagColor(req *types.GetProductDetailReq, userinfo *auth.UserInfo) (resp types.TemplateTagColorInfo, err error) {
if req.SelectColorIndex < 0 { if req.SelectedColorIndex < 0 {
return types.TemplateTagColorInfo{}, errors.New("param selected_color_index is invalid") return types.TemplateTagColorInfo{}, errors.New("param selected_color_index is invalid")
} }
//根据logo查询素材资源 //根据logo查询素材资源
@ -387,7 +387,7 @@ func (l *GetProductDetailLogic) GetTemplateTagColor(req *types.GetProductDetailR
if !ok { if !ok {
return types.TemplateTagColorInfo{}, errors.New("the template tag is not found from this logo material`s metadata") return types.TemplateTagColorInfo{}, errors.New("the template tag is not found from this logo material`s metadata")
} }
if req.SelectColorIndex >= len(colors) { if req.SelectedColorIndex >= len(colors) {
return types.TemplateTagColorInfo{}, errors.New("select color index is out of range !!") return types.TemplateTagColorInfo{}, errors.New("select color index is out of range !!")
} }
var templateTagGroups interface{} var templateTagGroups interface{}
@ -399,7 +399,7 @@ func (l *GetProductDetailLogic) GetTemplateTagColor(req *types.GetProductDetailR
} }
return types.TemplateTagColorInfo{ return types.TemplateTagColorInfo{
Colors: colors, Colors: colors,
SelectedColorIndex: req.SelectColorIndex, SelectedColorIndex: req.SelectedColorIndex,
TemplateTagGroups: templateTagGroups, TemplateTagGroups: templateTagGroups,
}, nil }, nil
} }

View File

@ -170,10 +170,10 @@ type HomePageRecommendProductListRsp struct {
} }
type GetProductDetailReq struct { type GetProductDetailReq struct {
ProductId int64 `form:"product_id"` //产品id ProductId int64 `form:"product_id"` //产品id
TemplateTag string `form:"template_tag"` //模板标签 TemplateTag string `form:"template_tag"` //模板标签
SelectColorIndex int `form:"select_color_index"` //模板标签颜色索引 SelectedColorIndex int `form:"selected_color_index"` //模板标签颜色索引
Logo string `form:"logo"` //logo地址 Logo string `form:"logo"` //logo地址
} }
type GetProductDetailRsp struct { type GetProductDetailRsp struct {

View File

@ -206,10 +206,10 @@ type HomePageRecommendProductListRsp {
//获取产品详情(重构版) //获取产品详情(重构版)
type GetProductDetailReq { type GetProductDetailReq {
ProductId int64 `form:"product_id"` //产品id ProductId int64 `form:"product_id"` //产品id
TemplateTag string `form:"template_tag"` //模板标签 TemplateTag string `form:"template_tag"` //模板标签
SelectColorIndex int `form:"select_color_index"` //模板标签颜色索引 SelectedColorIndex int `form:"selected_color_index"` //模板标签颜色索引
Logo string `form:"logo"` //logo地址 Logo string `form:"logo"` //logo地址
} }
type GetProductDetailRsp { type GetProductDetailRsp {
TemplateTagColorInfo TemplateTagColorInfo `json:"template_tag_color_info"` //标签颜色信息 TemplateTagColorInfo TemplateTagColorInfo `json:"template_tag_color_info"` //标签颜色信息