From dad56a677bfc2b7c7dae961ea91ba084990c1961 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Thu, 24 Aug 2023 14:24:04 +0800 Subject: [PATCH] fix --- server/websocket/internal/logic/datatransferlogic.go | 2 +- server/websocket/internal/logic/loginnotifylogic.go | 2 +- .../internal/logic/registeraccountnotifylogic.go | 2 +- .../websocket/internal/logic/ws_render_image_logic.go | 10 +++++----- .../internal => utils}/websocket_data/notify_data.go | 0 .../internal => utils}/websocket_data/render_data.go | 0 6 files changed, 8 insertions(+), 8 deletions(-) rename {server/websocket/internal => utils}/websocket_data/notify_data.go (100%) rename {server/websocket/internal => utils}/websocket_data/render_data.go (100%) diff --git a/server/websocket/internal/logic/datatransferlogic.go b/server/websocket/internal/logic/datatransferlogic.go index c415f075..98c9449e 100644 --- a/server/websocket/internal/logic/datatransferlogic.go +++ b/server/websocket/internal/logic/datatransferlogic.go @@ -6,9 +6,9 @@ import ( "encoding/hex" "encoding/json" "fusenapi/constants" - "fusenapi/server/websocket/internal/websocket_data" "fusenapi/utils/auth" "fusenapi/utils/encryption_decryption" + "fusenapi/utils/websocket_data" "net/http" "strings" "sync" diff --git a/server/websocket/internal/logic/loginnotifylogic.go b/server/websocket/internal/logic/loginnotifylogic.go index 024880a4..cf8a1298 100644 --- a/server/websocket/internal/logic/loginnotifylogic.go +++ b/server/websocket/internal/logic/loginnotifylogic.go @@ -4,10 +4,10 @@ package logic import ( "encoding/json" "fusenapi/constants" - "fusenapi/server/websocket/internal/websocket_data" "fusenapi/utils/auth" "fusenapi/utils/basic" "fusenapi/utils/encryption_decryption" + "fusenapi/utils/websocket_data" "time" "context" diff --git a/server/websocket/internal/logic/registeraccountnotifylogic.go b/server/websocket/internal/logic/registeraccountnotifylogic.go index 74da6240..7b82dc00 100644 --- a/server/websocket/internal/logic/registeraccountnotifylogic.go +++ b/server/websocket/internal/logic/registeraccountnotifylogic.go @@ -4,10 +4,10 @@ package logic import ( "encoding/json" "fusenapi/constants" - "fusenapi/server/websocket/internal/websocket_data" "fusenapi/utils/auth" "fusenapi/utils/basic" "fusenapi/utils/encryption_decryption" + "fusenapi/utils/websocket_data" "time" "context" diff --git a/server/websocket/internal/logic/ws_render_image_logic.go b/server/websocket/internal/logic/ws_render_image_logic.go index d7796d59..bb6e9852 100644 --- a/server/websocket/internal/logic/ws_render_image_logic.go +++ b/server/websocket/internal/logic/ws_render_image_logic.go @@ -7,10 +7,10 @@ import ( "errors" "fmt" "fusenapi/constants" - websocket_data2 "fusenapi/server/websocket/internal/websocket_data" "fusenapi/service/repositories" "fusenapi/utils/curl" "fusenapi/utils/hash" + "fusenapi/utils/websocket_data" "github.com/zeromicro/go-zero/core/logx" "gorm.io/gorm" "strconv" @@ -70,7 +70,7 @@ func (w *wsConnectItem) renderImage() { // 消费渲染缓冲数据 func (w *wsConnectItem) consumeRenderCache(data []byte) { logx.Info("消费渲染数据:", string(data)) - var renderImageData websocket_data2.RenderImageReqMsg + var renderImageData websocket_data.RenderImageReqMsg if err := json.Unmarshal(data, &renderImageData); err != nil { w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_ERR_DATA_FORMAT, "invalid format of websocket render image message:"+string(data))) logx.Error("invalid format of websocket render image message", err) @@ -136,7 +136,7 @@ func (w *wsConnectItem) consumeRenderCache(data []byte) { } } else { //返回给客户端 - b := w.respondDataFormat(constants.WEBSOCKET_RENDER_IMAGE, websocket_data2.RenderImageRspMsg{ + b := w.respondDataFormat(constants.WEBSOCKET_RENDER_IMAGE, websocket_data.RenderImageRspMsg{ RenderId: renderImageData.RenderId, Image: *resource.ResourceUrl, CombineTakesTime: "耗时0秒(缓存)", @@ -161,7 +161,7 @@ func (w *wsConnectItem) consumeRenderCache(data []byte) { } // 组装数据发送给unity -func (w *wsConnectItem) assembleRenderData(taskId string, info websocket_data2.RenderImageReqMsg) error { +func (w *wsConnectItem) assembleRenderData(taskId string, info websocket_data.RenderImageReqMsg) error { //获取产品第一个尺寸 productFirstSize, err := w.logic.svcCtx.AllModels.FsProductSize.GetProductFirstSize(w.logic.ctx, info.RenderData.ProductId) if err != nil { @@ -423,7 +423,7 @@ func (w *wsConnectItem) operationRenderTask() { UnityRenderTakesTime = fmt.Sprintf("耗时%d秒", taskData.UnityRenderEndTime-taskData.UnityRenderBeginTime) } //发送到出口 - w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_RENDER_IMAGE, websocket_data2.RenderImageRspMsg{ + w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_RENDER_IMAGE, websocket_data.RenderImageRspMsg{ RenderId: taskData.RenderId, Image: data.RenderNotifyImageUrl, CombineTakesTime: CombineTakesTime, diff --git a/server/websocket/internal/websocket_data/notify_data.go b/utils/websocket_data/notify_data.go similarity index 100% rename from server/websocket/internal/websocket_data/notify_data.go rename to utils/websocket_data/notify_data.go diff --git a/server/websocket/internal/websocket_data/render_data.go b/utils/websocket_data/render_data.go similarity index 100% rename from server/websocket/internal/websocket_data/render_data.go rename to utils/websocket_data/render_data.go