change doc & mock

This commit is contained in:
Dawn1Ocean
2024-05-09 14:54:21 +08:00
parent 8f062b0e8c
commit 44ce17d43d
4 changed files with 129 additions and 23 deletions
+113 -8
View File
@@ -24,7 +24,79 @@
}
```
### `GET`请求默认格式(若无特殊说明)
### `GET` 请求默认格式(若无特殊说明)
```json
{
"token": "token_test"
}
```
## 登陆
### 账号密码登陆 `POST /login`
request:
```json
{
"stuid": "3220114514",
"passwd": "__passwd_test__"
}
```
data:
.role
-1 => 未定
0 => 干事
1 => 部长
2 => 会长
3 => 副会长
4 => 技术指导
5 => 已退休
6 => 管理员
7 => 副部长
8 => 总监
.department
-1 => 未定
0 => 电器部
1 => 电脑部
2 => 人资部
3 => 文宣部
4 => 财外部
```json
{
"token": "token_test",
"name": "亦可",
"avatar": "https://....png",
"role": 6,
"department": 1,
"access": "admin" // "admin" => 主席团成员 "leader" => 值班组长 "member" => 普通成员
}
```
### 登出 `POST /logout`
request:
```json
{
@@ -86,10 +158,12 @@ data:
"otherDutyTime": [
{
"name": "第一班",
"place": "蓝田",
"range": ["2024-03-07T19:52:48.523303", "2024-03-07T19:52:48.523303"]
},
{
"name": "第二班",
"place": "蓝田",
"range": ["2024-03-07T19:52:48.523303", "2024-03-07T19:52:48.523303"]
},
...
@@ -102,19 +176,50 @@ data:
#### 更新当前值班情况 `POST /admin/duty/update`
无关项返回空字符串,后端手动校验
无关项不返回,后端手动校验
新增字段:dutyStatus "normal" => 正常值班 "others" => 特殊值班 "pause" => 暂停值班
request:
##### 正常值班
```json
{
"isNormalDuty": true,
"currentDuty": "2",
"dutyStatus": "normal",
"inDutyCnt": 3,
"otherDutyTime": [],
"offDutyReason": "",
"place": "204",
"dutyRecoverTime": "",
},
```
##### 特殊值班
```json
{
"dutyStatus": "others",
"inDutyCnt": 3,
"otherDutyTime": [
{
"name": "第一班",
"place": "蓝田",
"range": ["2024-03-07T19:52:48.523303", "2024-03-07T19:52:48.523303"]
},
{
"name": "第二班",
"place": "蓝田",
"range": ["2024-03-07T19:52:48.523303", "2024-03-07T19:52:48.523303"]
},
...
],
},
```
##### 暂停值班
```json
{
"dutyStatus": "pause",
"offDutyReason": "期中考试周",
"dutyRecoverTime": "2024-03-07T19:52:48.523303",
},
```