Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop

This commit is contained in:
momo 2023-11-27 16:32:04 +08:00
commit 299031ac3f

View File

@ -363,6 +363,10 @@ func (w *wsConnectItem) getProductRelationInfo(renderImageData *websocket_data.R
// 组装数据发送给unity // 组装数据发送给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) { 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 {
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 refletion := -1
if element.Refletion != nil && *element.Refletion != "" { if element.Refletion != nil && *element.Refletion != "" {
@ -404,17 +408,17 @@ func (w *wsConnectItem) assembleRenderDataToUnity(taskId string, resolution int,
}) })
} }
if element.ModelP != nil && *element.ModelP != "" { if element.ModelP != nil && *element.ModelP != "" {
tempData = append(tempData, map[string]interface{}{ /*tempData = append(tempData, map[string]interface{}{
"name": "model_P", "name": "model_P",
"data": "0," + *element.ModelP, "data": "0," + *element.ModelP,
"type": "other", "type": "other",
"layer": "0", "layer": "0",
"is_update": 0, "is_update": 0,
"mode": mode["model_P"], "mode": mode["model_P"],
}) })*/
} }
//××××××××××××××××××××××××××××××××××××××××××××××××××××× //×××××××××××××××××××××××××××××××××××××××××××××××××××××
if w.userId == 127 { if w.userId == 127 && info.RenderData.ProductId == 32 {
if element.Base != nil && *element.Base != "" { if element.Base != nil && *element.Base != "" {
tempData = append(tempData, map[string]interface{}{ tempData = append(tempData, map[string]interface{}{
"name": "model_1", "name": "model_1",
@ -435,16 +439,16 @@ func (w *wsConnectItem) assembleRenderDataToUnity(taskId string, resolution int,
"mode": mode["shadow"], "mode": mode["shadow"],
}) })
} }
if element.ModelP != nil && *element.ModelP != "" { /*if element.ModelP != nil && *element.ModelP != "" {
tempData = append(tempData, map[string]interface{}{ tempData = append(tempData, map[string]interface{}{
"name": "model_P_1", "name": "model_P_1",
"data": "0," + *element.ModelP, "data": "0,",
"type": "other", "type": "other",
"layer": "0", "layer": "0",
"is_update": 0, "is_update": 0,
"mode": mode["model_P_1"], "mode": mode["model_P"],
}) })
} }*/
if element.Base != nil && *element.Base != "" { if element.Base != nil && *element.Base != "" {
tempData = append(tempData, map[string]interface{}{ tempData = append(tempData, map[string]interface{}{
"name": "model_2", "name": "model_2",
@ -491,14 +495,14 @@ func (w *wsConnectItem) assembleRenderDataToUnity(taskId string, resolution int,
}, },
} }
//************************** //**************************
if w.userId == 127 { if w.userId == 127 && info.RenderData.ProductId == 32 {
result = []interface{}{ result = []interface{}{
map[string]interface{}{ map[string]interface{}{
"light": 22, "light": 22,
"refletion": refletion, "refletion": refletion,
"scale": *element.Scale, "scale": 20,
"sku_id": info.RenderData.ProductId, "sku_id": info.RenderData.ProductId,
"tid": *element.Title, "tid": "ceshi",
"rotation": *element.Rotation, "rotation": *element.Rotation,
"filePath": "", //todo 文件路径,针对千人千面 "filePath": "", //todo 文件路径,针对千人千面
"data": tempData, "data": tempData,