This commit is contained in:
laodaming 2023-09-19 16:10:17 +08:00
parent aa9b972ded
commit b41d6ffda5
2 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -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发送渲染完的数据