From f739f7bc0eb6f91f2998c7b2bf0f86fde8b2acfd Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Fri, 20 Oct 2023 10:47:24 +0800 Subject: [PATCH] fix --- server/product/internal/logic/getproductdetaillogic.go | 6 +++--- server/product/internal/types/types.go | 8 ++++---- server_api/product.api | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/server/product/internal/logic/getproductdetaillogic.go b/server/product/internal/logic/getproductdetaillogic.go index 724e6797..6782038a 100644 --- a/server/product/internal/logic/getproductdetaillogic.go +++ b/server/product/internal/logic/getproductdetaillogic.go @@ -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) { - if req.SelectColorIndex < 0 { + if req.SelectedColorIndex < 0 { return types.TemplateTagColorInfo{}, errors.New("param selected_color_index is invalid") } //根据logo查询素材资源 @@ -387,7 +387,7 @@ func (l *GetProductDetailLogic) GetTemplateTagColor(req *types.GetProductDetailR if !ok { 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 !!") } var templateTagGroups interface{} @@ -399,7 +399,7 @@ func (l *GetProductDetailLogic) GetTemplateTagColor(req *types.GetProductDetailR } return types.TemplateTagColorInfo{ Colors: colors, - SelectedColorIndex: req.SelectColorIndex, + SelectedColorIndex: req.SelectedColorIndex, TemplateTagGroups: templateTagGroups, }, nil } diff --git a/server/product/internal/types/types.go b/server/product/internal/types/types.go index 79b7078f..5e8cde0b 100644 --- a/server/product/internal/types/types.go +++ b/server/product/internal/types/types.go @@ -170,10 +170,10 @@ type HomePageRecommendProductListRsp struct { } type GetProductDetailReq struct { - ProductId int64 `form:"product_id"` //产品id - TemplateTag string `form:"template_tag"` //模板标签 - SelectColorIndex int `form:"select_color_index"` //模板标签颜色索引 - Logo string `form:"logo"` //logo地址 + ProductId int64 `form:"product_id"` //产品id + TemplateTag string `form:"template_tag"` //模板标签 + SelectedColorIndex int `form:"selected_color_index"` //模板标签颜色索引 + Logo string `form:"logo"` //logo地址 } type GetProductDetailRsp struct { diff --git a/server_api/product.api b/server_api/product.api index 0bccedc0..37a929fb 100644 --- a/server_api/product.api +++ b/server_api/product.api @@ -206,10 +206,10 @@ type HomePageRecommendProductListRsp { //获取产品详情(重构版) type GetProductDetailReq { - ProductId int64 `form:"product_id"` //产品id - TemplateTag string `form:"template_tag"` //模板标签 - SelectColorIndex int `form:"select_color_index"` //模板标签颜色索引 - Logo string `form:"logo"` //logo地址 + ProductId int64 `form:"product_id"` //产品id + TemplateTag string `form:"template_tag"` //模板标签 + SelectedColorIndex int `form:"selected_color_index"` //模板标签颜色索引 + Logo string `form:"logo"` //logo地址 } type GetProductDetailRsp { TemplateTagColorInfo TemplateTagColorInfo `json:"template_tag_color_info"` //标签颜色信息