GuessWhoIAmS/docs/tsapi.md
2023-09-11 12:14:17 +08:00

139 lines
1.5 KiB
Markdown

# TSRPC API 接口文档
## 通用说明
- 所有请求方法均为 `POST`
- 所有请求均需加入以下 Header :
- `Content-Type: application/json`
## 目录
- account
- [Login](#/account/Login)
- room
- [ChangeState](#/room/ChangeState)
- [Create](#/room/Create)
- [Exit](#/room/Exit)
- [Join](#/room/Join)
- [List](#/room/List)
---
## 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>
**路径**
- POST `/room/ChangeState`
**请求**
```ts
interface ReqChangeState {
state: number
}
```
**响应**
```ts
type ResChangeState = number
```
---
### Create <a id="/room/Create"></a>
**路径**
- POST `/room/Create`
**请求**
```ts
interface ReqCreate {
null: string
}
```
**响应**
```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[]
```