From 74f25d23cf43272ad73ec1bbd7b390459e7a5e6c Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Mon, 11 Sep 2023 15:15:38 +0800 Subject: [PATCH] fix --- .../websocket/internal/logic/ws_render_image.go | 3 +++ utils/template_switch_info/template_switch.go | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/server/websocket/internal/logic/ws_render_image.go b/server/websocket/internal/logic/ws_render_image.go index 619fa2fb..869d3ea2 100644 --- a/server/websocket/internal/logic/ws_render_image.go +++ b/server/websocket/internal/logic/ws_render_image.go @@ -172,6 +172,9 @@ func (w *wsConnectItem) renderImage(data []byte) { if renderImageData.RenderData.Qrcode == "" && templateSwitchInfo.MaterialData.QRcode.IfShow { renderImageData.RenderData.Qrcode = templateSwitchInfo.MaterialData.QRcode.DefaultValue } + if renderImageData.RenderData.Slogan == "" && templateSwitchInfo.MaterialData.Slogan.IfShow { + renderImageData.RenderData.Slogan = templateSwitchInfo.MaterialData.Slogan.DefaultValue + } } //获取刀版图 combineReq := repositories.LogoCombineReq{ diff --git a/utils/template_switch_info/template_switch.go b/utils/template_switch_info/template_switch.go index 6e903ab3..52274adb 100644 --- a/utils/template_switch_info/template_switch.go +++ b/utils/template_switch_info/template_switch.go @@ -16,6 +16,7 @@ type MaterialData struct { Website Website `json:"Website"` Address Address `json:"Address"` Phone Phone `json:"Phone"` + Slogan Slogan `json:"slogan"` Logo Logo `json:"Logo"` } type QRcode struct { @@ -33,6 +34,11 @@ type Address struct { Text string `json:"text"` DefaultValue string `json:"default_value"` } +type Slogan struct { + IfShow bool `json:"if_show"` + Text string `json:"text"` + DefaultValue string `json:"default_value"` +} type Phone struct { IfShow bool `json:"if_show"` Text string `json:"text"` @@ -87,7 +93,7 @@ func GetTemplateSwitchInfo(templateId int64, templateJsonStr *string, templateMa mapSwitchInfo.MaterialData.Phone = Phone{ IfShow: v.Visible, Text: v.Text, - DefaultValue: "xxx xxx xxx xxxx", + DefaultValue: "000 xxx xxx 1111", } case "Address": //地址 mapSwitchInfo.MaterialData.Address = Address{ @@ -105,7 +111,13 @@ func GetTemplateSwitchInfo(templateId int64, templateJsonStr *string, templateMa mapSwitchInfo.MaterialData.QRcode = QRcode{ IfShow: v.Visible, Text: v.Text, - DefaultValue: "xxxxxxx", + DefaultValue: "qrcode xxxxxxx", + } + case "Slogan": + mapSwitchInfo.MaterialData.Slogan = Slogan{ + IfShow: v.Visible, + Text: v.Text, + DefaultValue: "slogan xxxxxxx", } } }