This commit is contained in:
laodaming 2023-11-02 16:00:49 +08:00
parent 5721bb31c8
commit 3cd976976a
5 changed files with 16 additions and 16 deletions

View File

@ -50,10 +50,10 @@ func (l *RenderNotifyLogic) RenderNotify(req *types.RenderNotifyReq, userinfo *a
if info.RenderBeginTime > serverStartTime {
//logx.Info("任务时间:", info.RenderBeginTime, "服务器启动时间:", serverStartTime)
//统计unity处理数
decreaseUnityRequestCount(req.UserId, req.GuestId)
decreaseUnityRequestCount(info.UserId, info.GuestId)
if req.Code != 0 {
//统计unity失败处理数
increaseUnityErrorCount(req.UserId, req.GuestId)
increaseUnityErrorCount(info.UserId, info.GuestId)
}
}
//重新赋值(很重要)
@ -76,8 +76,8 @@ func (l *RenderNotifyLogic) RenderNotify(req *types.RenderNotifyReq, userinfo *a
Metadata: "",
UploadBucket: 1,
ApiType: 2,
UserId: req.UserId,
GuestId: req.GuestId,
UserId: info.UserId,
GuestId: info.GuestId,
FileByte: nil,
})
if err != nil {

View File

@ -400,6 +400,8 @@ func (w *wsConnectItem) assembleRenderDataToUnity(taskId string, resolution int,
RequestId: info.RequestId,
RenderBeginTime: time.Now().UTC().UnixMilli(),
TemplateTag: info.RenderData.TemplateTag,
UserId: w.userId,
GuestId: w.guestId,
}
temIdBytes, _ := json.Marshal(temId)
sendData := map[string]interface{}{

View File

@ -10,12 +10,10 @@ type DataTransferReq struct {
}
type RenderNotifyReq struct {
TaskId string `json:"task_id"`
UserId int64 `json:"user_id"`
GuestId int64 `json:"guest_id"`
Image string `json:"image"`
Code int `json:"code,optional"`
Msg string `json:"msg,optional"`
TaskId string `json:"task_id"`
Image string `json:"image"`
Code int `json:"code,optional"`
Msg string `json:"msg,optional"`
}
type CommonNotifyReq struct {

View File

@ -32,12 +32,10 @@ type DataTransferReq {
}
//渲染完了通知接口
type RenderNotifyReq {
TaskId string `json:"task_id"`
UserId int64 `json:"user_id"`
GuestId int64 `json:"guest_id"`
Image string `json:"image"`
Code int `json:"code,optional"`
Msg string `json:"msg,optional"`
TaskId string `json:"task_id"`
Image string `json:"image"`
Code int `json:"code,optional"`
Msg string `json:"msg,optional"`
}
//通用回调接口
type CommonNotifyReq {

View File

@ -68,4 +68,6 @@ type ToUnityIdStruct struct {
RequestId string `json:"request_id"`
RenderBeginTime int64 `json:"render_begin_time"`
TemplateTag string `json:"template_tag"`
UserId int64 `json:"user_id"`
GuestId int64 `json:"guest_id"`
}