fix
This commit is contained in:
parent
9b60897a2a
commit
d0db3f4ef0
|
@ -140,9 +140,6 @@ func (w *wsConnectItem) consumeRenderImageData() {
|
||||||
|
|
||||||
// 执行渲染任务
|
// 执行渲染任务
|
||||||
func (w *wsConnectItem) renderImage(renderImageData websocket_data.RenderImageReqMsg) {
|
func (w *wsConnectItem) renderImage(renderImageData websocket_data.RenderImageReqMsg) {
|
||||||
//用户id赋值
|
|
||||||
renderImageData.RenderData.UserId = w.userId
|
|
||||||
renderImageData.RenderData.GuestId = w.guestId
|
|
||||||
if renderImageData.RenderData.Logo == "" {
|
if renderImageData.RenderData.Logo == "" {
|
||||||
w.renderErrResponse(renderImageData.RequestId, renderImageData.RenderData.TemplateTag, "", "请传入logo", renderImageData.RenderData.ProductId, w.userId, w.guestId, 0, 0, 0, 0)
|
w.renderErrResponse(renderImageData.RequestId, renderImageData.RenderData.TemplateTag, "", "请传入logo", renderImageData.RenderData.ProductId, w.userId, w.guestId, 0, 0, 0, 0)
|
||||||
return
|
return
|
||||||
|
@ -211,8 +208,8 @@ func (w *wsConnectItem) renderImage(renderImageData websocket_data.RenderImageRe
|
||||||
defer decreaseCombineRequestCount(w.userId, w.guestId)
|
defer decreaseCombineRequestCount(w.userId, w.guestId)
|
||||||
//获取刀版图
|
//获取刀版图
|
||||||
combineReq := repositories.LogoCombineReq{
|
combineReq := repositories.LogoCombineReq{
|
||||||
UserId: renderImageData.RenderData.UserId,
|
UserId: w.userId,
|
||||||
GuestId: renderImageData.RenderData.GuestId,
|
GuestId: w.guestId,
|
||||||
ProductTemplateV2Info: productTemplate,
|
ProductTemplateV2Info: productTemplate,
|
||||||
ProductTemplateTagGroups: renderImageData.RenderData.TemplateTagGroups,
|
ProductTemplateTagGroups: renderImageData.RenderData.TemplateTagGroups,
|
||||||
TemplateTag: renderImageData.RenderData.TemplateTag,
|
TemplateTag: renderImageData.RenderData.TemplateTag,
|
||||||
|
@ -451,8 +448,8 @@ func (w *wsConnectItem) assembleRenderDataToUnity(taskId string, resolution int,
|
||||||
sendData := map[string]interface{}{
|
sendData := map[string]interface{}{
|
||||||
"id": string(temIdBytes),
|
"id": string(temIdBytes),
|
||||||
"order_id": 0,
|
"order_id": 0,
|
||||||
"user_id": info.RenderData.UserId,
|
"user_id": w.userId,
|
||||||
"guest_id": info.RenderData.GuestId,
|
"guest_id": w.guestId,
|
||||||
"sku_ids": []int64{info.RenderData.ProductId},
|
"sku_ids": []int64{info.RenderData.ProductId},
|
||||||
"tids": []string{*element.Title},
|
"tids": []string{*element.Title},
|
||||||
"data": result,
|
"data": result,
|
||||||
|
@ -488,11 +485,7 @@ func (w *wsConnectItem) assembleRenderDataToUnity(taskId string, resolution int,
|
||||||
|
|
||||||
// 组装渲染任务id
|
// 组装渲染任务id
|
||||||
func (w *wsConnectItem) genRenderTaskId(combineImage string, renderImageData websocket_data.RenderImageReqMsg, model3dInfo *gmodel.FsProductModel3d, productTemplate *gmodel.FsProductTemplateV2, element *gmodel.FsProductTemplateElement) string {
|
func (w *wsConnectItem) genRenderTaskId(combineImage string, renderImageData websocket_data.RenderImageReqMsg, model3dInfo *gmodel.FsProductModel3d, productTemplate *gmodel.FsProductTemplateV2, element *gmodel.FsProductTemplateElement) string {
|
||||||
//生成任务id(需要把user_id,guest_id设为0)
|
incomeHashBytes, _ := json.Marshal(renderImageData.RenderData)
|
||||||
incomeHashParam := renderImageData.RenderData
|
|
||||||
incomeHashParam.UserId = 0 //设为0(渲染跟用户id无关)
|
|
||||||
incomeHashParam.GuestId = 0 //设为0(渲染跟用户id无关)
|
|
||||||
incomeHashBytes, _ := json.Marshal(incomeHashParam)
|
|
||||||
modelHashStr := ""
|
modelHashStr := ""
|
||||||
templateHashStr := ""
|
templateHashStr := ""
|
||||||
if model3dInfo.ModelInfo != nil {
|
if model3dInfo.ModelInfo != nil {
|
||||||
|
|
|
@ -18,8 +18,8 @@ type RenderData struct {
|
||||||
Address string `json:"address"` //地址(可选)
|
Address string `json:"address"` //地址(可选)
|
||||||
Phone string `json:"phone"` //电话(可选)
|
Phone string `json:"phone"` //电话(可选)
|
||||||
Qrcode string `json:"qrcode"` //二维码(可选)
|
Qrcode string `json:"qrcode"` //二维码(可选)
|
||||||
UserId int64 `json:"user_id"` //用户id(websocket连接建立再赋值)
|
//UserId int64 `json:"user_id"` //用户id(websocket连接建立再赋值)
|
||||||
GuestId int64 `json:"guest_id"` //游客id(websocket连接建立再赋值)
|
//GuestId int64 `json:"guest_id"` //游客id(websocket连接建立再赋值)
|
||||||
}
|
}
|
||||||
type TemplateTagColor struct {
|
type TemplateTagColor struct {
|
||||||
Colors [][]string `json:"colors"` //颜色组合
|
Colors [][]string `json:"colors"` //颜色组合
|
||||||
|
|
Loading…
Reference in New Issue
Block a user