1530 lines
36 KiB
JSON
1530 lines
36 KiB
JSON
{
|
|
"routes": [
|
|
{
|
|
"method": "post",
|
|
"path": "/api/v1/users",
|
|
"tag": "user",
|
|
"operationId": "addUser",
|
|
"description": "新增用户",
|
|
"pathParams": [],
|
|
"quryParams": [],
|
|
"bodyParams": [
|
|
{
|
|
"name": "username",
|
|
"type": "string",
|
|
"required": true,
|
|
"description": "登录账号"
|
|
},
|
|
{
|
|
"name": "nickname",
|
|
"type": "string",
|
|
"required": true,
|
|
"description": "用户昵称"
|
|
},
|
|
{
|
|
"name": "password",
|
|
"type": "string",
|
|
"required": false,
|
|
"description": "用户密码"
|
|
},
|
|
{
|
|
"name": "avatarId",
|
|
"type": "number",
|
|
"required": false,
|
|
"description": "头像ID"
|
|
},
|
|
{
|
|
"name": "roleIds",
|
|
"type": "array",
|
|
"required": false,
|
|
"description": "角色ID列表"
|
|
}
|
|
],
|
|
"bodyReturn": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
{
|
|
"method": "get",
|
|
"path": "/api/v1/users",
|
|
"tag": "user",
|
|
"operationId": "getUsers",
|
|
"description": "分页/条件查询用户",
|
|
"pathParams": [],
|
|
"quryParams": [
|
|
{
|
|
"name": "nickname",
|
|
"type": "string",
|
|
"description": "用户昵称",
|
|
"required": false
|
|
},
|
|
{
|
|
"name": "sort",
|
|
"type": "string",
|
|
"description": "排序规则",
|
|
"required": false
|
|
},
|
|
{
|
|
"name": "page",
|
|
"type": "number",
|
|
"description": "页码",
|
|
"required": false
|
|
},
|
|
{
|
|
"name": "size",
|
|
"type": "number",
|
|
"description": "每页条数",
|
|
"required": false
|
|
}
|
|
],
|
|
"bodyParams": [],
|
|
"bodyReturn": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"username": {
|
|
"type": "string",
|
|
"description": "登录账号",
|
|
"example": "juetan"
|
|
},
|
|
"nickname": {
|
|
"type": "string",
|
|
"description": "用户昵称",
|
|
"example": "绝弹"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "用户介绍",
|
|
"example": "这个人很懒, 什么也没有留下!"
|
|
},
|
|
"avatar": {
|
|
"type": "string",
|
|
"description": "用户头像(URL)",
|
|
"example": "./assets/222421415123.png "
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"description": "用户密码",
|
|
"example": "password"
|
|
},
|
|
"email": {
|
|
"type": "string",
|
|
"description": "用户邮箱",
|
|
"example": "example@mail.com"
|
|
},
|
|
"roleIds": {
|
|
"description": "用户角色ID",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"username",
|
|
"nickname",
|
|
"description",
|
|
"avatar",
|
|
"password",
|
|
"email",
|
|
"roleIds"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"method": "get",
|
|
"path": "/api/v1/users/{id}",
|
|
"tag": "user",
|
|
"operationId": "getUser",
|
|
"description": "根据ID查询用户",
|
|
"pathParams": [
|
|
{
|
|
"name": "id",
|
|
"type": "number",
|
|
"required": true
|
|
}
|
|
],
|
|
"quryParams": [],
|
|
"bodyParams": [],
|
|
"bodyReturn": {
|
|
"type": "object",
|
|
"properties": {
|
|
"username": {
|
|
"type": "string",
|
|
"description": "登录账号",
|
|
"example": "juetan"
|
|
},
|
|
"nickname": {
|
|
"type": "string",
|
|
"description": "用户昵称",
|
|
"example": "绝弹"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "用户介绍",
|
|
"example": "这个人很懒, 什么也没有留下!"
|
|
},
|
|
"avatar": {
|
|
"type": "string",
|
|
"description": "用户头像(URL)",
|
|
"example": "./assets/222421415123.png "
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"description": "用户密码",
|
|
"example": "password"
|
|
},
|
|
"email": {
|
|
"type": "string",
|
|
"description": "用户邮箱",
|
|
"example": "example@mail.com"
|
|
},
|
|
"roleIds": {
|
|
"description": "用户角色ID",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"username",
|
|
"nickname",
|
|
"description",
|
|
"avatar",
|
|
"password",
|
|
"email",
|
|
"roleIds"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"method": "patch",
|
|
"path": "/api/v1/users/{id}",
|
|
"tag": "user",
|
|
"operationId": "updateUser",
|
|
"description": "根据ID更新用户",
|
|
"pathParams": [
|
|
{
|
|
"name": "id",
|
|
"type": "number",
|
|
"required": true
|
|
}
|
|
],
|
|
"quryParams": [],
|
|
"bodyParams": [
|
|
{
|
|
"name": "id",
|
|
"type": "number",
|
|
"required": true
|
|
},
|
|
{
|
|
"name": "username",
|
|
"type": "string",
|
|
"required": false,
|
|
"description": "登录账号"
|
|
},
|
|
{
|
|
"name": "nickname",
|
|
"type": "string",
|
|
"required": false,
|
|
"description": "用户昵称"
|
|
},
|
|
{
|
|
"name": "password",
|
|
"type": "string",
|
|
"required": false,
|
|
"description": "用户密码"
|
|
},
|
|
{
|
|
"name": "avatarId",
|
|
"type": "number",
|
|
"required": false,
|
|
"description": "头像ID"
|
|
},
|
|
{
|
|
"name": "roleIds",
|
|
"type": "array",
|
|
"required": false,
|
|
"description": "角色ID列表"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"method": "delete",
|
|
"path": "/api/v1/users/{id}",
|
|
"tag": "user",
|
|
"operationId": "delUser",
|
|
"description": "根据ID删除用户",
|
|
"pathParams": [
|
|
{
|
|
"name": "id",
|
|
"type": "number",
|
|
"required": true
|
|
}
|
|
],
|
|
"quryParams": [],
|
|
"bodyParams": []
|
|
},
|
|
{
|
|
"method": "post",
|
|
"path": "/api/v1/auth/login",
|
|
"tag": "auth",
|
|
"operationId": "login",
|
|
"description": "账号登陆",
|
|
"pathParams": [],
|
|
"quryParams": [],
|
|
"bodyParams": [
|
|
{
|
|
"name": "username",
|
|
"type": "string",
|
|
"required": true,
|
|
"description": "用户名"
|
|
},
|
|
{
|
|
"name": "password",
|
|
"type": "string",
|
|
"required": true,
|
|
"description": "用户密码"
|
|
}
|
|
],
|
|
"bodyReturn": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "number",
|
|
"description": "用户ID"
|
|
},
|
|
"token": {
|
|
"type": "string",
|
|
"description": "访问令牌",
|
|
"example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MjIsInVzZXJuYW1lIjoianVldGFuIiwiaWF0IjoxNjkxMTM5MjI3LCJleHAiOjE2OTExOTkyMjd9.6z7f-xfsHABbsyg401o2boKeqNQ1epPDYfEdavIcfYc"
|
|
},
|
|
"username": {
|
|
"type": "string",
|
|
"description": "登录账号",
|
|
"example": "juetan"
|
|
},
|
|
"nickname": {
|
|
"type": "string",
|
|
"description": "用户昵称",
|
|
"example": "绝弹"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "用户介绍",
|
|
"example": "这个人很懒, 什么也没有留下!"
|
|
},
|
|
"avatar": {
|
|
"type": "string",
|
|
"description": "用户头像(URL)",
|
|
"example": "./assets/222421415123.png "
|
|
},
|
|
"email": {
|
|
"type": "string",
|
|
"description": "用户邮箱",
|
|
"example": "example@mail.com"
|
|
},
|
|
"roleIds": {
|
|
"description": "用户角色ID",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"token",
|
|
"username",
|
|
"nickname",
|
|
"description",
|
|
"avatar",
|
|
"email",
|
|
"roleIds"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"method": "post",
|
|
"path": "/api/v1/logs",
|
|
"tag": "log",
|
|
"operationId": "addLog",
|
|
"description": "新增日志管理",
|
|
"pathParams": [],
|
|
"quryParams": [],
|
|
"bodyParams": [
|
|
{
|
|
"name": "demo",
|
|
"type": "string",
|
|
"required": true,
|
|
"description": "字段描述(Swagger用途)"
|
|
}
|
|
],
|
|
"bodyReturn": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
{
|
|
"method": "get",
|
|
"path": "/api/v1/logs",
|
|
"tag": "log",
|
|
"operationId": "getLogs",
|
|
"description": "根据分页/过滤参数查询日志管理",
|
|
"pathParams": [],
|
|
"quryParams": [
|
|
{
|
|
"name": "nickname",
|
|
"type": "string",
|
|
"description": "用户名",
|
|
"required": false
|
|
},
|
|
{
|
|
"name": "sort",
|
|
"type": "string",
|
|
"description": "排序规则",
|
|
"required": false
|
|
},
|
|
{
|
|
"name": "page",
|
|
"type": "number",
|
|
"description": "页码",
|
|
"required": false
|
|
},
|
|
{
|
|
"name": "size",
|
|
"type": "number",
|
|
"description": "每页条数",
|
|
"required": false
|
|
}
|
|
],
|
|
"bodyParams": [],
|
|
"bodyReturn": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"nickname": {
|
|
"type": "string",
|
|
"description": "用户昵称",
|
|
"example": "绝弹"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "操作描述",
|
|
"example": "1"
|
|
},
|
|
"status": {
|
|
"type": "boolean",
|
|
"description": "操作状态",
|
|
"example": true
|
|
},
|
|
"ip": {
|
|
"type": "string",
|
|
"description": "登陆IP",
|
|
"example": "127.0.0.1"
|
|
},
|
|
"addr": {
|
|
"type": "string",
|
|
"description": "登陆地址",
|
|
"example": "广东省深圳市"
|
|
},
|
|
"browser": {
|
|
"type": "string",
|
|
"description": "浏览器",
|
|
"example": "chrome"
|
|
},
|
|
"os": {
|
|
"type": "string",
|
|
"description": "操作系统",
|
|
"example": "windows 10"
|
|
}
|
|
},
|
|
"required": [
|
|
"nickname",
|
|
"description",
|
|
"status",
|
|
"ip",
|
|
"addr",
|
|
"browser",
|
|
"os"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"method": "get",
|
|
"path": "/api/v1/logs/login",
|
|
"tag": "log",
|
|
"operationId": "getLoginLogs",
|
|
"description": "分页查询登陆日志",
|
|
"pathParams": [],
|
|
"quryParams": [
|
|
{
|
|
"name": "nickname",
|
|
"type": "string",
|
|
"description": "用户名",
|
|
"required": false
|
|
},
|
|
{
|
|
"name": "sort",
|
|
"type": "string",
|
|
"description": "排序规则",
|
|
"required": false
|
|
},
|
|
{
|
|
"name": "page",
|
|
"type": "number",
|
|
"description": "页码",
|
|
"required": false
|
|
},
|
|
{
|
|
"name": "size",
|
|
"type": "number",
|
|
"description": "每页条数",
|
|
"required": false
|
|
}
|
|
],
|
|
"bodyParams": [],
|
|
"bodyReturn": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"nickname": {
|
|
"type": "string",
|
|
"description": "用户昵称",
|
|
"example": "绝弹"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "操作描述",
|
|
"example": "1"
|
|
},
|
|
"status": {
|
|
"type": "boolean",
|
|
"description": "操作状态",
|
|
"example": true
|
|
},
|
|
"ip": {
|
|
"type": "string",
|
|
"description": "登陆IP",
|
|
"example": "127.0.0.1"
|
|
},
|
|
"addr": {
|
|
"type": "string",
|
|
"description": "登陆地址",
|
|
"example": "广东省深圳市"
|
|
},
|
|
"browser": {
|
|
"type": "string",
|
|
"description": "浏览器",
|
|
"example": "chrome"
|
|
},
|
|
"os": {
|
|
"type": "string",
|
|
"description": "操作系统",
|
|
"example": "windows 10"
|
|
}
|
|
},
|
|
"required": [
|
|
"nickname",
|
|
"description",
|
|
"status",
|
|
"ip",
|
|
"addr",
|
|
"browser",
|
|
"os"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"method": "get",
|
|
"path": "/api/v1/logs/{id}",
|
|
"tag": "log",
|
|
"operationId": "getLog",
|
|
"description": "根据ID查询日志管理",
|
|
"pathParams": [
|
|
{
|
|
"name": "id",
|
|
"type": "number",
|
|
"required": true
|
|
}
|
|
],
|
|
"quryParams": [],
|
|
"bodyParams": [],
|
|
"bodyReturn": {
|
|
"type": "object",
|
|
"properties": {
|
|
"nickname": {
|
|
"type": "string",
|
|
"description": "用户昵称",
|
|
"example": "绝弹"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "操作描述",
|
|
"example": "1"
|
|
},
|
|
"status": {
|
|
"type": "boolean",
|
|
"description": "操作状态",
|
|
"example": true
|
|
},
|
|
"ip": {
|
|
"type": "string",
|
|
"description": "登陆IP",
|
|
"example": "127.0.0.1"
|
|
},
|
|
"addr": {
|
|
"type": "string",
|
|
"description": "登陆地址",
|
|
"example": "广东省深圳市"
|
|
},
|
|
"browser": {
|
|
"type": "string",
|
|
"description": "浏览器",
|
|
"example": "chrome"
|
|
},
|
|
"os": {
|
|
"type": "string",
|
|
"description": "操作系统",
|
|
"example": "windows 10"
|
|
}
|
|
},
|
|
"required": [
|
|
"nickname",
|
|
"description",
|
|
"status",
|
|
"ip",
|
|
"addr",
|
|
"browser",
|
|
"os"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"method": "patch",
|
|
"path": "/api/v1/logs/{id}",
|
|
"tag": "log",
|
|
"operationId": "updateLog",
|
|
"description": "根据ID更新日志管理",
|
|
"pathParams": [
|
|
{
|
|
"name": "id",
|
|
"type": "number",
|
|
"required": true
|
|
}
|
|
],
|
|
"quryParams": [],
|
|
"bodyParams": [
|
|
{
|
|
"name": "demo",
|
|
"type": "string",
|
|
"required": false,
|
|
"description": "字段描述(Swagger用途)"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"method": "delete",
|
|
"path": "/api/v1/logs/{id}",
|
|
"tag": "log",
|
|
"operationId": "delLog",
|
|
"description": "根据ID删除日志管理",
|
|
"pathParams": [
|
|
{
|
|
"name": "id",
|
|
"type": "number",
|
|
"required": true
|
|
}
|
|
],
|
|
"quryParams": [],
|
|
"bodyParams": []
|
|
},
|
|
{
|
|
"method": "post",
|
|
"path": "/api/v1/roles",
|
|
"tag": "role",
|
|
"operationId": "addRole",
|
|
"description": "创建角色",
|
|
"pathParams": [],
|
|
"quryParams": [],
|
|
"bodyParams": [
|
|
{
|
|
"name": "name",
|
|
"type": "string",
|
|
"required": true
|
|
},
|
|
{
|
|
"name": "slug",
|
|
"type": "string",
|
|
"required": true
|
|
},
|
|
{
|
|
"name": "description",
|
|
"type": "string",
|
|
"required": false
|
|
},
|
|
{
|
|
"name": "permissions",
|
|
"type": "array",
|
|
"required": false
|
|
}
|
|
],
|
|
"bodyReturn": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
{
|
|
"method": "get",
|
|
"path": "/api/v1/roles",
|
|
"tag": "role",
|
|
"operationId": "getRoles",
|
|
"description": "批量查询角色",
|
|
"pathParams": [],
|
|
"quryParams": [],
|
|
"bodyParams": []
|
|
},
|
|
{
|
|
"method": "get",
|
|
"path": "/api/v1/roles/{id}",
|
|
"tag": "role",
|
|
"operationId": "getRole",
|
|
"description": "查询角色",
|
|
"pathParams": [
|
|
{
|
|
"name": "id",
|
|
"type": "number",
|
|
"required": true
|
|
}
|
|
],
|
|
"quryParams": [],
|
|
"bodyParams": [],
|
|
"bodyReturn": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"method": "patch",
|
|
"path": "/api/v1/roles/{id}",
|
|
"tag": "role",
|
|
"operationId": "updateRole",
|
|
"description": "更新角色",
|
|
"pathParams": [
|
|
{
|
|
"name": "id",
|
|
"type": "number",
|
|
"required": true
|
|
}
|
|
],
|
|
"quryParams": [],
|
|
"bodyParams": [
|
|
{
|
|
"name": "permissionIds",
|
|
"type": "array",
|
|
"required": false
|
|
},
|
|
{
|
|
"name": "name",
|
|
"type": "string",
|
|
"required": false
|
|
},
|
|
{
|
|
"name": "slug",
|
|
"type": "string",
|
|
"required": false
|
|
},
|
|
{
|
|
"name": "description",
|
|
"type": "string",
|
|
"required": false
|
|
},
|
|
{
|
|
"name": "permissions",
|
|
"type": "array",
|
|
"required": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"method": "delete",
|
|
"path": "/api/v1/roles/{id}",
|
|
"tag": "role",
|
|
"operationId": "delRole",
|
|
"description": "删除角色",
|
|
"pathParams": [
|
|
{
|
|
"name": "id",
|
|
"type": "number",
|
|
"required": true
|
|
}
|
|
],
|
|
"quryParams": [],
|
|
"bodyParams": [],
|
|
"bodyReturn": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"method": "post",
|
|
"path": "/api/v1/permissions",
|
|
"tag": "permission",
|
|
"operationId": "addPermission",
|
|
"description": "创建权限",
|
|
"pathParams": [],
|
|
"quryParams": [],
|
|
"bodyParams": [
|
|
{
|
|
"name": "name",
|
|
"type": "string",
|
|
"required": true,
|
|
"description": "权限名称"
|
|
},
|
|
{
|
|
"name": "slug",
|
|
"type": "string",
|
|
"required": true,
|
|
"description": "权限标识"
|
|
},
|
|
{
|
|
"name": "description",
|
|
"type": "string",
|
|
"required": false,
|
|
"description": "权限描述"
|
|
}
|
|
],
|
|
"bodyReturn": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
{
|
|
"method": "get",
|
|
"path": "/api/v1/permissions",
|
|
"tag": "permission",
|
|
"operationId": "getPermissions",
|
|
"description": "批量查询权限",
|
|
"pathParams": [],
|
|
"quryParams": [],
|
|
"bodyParams": []
|
|
},
|
|
{
|
|
"method": "get",
|
|
"path": "/api/v1/permissions/{id}",
|
|
"tag": "permission",
|
|
"operationId": "getPermission",
|
|
"description": "查询权限",
|
|
"pathParams": [
|
|
{
|
|
"name": "id",
|
|
"type": "string",
|
|
"required": true
|
|
}
|
|
],
|
|
"quryParams": [],
|
|
"bodyParams": [],
|
|
"bodyReturn": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"method": "patch",
|
|
"path": "/api/v1/permissions/{id}",
|
|
"tag": "permission",
|
|
"operationId": "setPermission",
|
|
"description": "更新权限",
|
|
"pathParams": [
|
|
{
|
|
"name": "id",
|
|
"type": "string",
|
|
"required": true
|
|
}
|
|
],
|
|
"quryParams": [],
|
|
"bodyParams": [
|
|
{
|
|
"name": "id",
|
|
"type": "number",
|
|
"required": true
|
|
},
|
|
{
|
|
"name": "name",
|
|
"type": "string",
|
|
"required": false,
|
|
"description": "权限名称"
|
|
},
|
|
{
|
|
"name": "slug",
|
|
"type": "string",
|
|
"required": false,
|
|
"description": "权限标识"
|
|
},
|
|
{
|
|
"name": "description",
|
|
"type": "string",
|
|
"required": false,
|
|
"description": "权限描述"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"method": "delete",
|
|
"path": "/api/v1/permissions/{id}",
|
|
"tag": "permission",
|
|
"operationId": "delPermission",
|
|
"description": "删除权限",
|
|
"pathParams": [
|
|
{
|
|
"name": "id",
|
|
"type": "string",
|
|
"required": true
|
|
}
|
|
],
|
|
"quryParams": [],
|
|
"bodyParams": [],
|
|
"bodyReturn": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"method": "post",
|
|
"path": "/api/v1/file",
|
|
"tag": "file",
|
|
"operationId": "addFile",
|
|
"description": "上传文件",
|
|
"pathParams": [],
|
|
"quryParams": [],
|
|
"bodyParams": [],
|
|
"bodyReturn": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
{
|
|
"method": "get",
|
|
"path": "/api/v1/file",
|
|
"tag": "file",
|
|
"operationId": "getFiles",
|
|
"description": "批量查询",
|
|
"pathParams": [],
|
|
"quryParams": [],
|
|
"bodyParams": []
|
|
},
|
|
{
|
|
"method": "get",
|
|
"path": "/api/v1/file/{id}",
|
|
"tag": "file",
|
|
"operationId": "getFile",
|
|
"description": "查询",
|
|
"pathParams": [
|
|
{
|
|
"name": "id",
|
|
"type": "number",
|
|
"required": true
|
|
}
|
|
],
|
|
"quryParams": [],
|
|
"bodyParams": [],
|
|
"bodyReturn": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"description": "文件名",
|
|
"example": "xxx.jpg"
|
|
},
|
|
"size": {
|
|
"type": "number",
|
|
"description": "文件大小",
|
|
"example": 1024
|
|
},
|
|
"mimetype": {
|
|
"type": "string",
|
|
"description": "文件类型",
|
|
"example": "image/jpeg"
|
|
},
|
|
"path": {
|
|
"type": "string",
|
|
"description": "文件路径",
|
|
"example": "/upload/2021/10/01/xxx.jpg"
|
|
},
|
|
"hash": {
|
|
"type": "string",
|
|
"description": "文件哈希",
|
|
"example": "2afb1f8b83ef0cc564f227d75d0b6914"
|
|
},
|
|
"extension": {
|
|
"type": "string",
|
|
"description": "文件后缀",
|
|
"example": ".jpg"
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"size",
|
|
"mimetype",
|
|
"path",
|
|
"hash",
|
|
"extension"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"method": "patch",
|
|
"path": "/api/v1/file/{id}",
|
|
"tag": "file",
|
|
"operationId": "setFile",
|
|
"description": "更新",
|
|
"pathParams": [],
|
|
"quryParams": [],
|
|
"bodyParams": [],
|
|
"bodyReturn": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"method": "delete",
|
|
"path": "/api/v1/file/{id}",
|
|
"tag": "file",
|
|
"operationId": "delFile",
|
|
"description": "删除",
|
|
"pathParams": [
|
|
{
|
|
"name": "id",
|
|
"type": "number",
|
|
"required": true
|
|
}
|
|
],
|
|
"quryParams": [],
|
|
"bodyParams": []
|
|
},
|
|
{
|
|
"method": "get",
|
|
"path": "/api/v1/file/hash/{hash}",
|
|
"tag": "file",
|
|
"operationId": "getFileByHash",
|
|
"description": "查询文件是否已存在",
|
|
"pathParams": [
|
|
{
|
|
"name": "hash",
|
|
"type": "string",
|
|
"required": true
|
|
}
|
|
],
|
|
"quryParams": [],
|
|
"bodyParams": [],
|
|
"bodyReturn": {
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
{
|
|
"method": "post",
|
|
"path": "/api/v1/posts",
|
|
"tag": "post",
|
|
"operationId": "addPost",
|
|
"description": "创建文章",
|
|
"pathParams": [],
|
|
"quryParams": [],
|
|
"bodyParams": [
|
|
{
|
|
"name": "title",
|
|
"type": "string",
|
|
"required": true,
|
|
"description": "文章标题"
|
|
},
|
|
{
|
|
"name": "description",
|
|
"type": "string",
|
|
"required": true,
|
|
"description": "文章描述"
|
|
},
|
|
{
|
|
"name": "content",
|
|
"type": "string",
|
|
"required": true,
|
|
"description": "文章内容"
|
|
}
|
|
],
|
|
"bodyReturn": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
{
|
|
"method": "get",
|
|
"path": "/api/v1/posts",
|
|
"tag": "post",
|
|
"operationId": "getPosts",
|
|
"description": "批量查询文章",
|
|
"pathParams": [],
|
|
"quryParams": [
|
|
{
|
|
"name": "sort",
|
|
"type": "string",
|
|
"description": "排序规则",
|
|
"required": false
|
|
},
|
|
{
|
|
"name": "page",
|
|
"type": "number",
|
|
"description": "页码",
|
|
"required": false
|
|
},
|
|
{
|
|
"name": "size",
|
|
"type": "number",
|
|
"description": "每页条数",
|
|
"required": false
|
|
}
|
|
],
|
|
"bodyParams": []
|
|
},
|
|
{
|
|
"method": "get",
|
|
"path": "/api/v1/posts/template.xlsx",
|
|
"tag": "post",
|
|
"operationId": "getPostTemplate",
|
|
"description": "获取文章下载模板",
|
|
"pathParams": [],
|
|
"quryParams": [],
|
|
"bodyParams": []
|
|
},
|
|
{
|
|
"method": "get",
|
|
"path": "/api/v1/posts/{id}",
|
|
"tag": "post",
|
|
"operationId": "getPost",
|
|
"description": "查询文章",
|
|
"pathParams": [
|
|
{
|
|
"name": "id",
|
|
"type": "number",
|
|
"required": true
|
|
}
|
|
],
|
|
"quryParams": [],
|
|
"bodyParams": [],
|
|
"bodyReturn": {
|
|
"type": "object",
|
|
"properties": {
|
|
"title": {
|
|
"type": "string",
|
|
"description": "文章标题",
|
|
"example": "文章标题"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "文章描述",
|
|
"example": "文章描述"
|
|
},
|
|
"content": {
|
|
"type": "string",
|
|
"description": "文章内容",
|
|
"example": "文章内容"
|
|
},
|
|
"author": {
|
|
"description": "文章作者",
|
|
"example": "文章作者",
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"username": {
|
|
"type": "string",
|
|
"description": "登录账号",
|
|
"example": "juetan"
|
|
},
|
|
"nickname": {
|
|
"type": "string",
|
|
"description": "用户昵称",
|
|
"example": "绝弹"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "用户介绍",
|
|
"example": "这个人很懒, 什么也没有留下!"
|
|
},
|
|
"avatar": {
|
|
"type": "string",
|
|
"description": "用户头像(URL)",
|
|
"example": "./assets/222421415123.png "
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"description": "用户密码",
|
|
"example": "password"
|
|
},
|
|
"email": {
|
|
"type": "string",
|
|
"description": "用户邮箱",
|
|
"example": "example@mail.com"
|
|
},
|
|
"roleIds": {
|
|
"description": "用户角色ID",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"username",
|
|
"nickname",
|
|
"description",
|
|
"avatar",
|
|
"password",
|
|
"email",
|
|
"roleIds"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"title",
|
|
"description",
|
|
"content",
|
|
"author"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"method": "patch",
|
|
"path": "/api/v1/posts/{id}",
|
|
"tag": "post",
|
|
"operationId": "updatePost",
|
|
"description": "更新文章",
|
|
"pathParams": [
|
|
{
|
|
"name": "id",
|
|
"type": "number",
|
|
"required": true
|
|
}
|
|
],
|
|
"quryParams": [],
|
|
"bodyParams": [
|
|
{
|
|
"name": "title",
|
|
"type": "string",
|
|
"required": false,
|
|
"description": "文章标题"
|
|
},
|
|
{
|
|
"name": "description",
|
|
"type": "string",
|
|
"required": false,
|
|
"description": "文章描述"
|
|
},
|
|
{
|
|
"name": "content",
|
|
"type": "string",
|
|
"required": false,
|
|
"description": "文章内容"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"method": "delete",
|
|
"path": "/api/v1/posts/{id}",
|
|
"tag": "post",
|
|
"operationId": "delPost",
|
|
"description": "删除文章",
|
|
"pathParams": [
|
|
{
|
|
"name": "id",
|
|
"type": "number",
|
|
"required": true
|
|
}
|
|
],
|
|
"quryParams": [],
|
|
"bodyParams": []
|
|
},
|
|
{
|
|
"method": "post",
|
|
"path": "/api/v1/categories",
|
|
"tag": "category",
|
|
"operationId": "addCategory",
|
|
"description": "添加分类",
|
|
"pathParams": [],
|
|
"quryParams": [],
|
|
"bodyParams": [
|
|
{
|
|
"name": "title",
|
|
"type": "string",
|
|
"required": true,
|
|
"description": "分类名称"
|
|
},
|
|
{
|
|
"name": "slug",
|
|
"type": "string",
|
|
"required": true,
|
|
"description": "分类别名"
|
|
},
|
|
{
|
|
"name": "description",
|
|
"type": "string",
|
|
"required": false,
|
|
"description": "分类描述"
|
|
},
|
|
{
|
|
"name": "icon",
|
|
"type": "string",
|
|
"required": false,
|
|
"description": "分类图标"
|
|
},
|
|
{
|
|
"name": "sort",
|
|
"type": "number",
|
|
"required": false,
|
|
"description": "分类排序"
|
|
},
|
|
{
|
|
"name": "type",
|
|
"type": "object",
|
|
"required": true,
|
|
"description": "分类类型"
|
|
},
|
|
{
|
|
"name": "parentId",
|
|
"type": "number",
|
|
"required": false,
|
|
"description": "父级分类ID"
|
|
}
|
|
],
|
|
"bodyReturn": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
{
|
|
"method": "get",
|
|
"path": "/api/v1/categories",
|
|
"tag": "category",
|
|
"operationId": "getCategories",
|
|
"description": "分页获取分类",
|
|
"pathParams": [],
|
|
"quryParams": [
|
|
{
|
|
"name": "demo",
|
|
"type": "string",
|
|
"description": "字段描述(Swagger用途)",
|
|
"required": false
|
|
},
|
|
{
|
|
"name": "sort",
|
|
"type": "string",
|
|
"description": "排序规则",
|
|
"required": false
|
|
},
|
|
{
|
|
"name": "page",
|
|
"type": "number",
|
|
"description": "页码",
|
|
"required": false
|
|
},
|
|
{
|
|
"name": "size",
|
|
"type": "number",
|
|
"description": "每页条数",
|
|
"required": false
|
|
}
|
|
],
|
|
"bodyParams": [],
|
|
"bodyReturn": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"title": {
|
|
"type": "string",
|
|
"description": "分类名称",
|
|
"example": "待分类"
|
|
},
|
|
"slug": {
|
|
"type": "string",
|
|
"description": "分类别名",
|
|
"example": "default"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "分类描述",
|
|
"example": "默认分类"
|
|
},
|
|
"icon": {
|
|
"type": "string",
|
|
"description": "分类图标",
|
|
"example": "default"
|
|
},
|
|
"sort": {
|
|
"type": "number",
|
|
"description": "分类排序",
|
|
"example": 0
|
|
},
|
|
"type": {
|
|
"type": "object",
|
|
"description": "分类类型",
|
|
"example": "category"
|
|
},
|
|
"parentId": {
|
|
"type": "number",
|
|
"description": "父级分类ID",
|
|
"example": 0
|
|
}
|
|
},
|
|
"required": [
|
|
"title",
|
|
"slug"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"method": "get",
|
|
"path": "/api/v1/categories/{id}",
|
|
"tag": "category",
|
|
"operationId": "getCategory",
|
|
"description": "添加分类",
|
|
"pathParams": [],
|
|
"quryParams": [],
|
|
"bodyParams": [],
|
|
"bodyReturn": {
|
|
"type": "object",
|
|
"properties": {
|
|
"title": {
|
|
"type": "string",
|
|
"description": "分类名称",
|
|
"example": "待分类"
|
|
},
|
|
"slug": {
|
|
"type": "string",
|
|
"description": "分类别名",
|
|
"example": "default"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "分类描述",
|
|
"example": "默认分类"
|
|
},
|
|
"icon": {
|
|
"type": "string",
|
|
"description": "分类图标",
|
|
"example": "default"
|
|
},
|
|
"sort": {
|
|
"type": "number",
|
|
"description": "分类排序",
|
|
"example": 0
|
|
},
|
|
"type": {
|
|
"type": "object",
|
|
"description": "分类类型",
|
|
"example": "category"
|
|
},
|
|
"parentId": {
|
|
"type": "number",
|
|
"description": "父级分类ID",
|
|
"example": 0
|
|
}
|
|
},
|
|
"required": [
|
|
"title",
|
|
"slug"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"method": "patch",
|
|
"path": "/api/v1/categories/{id}",
|
|
"tag": "category",
|
|
"operationId": "setCategory",
|
|
"description": "更新分类",
|
|
"pathParams": [],
|
|
"quryParams": [],
|
|
"bodyParams": [
|
|
{
|
|
"name": "id",
|
|
"type": "number",
|
|
"required": true
|
|
},
|
|
{
|
|
"name": "title",
|
|
"type": "string",
|
|
"required": false,
|
|
"description": "分类名称"
|
|
},
|
|
{
|
|
"name": "slug",
|
|
"type": "string",
|
|
"required": false,
|
|
"description": "分类别名"
|
|
},
|
|
{
|
|
"name": "description",
|
|
"type": "string",
|
|
"required": false,
|
|
"description": "分类描述"
|
|
},
|
|
{
|
|
"name": "icon",
|
|
"type": "string",
|
|
"required": false,
|
|
"description": "分类图标"
|
|
},
|
|
{
|
|
"name": "sort",
|
|
"type": "number",
|
|
"required": false,
|
|
"description": "分类排序"
|
|
},
|
|
{
|
|
"name": "type",
|
|
"type": "object",
|
|
"required": false,
|
|
"description": "分类类型"
|
|
},
|
|
{
|
|
"name": "parentId",
|
|
"type": "number",
|
|
"required": false,
|
|
"description": "父级分类ID"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"method": "delete",
|
|
"path": "/api/v1/categories/{id}",
|
|
"tag": "category",
|
|
"operationId": "delCategory",
|
|
"description": "删除分类",
|
|
"pathParams": [],
|
|
"quryParams": [],
|
|
"bodyParams": []
|
|
}
|
|
],
|
|
"tags": [
|
|
{
|
|
"name": "user",
|
|
"description": "用户管理"
|
|
},
|
|
{
|
|
"name": "auth",
|
|
"description": "认证管理"
|
|
},
|
|
{
|
|
"name": "role",
|
|
"description": "角色管理"
|
|
},
|
|
{
|
|
"name": "permission",
|
|
"description": "权限管理"
|
|
},
|
|
{
|
|
"name": "post",
|
|
"description": "文章管理"
|
|
},
|
|
{
|
|
"name": "upload",
|
|
"description": "文件上传"
|
|
}
|
|
]
|
|
} |