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

This commit is contained in:
eson 2023-08-29 15:15:45 +08:00
commit 461772efc3
2 changed files with 10 additions and 18 deletions

View File

@ -37,7 +37,6 @@ type renderImageControlChanItem struct {
// 渲染任务属性 // 渲染任务属性
type renderTask struct { type renderTask struct {
renderId string //渲染id(新增任务传) renderId string //渲染id(新增任务传)
combineImage string //刀版图(新增任务传)
combineTakesTime int64 //合刀版图耗时 combineTakesTime int64 //合刀版图耗时
uploadCombineImageTakesTime int64 //上传刀版图耗时 uploadCombineImageTakesTime int64 //上传刀版图耗时
unityRenderBeginTime int64 //发送给unity时间 unityRenderBeginTime int64 //发送给unity时间
@ -188,13 +187,13 @@ func (w *wsConnectItem) consumeRenderCache(data []byte) {
logx.Error("合成刀版图失败,合成的刀版图是空指针:", err) logx.Error("合成刀版图失败,合成的刀版图是空指针:", err)
return return
} }
logx.Info("合成刀版图成功,合成刀版图数据:", combineReq, ",logo图片:", renderImageData.RenderData.Logo, " 刀版图:", *res.ResourceUrl) //发送合图结果消息
//如果是传入了指定尺寸,则直接返回刀版图 w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_COMBINE_IMAGE, websocket_data.CombineImageRspMsg{
RenderId: renderImageData.RenderId,
CombineImage: combineImage,
}))
//如果是传入了指定尺寸则不走unity
if renderImageData.RenderData.SizeId > 0 { if renderImageData.RenderData.SizeId > 0 {
w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_COMBINE_IMAGE, websocket_data.CombineImageRspMsg{
RenderId: renderImageData.RenderId,
CombineImage: combineImage,
}))
return return
} }
//获取唯一id //获取唯一id
@ -210,9 +209,8 @@ func (w *wsConnectItem) consumeRenderCache(data []byte) {
} else { } else {
//返回给客户端 //返回给客户端
b := w.respondDataFormat(constants.WEBSOCKET_RENDER_IMAGE, websocket_data.RenderImageRspMsg{ b := w.respondDataFormat(constants.WEBSOCKET_RENDER_IMAGE, websocket_data.RenderImageRspMsg{
RenderId: renderImageData.RenderId, RenderId: renderImageData.RenderId,
Image: *resource.ResourceUrl, Image: *resource.ResourceUrl,
CombineImage: combineImage,
RenderProcessTime: websocket_data.RenderProcessTime{ RenderProcessTime: websocket_data.RenderProcessTime{
CombineTakesTime: "cache", CombineTakesTime: "cache",
UnityRenderTakesTime: "cache", UnityRenderTakesTime: "cache",
@ -238,7 +236,6 @@ func (w *wsConnectItem) consumeRenderCache(data []byte) {
taskProperty: renderTask{ taskProperty: renderTask{
combineTakesTime: res.DiffTimeLogoCombine, combineTakesTime: res.DiffTimeLogoCombine,
uploadCombineImageTakesTime: res.DiffTimeUploadFile, uploadCombineImageTakesTime: res.DiffTimeUploadFile,
combineImage: combineImage,
}, },
}) })
//组装数据 //组装数据
@ -464,9 +461,8 @@ func (w *wsConnectItem) operationRenderTask() {
} }
//发送到出口 //发送到出口
w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_RENDER_IMAGE, websocket_data.RenderImageRspMsg{ w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_RENDER_IMAGE, websocket_data.RenderImageRspMsg{
RenderId: taskData.renderId, RenderId: taskData.renderId,
Image: data.renderNotifyImageUrl, Image: data.renderNotifyImageUrl,
CombineImage: taskData.combineImage,
RenderProcessTime: websocket_data.RenderProcessTime{ RenderProcessTime: websocket_data.RenderProcessTime{
CombineTakesTime: CombineTakesTime, CombineTakesTime: CombineTakesTime,
UnityRenderTakesTime: UnityRenderTakesTime, UnityRenderTakesTime: UnityRenderTakesTime,
@ -504,9 +500,6 @@ func (w *wsConnectItem) operationRenderTask() {
if data.taskProperty.unityRenderEndTime != 0 { if data.taskProperty.unityRenderEndTime != 0 {
taskData.unityRenderEndTime = data.taskProperty.unityRenderEndTime taskData.unityRenderEndTime = data.taskProperty.unityRenderEndTime
} }
if data.taskProperty.combineImage != "" {
taskData.combineImage = data.taskProperty.combineImage
}
} }
} }
} }

View File

@ -30,7 +30,6 @@ type RenderData struct {
type RenderImageRspMsg struct { type RenderImageRspMsg struct {
RenderId string `json:"render_id"` //渲染id RenderId string `json:"render_id"` //渲染id
Image string `json:"image"` //渲染结果图片 Image string `json:"image"` //渲染结果图片
CombineImage string `json:"combine_image"` //刀版图
RenderProcessTime RenderProcessTime `json:"render_process_time"` //流程耗时 RenderProcessTime RenderProcessTime `json:"render_process_time"` //流程耗时
} }
type RenderProcessTime struct { type RenderProcessTime struct {