fusenapi/server_api/websocket.api
laodaming f6e2edf3a8 fix
2023-09-04 14:46:25 +08:00

34 lines
972 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 {
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"` //websocket连接标识,(如果传了token则以token为主寻找连接)
Data map[string]interface{} `json:"data"` //后端与前端约定好的数据
}