This commit is contained in:
laodaming 2023-11-23 12:33:29 +08:00
parent 9b60897a2a
commit d0db3f4ef0
2 changed files with 7 additions and 14 deletions

View File

@ -140,9 +140,6 @@ func (w *wsConnectItem) consumeRenderImageData() {
// 执行渲染任务
func (w *wsConnectItem) renderImage(renderImageData websocket_data.RenderImageReqMsg) {
//用户id赋值
renderImageData.RenderData.UserId = w.userId
renderImageData.RenderData.GuestId = w.guestId
if renderImageData.RenderData.Logo == "" {
w.renderErrResponse(renderImageData.RequestId, renderImageData.RenderData.TemplateTag, "", "请传入logo", renderImageData.RenderData.ProductId, w.userId, w.guestId, 0, 0, 0, 0)
return
@ -211,8 +208,8 @@ func (w *wsConnectItem) renderImage(renderImageData websocket_data.RenderImageRe
defer decreaseCombineRequestCount(w.userId, w.guestId)
//获取刀版图
combineReq := repositories.LogoCombineReq{
UserId: renderImageData.RenderData.UserId,
GuestId: renderImageData.RenderData.GuestId,
UserId: w.userId,
GuestId: w.guestId,
ProductTemplateV2Info: productTemplate,
ProductTemplateTagGroups: renderImageData.RenderData.TemplateTagGroups,
TemplateTag: renderImageData.RenderData.TemplateTag,
@ -451,8 +448,8 @@ func (w *wsConnectItem) assembleRenderDataToUnity(taskId string, resolution int,
sendData := map[string]interface{}{
"id": string(temIdBytes),
"order_id": 0,
"user_id": info.RenderData.UserId,
"guest_id": info.RenderData.GuestId,
"user_id": w.userId,
"guest_id": w.guestId,
"sku_ids": []int64{info.RenderData.ProductId},
"tids": []string{*element.Title},
"data": result,
@ -488,11 +485,7 @@ func (w *wsConnectItem) assembleRenderDataToUnity(taskId string, resolution int,
// 组装渲染任务id
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)
incomeHashParam := renderImageData.RenderData
incomeHashParam.UserId = 0 //设为0(渲染跟用户id无关)
incomeHashParam.GuestId = 0 //设为0(渲染跟用户id无关)
incomeHashBytes, _ := json.Marshal(incomeHashParam)
incomeHashBytes, _ := json.Marshal(renderImageData.RenderData)
modelHashStr := ""
templateHashStr := ""
if model3dInfo.ModelInfo != nil {

View File

@ -18,8 +18,8 @@ type RenderData struct {
Address string `json:"address"` //地址(可选)
Phone string `json:"phone"` //电话(可选)
Qrcode string `json:"qrcode"` //二维码(可选)
UserId int64 `json:"user_id"` //用户id(websocket连接建立再赋值)
GuestId int64 `json:"guest_id"` //游客id(websocket连接建立再赋值)
//UserId int64 `json:"user_id"` //用户id(websocket连接建立再赋值)
//GuestId int64 `json:"guest_id"` //游客id(websocket连接建立再赋值)
}
type TemplateTagColor struct {
Colors [][]string `json:"colors"` //颜色组合