This commit is contained in:
SOR
2026-04-04 08:32:57 +08:00
commit b3e1fd9e18
76 changed files with 6650 additions and 0 deletions
+125
View File
@@ -0,0 +1,125 @@
## localhost:8080/api
所有返回的json对象总有如下格式
```
{
"code": int,
"message": string,
"data": T
}
```
接下来将省略`/api`并只给出`T`的类声明
当`"code"`不是`200`时,`"data"`必定为`null`
部分`/api/test`的返回值不遵循上述格式
## /auth
### POST /login
Authorization: 无
key: username, password
data:
```
{
"username": string,
"role": string,
"token": sting,
"expire": time
}
```
### GET /logout
Authorization: Bearer $Token
key: 无
data:
```
null
```
### GET /ask-code?email=******&type=register
Authorization: 无
key: 无
data:
```
null
```
### GET /ask-code?email=******&type=reset
Authorization: 无
key: 无
data:
```
null
```
### POST /register
Authorization: 无
key: 无
data:email, code, username, password
```
null
```
### POST /reset
Authorization: 无
key: email, code, password
data:
```
null
```
### GET /relogin
Authorization: Bearer $Token
key: 无
data:
```
{
"token": sting,
"expire": time
}
```
## /test
### GET /hello
Authorization: Bearer $Token
key: 无
回复:
```
Hello Kotlin WebFlux!
```