3858 lines
109 KiB
JSON
3858 lines
109 KiB
JSON
{
|
|
"openapi": "3.0.0",
|
|
"paths": {
|
|
"/api/v1/users": {
|
|
"post": {
|
|
"operationId": "addUser",
|
|
"summary": "",
|
|
"description": "新增用户",
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"username": {
|
|
"type": "string",
|
|
"description": "登录账号",
|
|
"example": "juetan"
|
|
},
|
|
"nickname": {
|
|
"type": "string",
|
|
"description": "用户昵称",
|
|
"example": "绝弹"
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"description": "用户密码",
|
|
"example": "password"
|
|
},
|
|
"avatarId": {
|
|
"type": "number",
|
|
"description": "头像ID",
|
|
"example": 1
|
|
},
|
|
"roleIds": {
|
|
"description": "角色ID列表",
|
|
"example": [
|
|
1,
|
|
2,
|
|
3
|
|
],
|
|
"type": "array",
|
|
"items": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"username",
|
|
"nickname"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"201": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
},
|
|
"data": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"user"
|
|
]
|
|
},
|
|
"get": {
|
|
"operationId": "getUsers",
|
|
"summary": "",
|
|
"description": "分页/条件查询用户",
|
|
"parameters": [
|
|
{
|
|
"name": "nickname",
|
|
"required": false,
|
|
"in": "query",
|
|
"description": "用户昵称",
|
|
"example": "绝弹",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "sort",
|
|
"required": false,
|
|
"in": "query",
|
|
"description": "排序规则",
|
|
"example": "id:desc",
|
|
"schema": {
|
|
"pattern": "/^(\\w+:\\w+,)*\\w+:\\w+$/",
|
|
"default": "id:desc",
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "page",
|
|
"required": false,
|
|
"in": "query",
|
|
"description": "页码",
|
|
"example": 1,
|
|
"schema": {
|
|
"minimum": 1,
|
|
"type": "number"
|
|
}
|
|
},
|
|
{
|
|
"name": "size",
|
|
"required": false,
|
|
"in": "query",
|
|
"description": "每页条数",
|
|
"example": 10,
|
|
"schema": {
|
|
"minimum": 0,
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
},
|
|
"data": {
|
|
"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"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"user"
|
|
]
|
|
}
|
|
},
|
|
"/api/v1/users/{id}": {
|
|
"get": {
|
|
"operationId": "getUser",
|
|
"summary": "",
|
|
"description": "根据ID查询用户",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
},
|
|
"data": {
|
|
"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": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"user"
|
|
]
|
|
},
|
|
"patch": {
|
|
"operationId": "updateUser",
|
|
"summary": "",
|
|
"description": "根据ID更新用户",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "number"
|
|
},
|
|
"username": {
|
|
"type": "string",
|
|
"description": "登录账号",
|
|
"example": "juetan"
|
|
},
|
|
"nickname": {
|
|
"type": "string",
|
|
"description": "用户昵称",
|
|
"example": "绝弹"
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"description": "用户密码",
|
|
"example": "password"
|
|
},
|
|
"avatarId": {
|
|
"type": "number",
|
|
"description": "头像ID",
|
|
"example": 1
|
|
},
|
|
"roleIds": {
|
|
"description": "角色ID列表",
|
|
"example": [
|
|
1,
|
|
2,
|
|
3
|
|
],
|
|
"type": "array",
|
|
"items": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"id"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"user"
|
|
]
|
|
},
|
|
"delete": {
|
|
"operationId": "delUser",
|
|
"summary": "",
|
|
"description": "根据ID删除用户",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"user"
|
|
]
|
|
}
|
|
},
|
|
"/api/v1/auth/login": {
|
|
"post": {
|
|
"operationId": "login",
|
|
"summary": "",
|
|
"description": "账号登陆",
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"username": {
|
|
"type": "string",
|
|
"description": "用户名",
|
|
"example": "admin"
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"description": "用户密码",
|
|
"example": "123456"
|
|
}
|
|
},
|
|
"required": [
|
|
"username",
|
|
"password"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
},
|
|
"data": {
|
|
"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"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"auth"
|
|
]
|
|
}
|
|
},
|
|
"/api/v1/logs": {
|
|
"post": {
|
|
"operationId": "addLog",
|
|
"summary": "",
|
|
"description": "新增日志管理",
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"demo": {
|
|
"type": "string",
|
|
"description": "字段描述(Swagger用途)",
|
|
"example": "demo"
|
|
}
|
|
},
|
|
"required": [
|
|
"demo"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"201": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
},
|
|
"data": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"log"
|
|
]
|
|
},
|
|
"get": {
|
|
"operationId": "getLogs",
|
|
"summary": "",
|
|
"description": "根据分页/过滤参数查询日志管理",
|
|
"parameters": [
|
|
{
|
|
"name": "nickname",
|
|
"required": false,
|
|
"in": "query",
|
|
"description": "用户名",
|
|
"example": "绝弹",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "sort",
|
|
"required": false,
|
|
"in": "query",
|
|
"description": "排序规则",
|
|
"example": "id:desc",
|
|
"schema": {
|
|
"pattern": "/^(\\w+:\\w+,)*\\w+:\\w+$/",
|
|
"default": "id:desc",
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "page",
|
|
"required": false,
|
|
"in": "query",
|
|
"description": "页码",
|
|
"example": 1,
|
|
"schema": {
|
|
"minimum": 1,
|
|
"type": "number"
|
|
}
|
|
},
|
|
{
|
|
"name": "size",
|
|
"required": false,
|
|
"in": "query",
|
|
"description": "每页条数",
|
|
"example": 10,
|
|
"schema": {
|
|
"minimum": 0,
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
},
|
|
"data": {
|
|
"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"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"log"
|
|
]
|
|
}
|
|
},
|
|
"/api/v1/logs/login": {
|
|
"get": {
|
|
"operationId": "getLoginLogs",
|
|
"summary": "",
|
|
"description": "分页查询登陆日志",
|
|
"parameters": [
|
|
{
|
|
"name": "nickname",
|
|
"required": false,
|
|
"in": "query",
|
|
"description": "用户名",
|
|
"example": "绝弹",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "sort",
|
|
"required": false,
|
|
"in": "query",
|
|
"description": "排序规则",
|
|
"example": "id:desc",
|
|
"schema": {
|
|
"pattern": "/^(\\w+:\\w+,)*\\w+:\\w+$/",
|
|
"default": "id:desc",
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "page",
|
|
"required": false,
|
|
"in": "query",
|
|
"description": "页码",
|
|
"example": 1,
|
|
"schema": {
|
|
"minimum": 1,
|
|
"type": "number"
|
|
}
|
|
},
|
|
{
|
|
"name": "size",
|
|
"required": false,
|
|
"in": "query",
|
|
"description": "每页条数",
|
|
"example": 10,
|
|
"schema": {
|
|
"minimum": 0,
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
},
|
|
"data": {
|
|
"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"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"log"
|
|
]
|
|
}
|
|
},
|
|
"/api/v1/logs/{id}": {
|
|
"get": {
|
|
"operationId": "getLog",
|
|
"summary": "",
|
|
"description": "根据ID查询日志管理",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
},
|
|
"data": {
|
|
"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"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"log"
|
|
]
|
|
},
|
|
"patch": {
|
|
"operationId": "updateLog",
|
|
"summary": "",
|
|
"description": "根据ID更新日志管理",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"demo": {
|
|
"type": "string",
|
|
"description": "字段描述(Swagger用途)",
|
|
"example": "demo"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"log"
|
|
]
|
|
},
|
|
"delete": {
|
|
"operationId": "delLog",
|
|
"summary": "",
|
|
"description": "根据ID删除日志管理",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"log"
|
|
]
|
|
}
|
|
},
|
|
"/api/v1/roles": {
|
|
"post": {
|
|
"operationId": "addRole",
|
|
"summary": "",
|
|
"description": "创建角色",
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"slug": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"permissions": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"description": "权限名称",
|
|
"example": "文章列表"
|
|
},
|
|
"slug": {
|
|
"type": "string",
|
|
"description": "权限标识",
|
|
"example": "post:list"
|
|
},
|
|
"type": {
|
|
"type": "string",
|
|
"description": "权限类型",
|
|
"example": "menu",
|
|
"enum": [
|
|
"menu",
|
|
"api"
|
|
]
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "权限描述",
|
|
"example": "文章列表"
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"slug",
|
|
"type",
|
|
"description"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"slug"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"201": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
},
|
|
"data": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"role"
|
|
]
|
|
},
|
|
"get": {
|
|
"operationId": "getRoles",
|
|
"summary": "",
|
|
"description": "批量查询角色",
|
|
"parameters": [],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"role"
|
|
]
|
|
}
|
|
},
|
|
"/api/v1/roles/{id}": {
|
|
"get": {
|
|
"operationId": "getRole",
|
|
"summary": "",
|
|
"description": "查询角色",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
},
|
|
"data": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"role"
|
|
]
|
|
},
|
|
"patch": {
|
|
"operationId": "updateRole",
|
|
"summary": "",
|
|
"description": "更新角色",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"permissionIds": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"slug": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"permissions": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"description": "权限名称",
|
|
"example": "文章列表"
|
|
},
|
|
"slug": {
|
|
"type": "string",
|
|
"description": "权限标识",
|
|
"example": "post:list"
|
|
},
|
|
"type": {
|
|
"type": "string",
|
|
"description": "权限类型",
|
|
"example": "menu",
|
|
"enum": [
|
|
"menu",
|
|
"api"
|
|
]
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "权限描述",
|
|
"example": "文章列表"
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"slug",
|
|
"type",
|
|
"description"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"role"
|
|
]
|
|
},
|
|
"delete": {
|
|
"operationId": "delRole",
|
|
"summary": "",
|
|
"description": "删除角色",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
},
|
|
"data": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"role"
|
|
]
|
|
}
|
|
},
|
|
"/api/v1/permissions": {
|
|
"post": {
|
|
"operationId": "addPermission",
|
|
"summary": "",
|
|
"description": "创建权限",
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"description": "权限名称",
|
|
"example": "权限名称"
|
|
},
|
|
"slug": {
|
|
"type": "string",
|
|
"description": "权限标识",
|
|
"example": "permission:permission"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "权限描述"
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"slug"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"201": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
},
|
|
"data": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"permission"
|
|
]
|
|
},
|
|
"get": {
|
|
"operationId": "getPermissions",
|
|
"summary": "",
|
|
"description": "批量查询权限",
|
|
"parameters": [],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"permission"
|
|
]
|
|
}
|
|
},
|
|
"/api/v1/permissions/{id}": {
|
|
"get": {
|
|
"operationId": "getPermission",
|
|
"summary": "",
|
|
"description": "查询权限",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
},
|
|
"data": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"permission"
|
|
]
|
|
},
|
|
"patch": {
|
|
"operationId": "setPermission",
|
|
"summary": "",
|
|
"description": "更新权限",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "number"
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"description": "权限名称",
|
|
"example": "权限名称"
|
|
},
|
|
"slug": {
|
|
"type": "string",
|
|
"description": "权限标识",
|
|
"example": "permission:permission"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "权限描述"
|
|
}
|
|
},
|
|
"required": [
|
|
"id"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"permission"
|
|
]
|
|
},
|
|
"delete": {
|
|
"operationId": "delPermission",
|
|
"summary": "",
|
|
"description": "删除权限",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
},
|
|
"data": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"permission"
|
|
]
|
|
}
|
|
},
|
|
"/api/v1/file": {
|
|
"post": {
|
|
"operationId": "addFile",
|
|
"summary": "",
|
|
"description": "上传文件",
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"description": "要上传的文件",
|
|
"content": {
|
|
"multipart/form-data": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"file": {
|
|
"type": "string",
|
|
"format": "binary"
|
|
}
|
|
},
|
|
"required": [
|
|
"file"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"201": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
},
|
|
"data": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"file"
|
|
]
|
|
},
|
|
"get": {
|
|
"operationId": "getFiles",
|
|
"summary": "",
|
|
"description": "批量查询",
|
|
"parameters": [],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"file"
|
|
]
|
|
}
|
|
},
|
|
"/api/v1/file/{id}": {
|
|
"get": {
|
|
"operationId": "getFile",
|
|
"summary": "",
|
|
"description": "查询",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
},
|
|
"data": {
|
|
"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"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"file"
|
|
]
|
|
},
|
|
"patch": {
|
|
"operationId": "setFile",
|
|
"summary": "",
|
|
"description": "更新",
|
|
"parameters": [],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
},
|
|
"data": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"file"
|
|
]
|
|
},
|
|
"delete": {
|
|
"operationId": "delFile",
|
|
"summary": "",
|
|
"description": "删除",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"file"
|
|
]
|
|
}
|
|
},
|
|
"/api/v1/file/hash/{hash}": {
|
|
"get": {
|
|
"operationId": "getFileByHash",
|
|
"summary": "",
|
|
"description": "查询文件是否已存在",
|
|
"parameters": [
|
|
{
|
|
"name": "hash",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
},
|
|
"data": {
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"file"
|
|
]
|
|
}
|
|
},
|
|
"/api/v1/posts": {
|
|
"post": {
|
|
"operationId": "addPost",
|
|
"summary": "",
|
|
"description": "创建文章",
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"title": {
|
|
"type": "string",
|
|
"description": "文章标题"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "文章描述"
|
|
},
|
|
"content": {
|
|
"type": "string",
|
|
"description": "文章内容"
|
|
}
|
|
},
|
|
"required": [
|
|
"title",
|
|
"description",
|
|
"content"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"201": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
},
|
|
"data": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"post"
|
|
]
|
|
},
|
|
"get": {
|
|
"operationId": "getPosts",
|
|
"summary": "",
|
|
"description": "批量查询文章",
|
|
"parameters": [
|
|
{
|
|
"name": "sort",
|
|
"required": false,
|
|
"in": "query",
|
|
"description": "排序规则",
|
|
"example": "id:desc",
|
|
"schema": {
|
|
"pattern": "/^(\\w+:\\w+,)*\\w+:\\w+$/",
|
|
"default": "id:desc",
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "page",
|
|
"required": false,
|
|
"in": "query",
|
|
"description": "页码",
|
|
"example": 1,
|
|
"schema": {
|
|
"minimum": 1,
|
|
"type": "number"
|
|
}
|
|
},
|
|
{
|
|
"name": "size",
|
|
"required": false,
|
|
"in": "query",
|
|
"description": "每页条数",
|
|
"example": 10,
|
|
"schema": {
|
|
"minimum": 0,
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"post"
|
|
]
|
|
}
|
|
},
|
|
"/api/v1/posts/template.xlsx": {
|
|
"get": {
|
|
"operationId": "getPostTemplate",
|
|
"summary": "",
|
|
"description": "获取文章下载模板",
|
|
"parameters": [],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"post"
|
|
]
|
|
}
|
|
},
|
|
"/api/v1/posts/{id}": {
|
|
"get": {
|
|
"operationId": "getPost",
|
|
"summary": "",
|
|
"description": "查询文章",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
},
|
|
"data": {
|
|
"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"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"post"
|
|
]
|
|
},
|
|
"patch": {
|
|
"operationId": "updatePost",
|
|
"summary": "",
|
|
"description": "更新文章",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"title": {
|
|
"type": "string",
|
|
"description": "文章标题"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "文章描述"
|
|
},
|
|
"content": {
|
|
"type": "string",
|
|
"description": "文章内容"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"post"
|
|
]
|
|
},
|
|
"delete": {
|
|
"operationId": "delPost",
|
|
"summary": "",
|
|
"description": "删除文章",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"post"
|
|
]
|
|
}
|
|
},
|
|
"/api/v1/categories": {
|
|
"post": {
|
|
"operationId": "addCategory",
|
|
"summary": "",
|
|
"description": "添加分类",
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"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",
|
|
"type"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"201": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
},
|
|
"data": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"category"
|
|
]
|
|
},
|
|
"get": {
|
|
"operationId": "getCategories",
|
|
"summary": "",
|
|
"description": "分页获取分类",
|
|
"parameters": [
|
|
{
|
|
"name": "demo",
|
|
"required": false,
|
|
"in": "query",
|
|
"description": "字段描述(Swagger用途)",
|
|
"example": "示例值",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "sort",
|
|
"required": false,
|
|
"in": "query",
|
|
"description": "排序规则",
|
|
"example": "id:desc",
|
|
"schema": {
|
|
"pattern": "/^(\\w+:\\w+,)*\\w+:\\w+$/",
|
|
"default": "id:desc",
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "page",
|
|
"required": false,
|
|
"in": "query",
|
|
"description": "页码",
|
|
"example": 1,
|
|
"schema": {
|
|
"minimum": 1,
|
|
"type": "number"
|
|
}
|
|
},
|
|
{
|
|
"name": "size",
|
|
"required": false,
|
|
"in": "query",
|
|
"description": "每页条数",
|
|
"example": 10,
|
|
"schema": {
|
|
"minimum": 0,
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
},
|
|
"data": {
|
|
"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"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"category"
|
|
]
|
|
}
|
|
},
|
|
"/api/v1/categories/{id}": {
|
|
"get": {
|
|
"operationId": "getCategory",
|
|
"summary": "",
|
|
"description": "添加分类",
|
|
"parameters": [],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
},
|
|
"data": {
|
|
"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"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"category"
|
|
]
|
|
},
|
|
"patch": {
|
|
"operationId": "setCategory",
|
|
"summary": "",
|
|
"description": "更新分类",
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "number"
|
|
},
|
|
"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": [
|
|
"id"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"category"
|
|
]
|
|
},
|
|
"delete": {
|
|
"operationId": "delCategory",
|
|
"summary": "",
|
|
"description": "删除分类",
|
|
"parameters": [],
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"category"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"info": {
|
|
"title": "Appnify接口文档",
|
|
"description": "Openapi 3.0文档",
|
|
"version": "1.0",
|
|
"contact": {}
|
|
},
|
|
"tags": [
|
|
{
|
|
"name": "user",
|
|
"description": "用户管理"
|
|
},
|
|
{
|
|
"name": "auth",
|
|
"description": "认证管理"
|
|
},
|
|
{
|
|
"name": "role",
|
|
"description": "角色管理"
|
|
},
|
|
{
|
|
"name": "permission",
|
|
"description": "权限管理"
|
|
},
|
|
{
|
|
"name": "post",
|
|
"description": "文章管理"
|
|
},
|
|
{
|
|
"name": "upload",
|
|
"description": "文件上传"
|
|
}
|
|
],
|
|
"servers": [],
|
|
"components": {
|
|
"securitySchemes": {
|
|
"bearer": {
|
|
"scheme": "bearer",
|
|
"bearerFormat": "JWT",
|
|
"type": "http"
|
|
}
|
|
},
|
|
"schemas": {
|
|
"CreateUserDto": {
|
|
"type": "object",
|
|
"properties": {
|
|
"username": {
|
|
"type": "string",
|
|
"description": "登录账号",
|
|
"example": "juetan"
|
|
},
|
|
"nickname": {
|
|
"type": "string",
|
|
"description": "用户昵称",
|
|
"example": "绝弹"
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"description": "用户密码",
|
|
"example": "password"
|
|
},
|
|
"avatarId": {
|
|
"type": "number",
|
|
"description": "头像ID",
|
|
"example": 1
|
|
},
|
|
"roleIds": {
|
|
"description": "角色ID列表",
|
|
"example": [
|
|
1,
|
|
2,
|
|
3
|
|
],
|
|
"type": "array",
|
|
"items": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"username",
|
|
"nickname"
|
|
]
|
|
},
|
|
"User": {
|
|
"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"
|
|
]
|
|
},
|
|
"UpdateUserDto": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "number"
|
|
},
|
|
"username": {
|
|
"type": "string",
|
|
"description": "登录账号",
|
|
"example": "juetan"
|
|
},
|
|
"nickname": {
|
|
"type": "string",
|
|
"description": "用户昵称",
|
|
"example": "绝弹"
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"description": "用户密码",
|
|
"example": "password"
|
|
},
|
|
"avatarId": {
|
|
"type": "number",
|
|
"description": "头像ID",
|
|
"example": 1
|
|
},
|
|
"roleIds": {
|
|
"description": "角色ID列表",
|
|
"example": [
|
|
1,
|
|
2,
|
|
3
|
|
],
|
|
"type": "array",
|
|
"items": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"id"
|
|
]
|
|
},
|
|
"AuthUserDto": {
|
|
"type": "object",
|
|
"properties": {
|
|
"username": {
|
|
"type": "string",
|
|
"description": "用户名",
|
|
"example": "admin"
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"description": "用户密码",
|
|
"example": "123456"
|
|
}
|
|
},
|
|
"required": [
|
|
"username",
|
|
"password"
|
|
]
|
|
},
|
|
"LoginedUserVo": {
|
|
"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"
|
|
]
|
|
},
|
|
"CreateLogDto": {
|
|
"type": "object",
|
|
"properties": {
|
|
"demo": {
|
|
"type": "string",
|
|
"description": "字段描述(Swagger用途)",
|
|
"example": "demo"
|
|
}
|
|
},
|
|
"required": [
|
|
"demo"
|
|
]
|
|
},
|
|
"LoginLog": {
|
|
"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"
|
|
]
|
|
},
|
|
"UpdateLogDto": {
|
|
"type": "object",
|
|
"properties": {
|
|
"demo": {
|
|
"type": "string",
|
|
"description": "字段描述(Swagger用途)",
|
|
"example": "demo"
|
|
}
|
|
}
|
|
},
|
|
"Permission": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"description": "权限名称",
|
|
"example": "文章列表"
|
|
},
|
|
"slug": {
|
|
"type": "string",
|
|
"description": "权限标识",
|
|
"example": "post:list"
|
|
},
|
|
"type": {
|
|
"type": "string",
|
|
"description": "权限类型",
|
|
"example": "menu",
|
|
"enum": [
|
|
"menu",
|
|
"api"
|
|
]
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "权限描述",
|
|
"example": "文章列表"
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"slug",
|
|
"type",
|
|
"description"
|
|
]
|
|
},
|
|
"CreateRoleDto": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"slug": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"permissions": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"description": "权限名称",
|
|
"example": "文章列表"
|
|
},
|
|
"slug": {
|
|
"type": "string",
|
|
"description": "权限标识",
|
|
"example": "post:list"
|
|
},
|
|
"type": {
|
|
"type": "string",
|
|
"description": "权限类型",
|
|
"example": "menu",
|
|
"enum": [
|
|
"menu",
|
|
"api"
|
|
]
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "权限描述",
|
|
"example": "文章列表"
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"slug",
|
|
"type",
|
|
"description"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"slug"
|
|
]
|
|
},
|
|
"UpdateRoleDto": {
|
|
"type": "object",
|
|
"properties": {
|
|
"permissionIds": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"slug": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"permissions": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"description": "权限名称",
|
|
"example": "文章列表"
|
|
},
|
|
"slug": {
|
|
"type": "string",
|
|
"description": "权限标识",
|
|
"example": "post:list"
|
|
},
|
|
"type": {
|
|
"type": "string",
|
|
"description": "权限类型",
|
|
"example": "menu",
|
|
"enum": [
|
|
"menu",
|
|
"api"
|
|
]
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "权限描述",
|
|
"example": "文章列表"
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"slug",
|
|
"type",
|
|
"description"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"CreatePermissionDto": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"description": "权限名称",
|
|
"example": "权限名称"
|
|
},
|
|
"slug": {
|
|
"type": "string",
|
|
"description": "权限标识",
|
|
"example": "permission:permission"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "权限描述"
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"slug"
|
|
]
|
|
},
|
|
"UpdatePermissionDto": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "number"
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"description": "权限名称",
|
|
"example": "权限名称"
|
|
},
|
|
"slug": {
|
|
"type": "string",
|
|
"description": "权限标识",
|
|
"example": "permission:permission"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "权限描述"
|
|
}
|
|
},
|
|
"required": [
|
|
"id"
|
|
]
|
|
},
|
|
"CreateUploadDto": {
|
|
"type": "object",
|
|
"properties": {
|
|
"file": {
|
|
"type": "string",
|
|
"format": "binary"
|
|
}
|
|
},
|
|
"required": [
|
|
"file"
|
|
]
|
|
},
|
|
"Upload": {
|
|
"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"
|
|
]
|
|
},
|
|
"CreatePostDto": {
|
|
"type": "object",
|
|
"properties": {
|
|
"title": {
|
|
"type": "string",
|
|
"description": "文章标题"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "文章描述"
|
|
},
|
|
"content": {
|
|
"type": "string",
|
|
"description": "文章内容"
|
|
}
|
|
},
|
|
"required": [
|
|
"title",
|
|
"description",
|
|
"content"
|
|
]
|
|
},
|
|
"Post": {
|
|
"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"
|
|
]
|
|
},
|
|
"UpdatePostDto": {
|
|
"type": "object",
|
|
"properties": {
|
|
"title": {
|
|
"type": "string",
|
|
"description": "文章标题"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "文章描述"
|
|
},
|
|
"content": {
|
|
"type": "string",
|
|
"description": "文章内容"
|
|
}
|
|
}
|
|
},
|
|
"CreateCategoryDto": {
|
|
"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",
|
|
"type"
|
|
]
|
|
},
|
|
"Category": {
|
|
"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"
|
|
]
|
|
},
|
|
"UpdateCategoryDto": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "number"
|
|
},
|
|
"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": [
|
|
"id"
|
|
]
|
|
},
|
|
"Response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"description": "状态码",
|
|
"example": 2000,
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "提示信息",
|
|
"example": "请求成功"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"message"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"externalDocs": {
|
|
"description": "JSON数据",
|
|
"url": "/openapi.json"
|
|
}
|
|
} |