From 122d558765d0c5dec81c19472f1b757e9c3c041a Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Sat, 7 Oct 2023 11:32:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=90=88=E5=9B=BE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/resource/internal/types/types.go | 6 +++--- server/upload/etc/upload.yaml | 1 + server/upload/internal/config/config.go | 1 + .../upload/internal/logic/uploadlogologic.go | 5 +---- server_api/resource.api | 19 +++++++++---------- service/repositories/image_handle.go | 6 ++++-- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/server/resource/internal/types/types.go b/server/resource/internal/types/types.go index e8807725..e55d9bd3 100644 --- a/server/resource/internal/types/types.go +++ b/server/resource/internal/types/types.go @@ -28,6 +28,9 @@ type ResourceInfoReq struct { } type LogoCombineReq struct { + LogoUrl string `json:"logo_url"` // 合图参数 + TemplateTagColor TemplateTagColor `json:"template_tag_color"` + TemplateTagGroups []TemplateTagGroups `json:"template_tag_groups"` TemplateId int64 `json:"template_id"` // 合图参数 TemplateTag string `json:"template_tag"` // 合图参数 Website string `json:"website,optional"` // 合图参数 @@ -35,9 +38,6 @@ type LogoCombineReq struct { Address string `json:"address,optional"` // 合图参数 Phone string `json:"phone,optional"` // 合图参数 Qrcode string `json:"qrcode,optional"` // 合图参数 - LogoUrl string `json:"logo_url"` // 合图参数 - TemplateTagColor TemplateTagColor `json:"template_tag_color"` - TemplateTagGroups []TemplateTagGroups `json:"template_tag_groups"` } type TemplateTagColor struct { diff --git a/server/upload/etc/upload.yaml b/server/upload/etc/upload.yaml index 36922560..7c6f72fb 100644 --- a/server/upload/etc/upload.yaml +++ b/server/upload/etc/upload.yaml @@ -19,6 +19,7 @@ AWS: Secret: sjCEv0JxATnPCxno2KNLm0X8oDc7srUR+4vkYhvm Token: BLMService: + Version: "2" Url: "http://18.119.109.254:8999" # Url: "http://192.168.1.9:8999" ImageProcess: diff --git a/server/upload/internal/config/config.go b/server/upload/internal/config/config.go index b474e0e4..ad24a1cd 100644 --- a/server/upload/internal/config/config.go +++ b/server/upload/internal/config/config.go @@ -22,6 +22,7 @@ type Config struct { } } BLMService struct { + Version string Url string ImageProcess struct { Url string diff --git a/server/upload/internal/logic/uploadlogologic.go b/server/upload/internal/logic/uploadlogologic.go index 7db0fed9..f5e0c6fa 100644 --- a/server/upload/internal/logic/uploadlogologic.go +++ b/server/upload/internal/logic/uploadlogologic.go @@ -171,12 +171,9 @@ func (l *UploadLogoLogic) UploadLogo(req *types.UploadLogoReq, userinfo *auth.Us logoHeight = 200 } var resultStr string - - var postMap = make(map[string]string, 1) - postMap["logo_url"] = logoUrl - resLogoStandard, err := l.svcCtx.Repositories.ImageHandle.LogoInfoSet(l.ctx, &repositories.LogoInfoSetReq{ LogoUrl: logoUrl, + Version: l.svcCtx.Config.BLMService.Version, }) if err != nil { diff --git a/server_api/resource.api b/server_api/resource.api index 433c4116..f71b6234 100644 --- a/server_api/resource.api +++ b/server_api/resource.api @@ -55,17 +55,16 @@ type ( type ( LogoCombineReq { - TemplateId int64 `json:"template_id"` // 合图参数 - TemplateTag string `json:"template_tag"` // 合图参数 - Website string `json:"website,optional"` // 合图参数 - Slogan string `json:"slogan,optional"` // 合图参数 - Address string `json:"address,optional"` // 合图参数 - Phone string `json:"phone,optional"` // 合图参数 - Qrcode string `json:"qrcode,optional"` // 合图参数 - LogoUrl string `json:"logo_url"` // 合图参数 - TemplateTagColor TemplateTagColor `json:"template_tag_color"` - + LogoUrl string `json:"logo_url"` // 合图参数 + TemplateTagColor TemplateTagColor `json:"template_tag_color"` TemplateTagGroups []TemplateTagGroups `json:"template_tag_groups"` + TemplateId int64 `json:"template_id"` // 合图参数 + TemplateTag string `json:"template_tag"` // 合图参数 + Website string `json:"website,optional"` // 合图参数 + Slogan string `json:"slogan,optional"` // 合图参数 + Address string `json:"address,optional"` // 合图参数 + Phone string `json:"phone,optional"` // 合图参数 + Qrcode string `json:"qrcode,optional"` // 合图参数 } TemplateTagColor { Colors [][]string `json:"colors"` // 颜色组合 diff --git a/service/repositories/image_handle.go b/service/repositories/image_handle.go index 7fbe4806..19a2c8c6 100644 --- a/service/repositories/image_handle.go +++ b/service/repositories/image_handle.go @@ -160,6 +160,7 @@ func (l *defaultImageHandle) LogoInfo(ctx context.Context, in *LogoInfoReq) (*Lo type ( LogoInfoSetReq struct { LogoUrl string `json:"logo_url"` + Version string `json:"version"` } LogoInfoSetRes struct { Res string `json:"res"` @@ -168,8 +169,9 @@ type ( func (l *defaultImageHandle) LogoInfoSet(ctx context.Context, in *LogoInfoSetReq) (*LogoInfoSetRes, error) { var resultBLM constants.BLMServiceUrlResult - postMap := make(map[string]string, 1) + postMap := make(map[string]string, 2) postMap["logo_url"] = in.LogoUrl + postMap["version"] = in.Version logc.Infof(ctx, "算法请求--LOGO基础信息--开始时间:%v", time.Now().UTC()) err := curl.NewClient(ctx, &curl.Config{ @@ -306,7 +308,7 @@ func (l *defaultImageHandle) LogoCombine(ctx context.Context, in *LogoCombineReq "color": in.TemplateTagColor.Color, "index": in.TemplateTagColor.Index, } - var postMap = make(map[string]interface{}, 2) + var postMap = make(map[string]interface{}, 3) postMap["module_data"] = moduleDataMap postMap["tag_data"] = in.ProductTemplateTagGroups postMap["param_data"] = combineParam