1.5 KiB
1.5 KiB
http://localhost:8080/api
所有返回的json对象总有如下格式
class respose<T> {
"code": number;
"message": string;
"data": T
}
接下来将省略/api并只给出T的类声明
当"code"不是200时,"data"必定为null
部分/api/test的返回值不遵循上述格式
/test
GET /hello
Authorization: Bearer $Token
key: 无
回复:
"Hello Kotlin WebFlux!"
/v1/auth
POST /login
Authorization: 无
key: username, password
data:
class data {
"username": string;
"role": string;
"token": string;
"expire": Date;
}
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:
class data {
"token": sting;
"expire": time
}
ws://localhost:8080/ws
几乎所有的ws请求都需要先在http请求中获取ticket
/test
回复:
`Kotlin springboot4 received: ${userText}`