fusenapi/server_api/websocket.api
laodaming c65db5fe94 fix
2023-09-04 16:43:32 +08:00

37 lines
1.1 KiB
Plaintext

syntax = "v1"
info (
title: "websocket"// TODO: add title
desc: // TODO: add description
author: ""
email: ""
)
import "basic.api"
service websocket {
//websocket数据交互
@handler DataTransferHandler
get /api/websocket/data_transfer(request) returns (response);
//云渲染完了通知接口
@handler RenderNotifyHandler
post /api/websocket/render_notify(RenderNotifyReq) returns (response);
//通用回调接口
@handler CommonNotifyHandler
post /api/websocket/common_notify(CommonNotifyReq) returns (response);
}
//渲染完了通知接口
type RenderNotifyReq {
Wid string `json:"wid,optional"` //websocket连接唯一标识
TaskId string `json:"task_id"` //任务id
UserId int64 `json:"user_id"`
GuestId int64 `json:"guest_id"`
Image string `json:"image"`
}
//通用回调接口
type CommonNotifyReq {
Wid string `json:"wid,optional"` //websocket连接标识
UserId int64 `json:"user_id,optional"` //用户id
GuestId int64 `json:"guest_id,optional"` //游客id
Data map[string]interface{} `json:"data"` //后端与前端约定好的数据
}