185 lines
3.5 KiB
Markdown
185 lines
3.5 KiB
Markdown
---
|
|
title: 艺考招生管理系统 API
|
|
language_tabs:
|
|
- shell: Shell
|
|
- http: HTTP
|
|
- javascript: JavaScript
|
|
- ruby: Ruby
|
|
- python: Python
|
|
- php: PHP
|
|
- java: Java
|
|
- go: Go
|
|
toc_footers: []
|
|
includes: []
|
|
search: true
|
|
code_clipboard: true
|
|
highlight_theme: darkula
|
|
headingLevel: 2
|
|
generator: "@tarslib/widdershins v4.0.30"
|
|
|
|
---
|
|
|
|
# 艺考招生管理系统 API
|
|
|
|
提供用户认证、院校专业、历年招生、计算专业的管理接口
|
|
|
|
Base URLs:
|
|
|
|
* <a href="http://localhost:8080/api">开发环境: http://localhost:8080/api</a>
|
|
|
|
# Authentication
|
|
|
|
# 认证
|
|
|
|
## GET 获取当前登录用户信息
|
|
|
|
GET /auth/info
|
|
|
|
> 返回示例
|
|
|
|
> 200 Response
|
|
|
|
```
|
|
{"code":0,"data":null,"message":"string"}
|
|
```
|
|
|
|
### 返回结果
|
|
|
|
|状态码|状态码含义|说明|数据模型|
|
|
|---|---|---|---|
|
|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[common.Response](#schemacommon.response)|
|
|
|
|
## POST 用户登录
|
|
|
|
POST /auth/login
|
|
|
|
> Body 请求参数
|
|
|
|
```json
|
|
{
|
|
"username": "18639433190",
|
|
"password": "123456"
|
|
}
|
|
```
|
|
|
|
### 请求参数
|
|
|
|
|名称|位置|类型|必选|说明|
|
|
|---|---|---|---|---|
|
|
|body|body|[controller.LoginRequest](#schemacontroller.loginrequest)| 是 |none|
|
|
|
|
> 返回示例
|
|
|
|
> 200 Response
|
|
|
|
```json
|
|
{
|
|
"code": 200,
|
|
"message": "success",
|
|
"data": {
|
|
"token": "140a1289-1a0a-4c14-82f6-ba1feb36351a",
|
|
"user": {
|
|
"id": "1779515858733772802",
|
|
"username": "dyT3c2tV",
|
|
"realname": "用户-dyT3c2tV",
|
|
"avatar": "",
|
|
"phone": "18639433190",
|
|
"email": "",
|
|
"token": "140a1289-1a0a-4c14-82f6-ba1feb36351a"
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
### 返回结果
|
|
|
|
|状态码|状态码含义|说明|数据模型|
|
|
|---|---|---|---|
|
|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|Inline|
|
|
|
|
### 返回数据结构
|
|
|
|
状态码 **200**
|
|
|
|
|名称|类型|必选|约束|中文名|说明|
|
|
|---|---|---|---|---|---|
|
|
|» code|integer|true|none|状态码|none|
|
|
|» message|string|true|none|状态描述|none|
|
|
|» data|object|true|none||none|
|
|
|»» token|string|true|none|登录TOKEN|none|
|
|
|»» user|object|true|none||none|
|
|
|»»» id|string|true|none|用户ID|none|
|
|
|»»» username|string|true|none|用户名|none|
|
|
|»»» realname|string|true|none||none|
|
|
|»»» avatar|string|true|none|头像|none|
|
|
|»»» phone|string|true|none|手机号|none|
|
|
|»»» email|string|true|none||none|
|
|
|»»» token|string|true|none||none|
|
|
|
|
## POST 用户登出
|
|
|
|
POST /auth/logout
|
|
|
|
> 返回示例
|
|
|
|
> 200 Response
|
|
|
|
```
|
|
{"code":200,"message":"success","data":null}
|
|
```
|
|
|
|
### 返回结果
|
|
|
|
|状态码|状态码含义|说明|数据模型|
|
|
|---|---|---|---|
|
|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[common.Response](#schemacommon.response)|
|
|
|
|
# 数据模型
|
|
|
|
<h2 id="tocS_common.Response">common.Response</h2>
|
|
|
|
<a id="schemacommon.response"></a>
|
|
<a id="schema_common.Response"></a>
|
|
<a id="tocScommon.response"></a>
|
|
<a id="tocscommon.response"></a>
|
|
|
|
```json
|
|
{
|
|
"code": 0,
|
|
"data": null,
|
|
"message": "string"
|
|
}
|
|
|
|
```
|
|
|
|
### 属性
|
|
|
|
|名称|类型|必选|约束|中文名|说明|
|
|
|---|---|---|---|---|---|
|
|
|code|integer|false|none||none|
|
|
|data|any|false|none||none|
|
|
|message|string|false|none||none|
|
|
|
|
<h2 id="tocS_controller.LoginRequest">controller.LoginRequest</h2>
|
|
|
|
<a id="schemacontroller.loginrequest"></a>
|
|
<a id="schema_controller.LoginRequest"></a>
|
|
<a id="tocScontroller.loginrequest"></a>
|
|
<a id="tocscontroller.loginrequest"></a>
|
|
|
|
```json
|
|
{
|
|
"password": "string",
|
|
"username": "string"
|
|
}
|
|
|
|
```
|
|
|
|
### 属性
|
|
|
|
|名称|类型|必选|约束|中文名|说明|
|
|
|---|---|---|---|---|---|
|
|
|password|string|true|none||none|
|
|
|username|string|true|none||none|
|
|
|