diff --git a/server/websocket/internal/logic/ws_render_image.go b/server/websocket/internal/logic/ws_render_image.go index d9e8e702..096fd3b2 100644 --- a/server/websocket/internal/logic/ws_render_image.go +++ b/server/websocket/internal/logic/ws_render_image.go @@ -109,7 +109,7 @@ func (w *wsConnectItem) renderImage(data []byte) { w.renderErrResponse(renderImageData.RenderId, renderImageData.RenderData.TemplateTag, "", "请传入模板标签选择的颜色", renderImageData.RenderData.ProductId, w.userId, w.guestId, 0, 0, 0, 0) return } - if renderImageData.RenderData.TemplateTagColor.SelectedIndex >= lenColor || renderImageData.RenderData.TemplateTagColor.SelectedIndex < 0 { + if renderImageData.RenderData.TemplateTagColor.SelectedColorIndex >= lenColor || renderImageData.RenderData.TemplateTagColor.SelectedColorIndex < 0 { w.renderErrResponse(renderImageData.RenderId, renderImageData.RenderData.TemplateTag, "", "选择的模板标签颜色索引越界", renderImageData.RenderData.ProductId, w.userId, w.guestId, 0, 0, 0, 0) return } @@ -208,7 +208,7 @@ func (w *wsConnectItem) renderImage(data []byte) { LogoUrl: renderImageData.RenderData.Logo, TemplateTagColor: repositories.TemplateTagColor{ Color: renderImageData.RenderData.TemplateTagColor.Color, - Index: renderImageData.RenderData.TemplateTagColor.SelectedIndex, + Index: renderImageData.RenderData.TemplateTagColor.SelectedColorIndex, }, } res, err := w.logic.svcCtx.Repositories.ImageHandle.LogoCombine(w.logic.ctx, &combineReq) diff --git a/utils/websocket_data/render_data.go b/utils/websocket_data/render_data.go index 0eea4eb8..c65b2eda 100644 --- a/utils/websocket_data/render_data.go +++ b/utils/websocket_data/render_data.go @@ -30,8 +30,8 @@ type RenderData struct { GuestId int64 `json:"guest_id"` //游客id(websocket连接建立再赋值) } type TemplateTagColor struct { - Color [][]string `json:"color"` //颜色组合 - SelectedIndex int `json:"selected_index"` //主色的下标索引 + Color [][]string `json:"color"` //颜色组合 + SelectedColorIndex int `json:"selected_color_index"` //主色的下标索引 } // websocket发送渲染完的数据