fusenapi/server_api/websocket.api

36 lines
1.1 KiB
Plaintext
Raw Normal View History

2023-07-24 08:07:05 +00:00
syntax = "v1"
info (
title: "websocket"// TODO: add title
desc: // TODO: add description
author: ""
email: ""
)
import "basic.api"
service websocket {
//websocket数据交互
@handler DataTransferHandler
2023-07-26 03:53:06 +00:00
get /api/websocket/data_transfer(request) returns (response);
2023-08-16 04:16:23 +00:00
//云渲染完了通知接口
@handler RenderNotifyHandler
post /api/websocket/render_notify(RenderNotifyReq) returns (response);
2023-08-24 07:45:23 +00:00
//通用回调接口
@handler CommonNotifyHandler
post /api/websocket/common_notify(CommonNotifyReq) returns (response);
2023-08-16 04:16:23 +00:00
}
//渲染完了通知接口
type RenderNotifyReq {
2023-09-04 08:54:55 +00:00
TaskId string `json:"task_id"` //任务id + " " + wid的结合字符串
2023-08-16 04:16:23 +00:00
UserId int64 `json:"user_id"`
GuestId int64 `json:"guest_id"`
Image string `json:"image"`
2023-08-23 07:08:45 +00:00
}
2023-08-24 07:45:23 +00:00
//通用回调接口
type CommonNotifyReq {
2023-09-04 09:11:40 +00:00
Wid string `json:"wid,optional"` //websocket连接标识(找ws连接优先级高于user_id和guestid)
2023-09-04 07:00:11 +00:00
UserId int64 `json:"user_id,optional"` //用户id
GuestId int64 `json:"guest_id,optional"` //游客id
Data map[string]interface{} `json:"data"` //后端与前端约定好的数据
2023-07-24 08:07:05 +00:00
}