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 {
renderId string //渲染id(新增任务传)
combineImage string //刀版图(新增任务传)
combineTakesTime int64 //合刀版图耗时
uploadCombineImageTakesTime int64 //上传刀版图耗时
unityRenderBeginTime int64 //发送给unity时间
@ -188,13 +187,13 @@ func (w *wsConnectItem) consumeRenderCache(data []byte) {
logx.Error("合成刀版图失败,合成的刀版图是空指针:", err)
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 {
w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_COMBINE_IMAGE, websocket_data.CombineImageRspMsg{
RenderId: renderImageData.RenderId,
CombineImage: combineImage,
}))
return
}
//获取唯一id
@ -210,9 +209,8 @@ func (w *wsConnectItem) consumeRenderCache(data []byte) {
} else {
//返回给客户端
b := w.respondDataFormat(constants.WEBSOCKET_RENDER_IMAGE, websocket_data.RenderImageRspMsg{
RenderId: renderImageData.RenderId,
Image: *resource.ResourceUrl,
CombineImage: combineImage,
RenderId: renderImageData.RenderId,
Image: *resource.ResourceUrl,
RenderProcessTime: websocket_data.RenderProcessTime{
CombineTakesTime: "cache",
UnityRenderTakesTime: "cache",
@ -238,7 +236,6 @@ func (w *wsConnectItem) consumeRenderCache(data []byte) {
taskProperty: renderTask{
combineTakesTime: res.DiffTimeLogoCombine,
uploadCombineImageTakesTime: res.DiffTimeUploadFile,
combineImage: combineImage,
},
})
//组装数据
@ -464,9 +461,8 @@ func (w *wsConnectItem) operationRenderTask() {
}
//发送到出口
w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_RENDER_IMAGE, websocket_data.RenderImageRspMsg{
RenderId: taskData.renderId,
Image: data.renderNotifyImageUrl,
CombineImage: taskData.combineImage,
RenderId: taskData.renderId,
Image: data.renderNotifyImageUrl,
RenderProcessTime: websocket_data.RenderProcessTime{
CombineTakesTime: CombineTakesTime,
UnityRenderTakesTime: UnityRenderTakesTime,
@ -504,9 +500,6 @@ func (w *wsConnectItem) operationRenderTask() {
if data.taskProperty.unityRenderEndTime != 0 {
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 {
RenderId string `json:"render_id"` //渲染id
Image string `json:"image"` //渲染结果图片
CombineImage string `json:"combine_image"` //刀版图
RenderProcessTime RenderProcessTime `json:"render_process_time"` //流程耗时
}
type RenderProcessTime struct {