2023-08-31 11:28:35 +00:00
|
|
|
|
|
|
|
# TSRPC API 接口文档
|
|
|
|
|
|
|
|
## 通用说明
|
|
|
|
|
|
|
|
- 所有请求方法均为 `POST`
|
|
|
|
- 所有请求均需加入以下 Header :
|
|
|
|
- `Content-Type: application/json`
|
|
|
|
|
|
|
|
## 目录
|
|
|
|
|
2023-09-11 04:14:17 +00:00
|
|
|
- account
|
|
|
|
- [Login](#/account/Login)
|
|
|
|
- room
|
|
|
|
- [ChangeState](#/room/ChangeState)
|
|
|
|
- [Create](#/room/Create)
|
|
|
|
- [Exit](#/room/Exit)
|
|
|
|
- [Join](#/room/Join)
|
|
|
|
- [List](#/room/List)
|
2023-08-31 11:28:35 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
|
2023-09-11 04:14:17 +00:00
|
|
|
## account
|
|
|
|
|
|
|
|
### Login <a id="/account/Login"></a>
|
|
|
|
|
|
|
|
**路径**
|
|
|
|
- POST `/account/Login`
|
|
|
|
|
|
|
|
**请求**
|
|
|
|
```ts
|
|
|
|
interface ReqLogin {
|
|
|
|
name: string
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
**响应**
|
|
|
|
```ts
|
|
|
|
type ResLogin = number
|
|
|
|
```
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
## room
|
|
|
|
|
|
|
|
### ChangeState <a id="/room/ChangeState"></a>
|
2023-08-31 11:28:35 +00:00
|
|
|
|
|
|
|
**路径**
|
2023-09-11 04:14:17 +00:00
|
|
|
- POST `/room/ChangeState`
|
2023-08-31 11:28:35 +00:00
|
|
|
|
|
|
|
**请求**
|
|
|
|
```ts
|
2023-09-11 04:14:17 +00:00
|
|
|
interface ReqChangeState {
|
|
|
|
state: number
|
2023-08-31 11:28:35 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
**响应**
|
|
|
|
```ts
|
2023-09-11 04:14:17 +00:00
|
|
|
type ResChangeState = number
|
|
|
|
```
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
### Create <a id="/room/Create"></a>
|
|
|
|
|
|
|
|
**路径**
|
|
|
|
- POST `/room/Create`
|
|
|
|
|
|
|
|
**请求**
|
|
|
|
```ts
|
|
|
|
interface ReqCreate {
|
|
|
|
null: string
|
2023-08-31 11:28:35 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2023-09-11 04:14:17 +00:00
|
|
|
**响应**
|
|
|
|
```ts
|
|
|
|
type ResCreate = number
|
|
|
|
```
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
### Exit <a id="/room/Exit"></a>
|
|
|
|
|
|
|
|
**路径**
|
|
|
|
- POST `/room/Exit`
|
|
|
|
|
|
|
|
**请求**
|
|
|
|
```ts
|
|
|
|
interface ReqExit {
|
|
|
|
null: string
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
**响应**
|
|
|
|
```ts
|
|
|
|
type ResExit = number
|
|
|
|
```
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
### Join <a id="/room/Join"></a>
|
|
|
|
|
|
|
|
**路径**
|
|
|
|
- POST `/room/Join`
|
|
|
|
|
|
|
|
**请求**
|
|
|
|
```ts
|
|
|
|
interface ReqJoin {
|
|
|
|
roomId: number
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
**响应**
|
|
|
|
```ts
|
|
|
|
type ResJoin = number
|
|
|
|
```
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
### List <a id="/room/List"></a>
|
|
|
|
|
|
|
|
**路径**
|
|
|
|
- POST `/room/List`
|
|
|
|
|
|
|
|
**请求**
|
|
|
|
```ts
|
|
|
|
interface ReqList {
|
|
|
|
null: string
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
**响应**
|
|
|
|
```ts
|
|
|
|
type ResList = any[]
|
|
|
|
```
|
|
|
|
|