From 6fdcd68726ced4f4f3c2f5285935e4ef65e3c5de Mon Sep 17 00:00:00 2001
From: laodaming <11058467+laudamine@user.noreply.gitee.com>
Date: Mon, 27 Nov 2023 17:06:08 +0800
Subject: [PATCH 1/2] fix

---
 server/websocket/internal/logic/ws_render_image.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/websocket/internal/logic/ws_render_image.go b/server/websocket/internal/logic/ws_render_image.go
index 2ee1c826..e34f3ed6 100644
--- a/server/websocket/internal/logic/ws_render_image.go
+++ b/server/websocket/internal/logic/ws_render_image.go
@@ -390,7 +390,7 @@ func (w *wsConnectItem) assembleRenderDataToUnity(taskId string, resolution int,
 	if element.Base != nil && *element.Base != "" {
 		tempData = append(tempData, map[string]interface{}{
 			"name":      "model",
-			"data":      "0," + "卡扣式打包盒-1_MaskMap,卡扣式打包盒-1_Normal,卡扣式打包盒-1_BaseMap",
+			"data":      "0," + combineImage + "," + "卡扣式打包盒-1_MaskMap,卡扣式打包盒-1_Normal,卡扣式打包盒-1_BaseMap",
 			"type":      "other",
 			"layer":     "0",
 			"is_update": 1,

From 663b831ec15665894ac77c34bd9065f0ca07278c Mon Sep 17 00:00:00 2001
From: laodaming <11058467+laudamine@user.noreply.gitee.com>
Date: Mon, 27 Nov 2023 17:12:41 +0800
Subject: [PATCH 2/2] fix

---
 .../internal/logic/ws_render_image.go         | 83 +------------------
 1 file changed, 4 insertions(+), 79 deletions(-)

diff --git a/server/websocket/internal/logic/ws_render_image.go b/server/websocket/internal/logic/ws_render_image.go
index e34f3ed6..87902472 100644
--- a/server/websocket/internal/logic/ws_render_image.go
+++ b/server/websocket/internal/logic/ws_render_image.go
@@ -363,10 +363,6 @@ func (w *wsConnectItem) getProductRelationInfo(renderImageData *websocket_data.R
 
 // 组装数据发送给unity
 func (w *wsConnectItem) assembleRenderDataToUnity(taskId string, resolution int, combineImage string, info websocket_data.RenderImageReqMsg, productTemplate *gmodel.FsProductTemplateV2, model3dInfo *gmodel.FsProductModel3d, element *gmodel.FsProductTemplateElement, productSize *gmodel.FsProductSize) (err error) {
-	if w.userId != 127 || info.RenderData.ProductId != 32 {
-		w.renderErrResponse(info.RequestId, info.RenderData.TemplateTag, taskId, "测试拦截,稍后开放", info.RenderData.ProductId, w.userId, w.guestId, productTemplate.Id, model3dInfo.Id, productSize.Id, *productTemplate.ElementModelId)
-		return err
-	}
 	//组装数据
 	refletion := -1
 	if element.Refletion != nil && *element.Refletion != "" {
@@ -390,7 +386,7 @@ func (w *wsConnectItem) assembleRenderDataToUnity(taskId string, resolution int,
 	if element.Base != nil && *element.Base != "" {
 		tempData = append(tempData, map[string]interface{}{
 			"name":      "model",
-			"data":      "0," + combineImage + "," + "卡扣式打包盒-1_MaskMap,卡扣式打包盒-1_Normal,卡扣式打包盒-1_BaseMap",
+			"data":      "0," + combineImage + "," + *element.Base,
 			"type":      "other",
 			"layer":     "0",
 			"is_update": 1,
@@ -400,7 +396,7 @@ func (w *wsConnectItem) assembleRenderDataToUnity(taskId string, resolution int,
 	if element.Shadow != nil && *element.Shadow != "" {
 		tempData = append(tempData, map[string]interface{}{
 			"name":      "shadow",
-			"data":      "0,卡扣式打包盒-1,0,0,0",
+			"data":      *element.Shadow,
 			"type":      "other",
 			"layer":     "0",
 			"is_update": 0,
@@ -408,70 +404,15 @@ func (w *wsConnectItem) assembleRenderDataToUnity(taskId string, resolution int,
 		})
 	}
 	if element.ModelP != nil && *element.ModelP != "" {
-		/*tempData = append(tempData, map[string]interface{}{
+		tempData = append(tempData, map[string]interface{}{
 			"name":      "model_P",
 			"data":      "0," + *element.ModelP,
 			"type":      "other",
 			"layer":     "0",
 			"is_update": 0,
 			"mode":      mode["model_P"],
-		})*/
+		})
 	}
-	//×××××××××××××××××××××××××××××××××××××××××××××××××××××
-	if w.userId == 127 {
-		if element.Base != nil && *element.Base != "" {
-			tempData = append(tempData, map[string]interface{}{
-				"name":      "model_1",
-				"data":      "0," + combineImage + "," + "圆绳手提纸袋-S_MaskMap,圆绳手提纸袋-S_Normal,圆绳手提纸袋-S_BaseMap",
-				"type":      "other",
-				"layer":     "0",
-				"is_update": 1,
-				"mode":      mode["model"],
-			})
-		}
-		if element.Shadow != nil && *element.Shadow != "" {
-			tempData = append(tempData, map[string]interface{}{
-				"name":      "shadow_1",
-				"data":      "0,圆绳手提纸袋-S,0,0,0",
-				"type":      "other",
-				"layer":     "0",
-				"is_update": 0,
-				"mode":      mode["shadow"],
-			})
-		}
-		if element.Base != nil && *element.Base != "" {
-			tempData = append(tempData, map[string]interface{}{
-				"name":      "model_2",
-				"data":      "0," + combineImage + "," + "热饮单层纸杯-12oz_MaskMap,热饮单层纸杯-12oz_Normal,热饮单层纸杯-12oz_BaseMap",
-				"type":      "other",
-				"layer":     "0",
-				"is_update": 1,
-				"mode":      mode["model"],
-			})
-		}
-		if element.Shadow != nil && *element.Shadow != "" {
-			tempData = append(tempData, map[string]interface{}{
-				"name":      "shadow_2",
-				"data":      "0,热饮单层纸杯-12oz,0,0,0",
-				"type":      "other",
-				"layer":     "0",
-				"is_update": 0,
-				"mode":      mode["shadow"],
-			})
-		}
-		if element.ModelP != nil && *element.ModelP != "" {
-			tempData = append(tempData, map[string]interface{}{
-				"name":      "model_P_2",
-				"data":      "0," + "热饮单层纸杯-12oz-杯盖,热饮单层纸杯-12oz-杯盖_MaskMap,热饮单层纸杯-12oz-杯盖_Normal,热饮单层纸杯-12oz-杯盖_BaseMap",
-				"type":      "other",
-				"layer":     "0",
-				"is_update": 0,
-				"mode":      mode["model_P"],
-			})
-		}
-	}
-
-	//××××××××××××××××××××××××××××××××××××××××××××××××××××
 	result := []interface{}{
 		map[string]interface{}{
 			"light":     *element.Light,
@@ -484,22 +425,6 @@ func (w *wsConnectItem) assembleRenderDataToUnity(taskId string, resolution int,
 			"data":      tempData,
 		},
 	}
-	//**************************
-	if w.userId == 127 {
-		result = []interface{}{
-			map[string]interface{}{
-				"light":     22,
-				"refletion": refletion,
-				"scale":     10,
-				"sku_id":    info.RenderData.ProductId,
-				"tid":       "ceshi",
-				"rotation":  *element.Rotation,
-				"filePath":  "", //todo 文件路径,针对千人千面
-				"data":      tempData,
-			},
-		}
-	}
-	//*******************************
 	//发送运行阶段消息(组装数据)
 	w.sendAssembleRenderDataStepResponseMessage(info.RequestId)
 	temId := websocket_data.ToUnityIdStruct{