From 7bebadc517892207ad28c27662bceba62947f526 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Wed, 20 Sep 2023 14:11:07 +0800 Subject: [PATCH] 11 --- server/websocket/internal/logic/ws_render_image.go | 4 ++-- utils/websocket_data/render_data.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/websocket/internal/logic/ws_render_image.go b/server/websocket/internal/logic/ws_render_image.go index da3f384f..63da9fd2 100644 --- a/server/websocket/internal/logic/ws_render_image.go +++ b/server/websocket/internal/logic/ws_render_image.go @@ -82,7 +82,7 @@ func (w *wsConnectItem) renderImage(data []byte) { w.renderErrResponse(renderImageData.RenderId, renderImageData.RenderData.TemplateTag, "", "请传入logo", renderImageData.RenderData.ProductId, w.userId, w.guestId, 0, 0, 0, 0) return } - lenColor := len(renderImageData.RenderData.TemplateTagColor.Color) + lenColor := len(renderImageData.RenderData.TemplateTagColor.Colors) if lenColor == 0 { w.renderErrResponse(renderImageData.RenderId, renderImageData.RenderData.TemplateTag, "", "请传入模板标签选择的颜色", renderImageData.RenderData.ProductId, w.userId, w.guestId, 0, 0, 0, 0) return @@ -161,7 +161,7 @@ func (w *wsConnectItem) renderImage(data []byte) { Qrcode: renderImageData.RenderData.Qrcode, LogoUrl: renderImageData.RenderData.Logo, TemplateTagColor: repositories.TemplateTagColor{ - Color: renderImageData.RenderData.TemplateTagColor.Color, + Color: renderImageData.RenderData.TemplateTagColor.Colors, Index: renderImageData.RenderData.TemplateTagColor.SelectedColorIndex, }, } diff --git a/utils/websocket_data/render_data.go b/utils/websocket_data/render_data.go index a99774a0..0508d27c 100644 --- a/utils/websocket_data/render_data.go +++ b/utils/websocket_data/render_data.go @@ -28,7 +28,7 @@ type RenderData struct { GuestId int64 `json:"guest_id"` //游客id(websocket连接建立再赋值) } type TemplateTagColor struct { - Color [][]string `json:"color"` //颜色组合 + Colors [][]string `json:"colors"` //颜色组合 SelectedColorIndex int `json:"selected_color_index"` //主色的下标索引 }