768 lines
20 KiB
JSON
768 lines
20 KiB
JSON
{
|
||
"openapi": "3.0.1",
|
||
"info": {
|
||
"title": "默认模块",
|
||
"description": "新增跨服务虚拟机数据迁移接口,支持通过 rsync + SSH tunneluser 在两个 kvm-virtctl 之间进行虚拟机数据传输和恢复。",
|
||
"version": "1.0.0"
|
||
},
|
||
"tags": [
|
||
{
|
||
"name": "后台菜单权限管理"
|
||
},
|
||
{
|
||
"name": "后台菜单管理"
|
||
}
|
||
],
|
||
"paths": {
|
||
"/api/v1/admin/server/web_routs/permission/list": {
|
||
"get": {
|
||
"summary": "获取后台菜单权限列表",
|
||
"deprecated": false,
|
||
"description": "",
|
||
"tags": [
|
||
"后台菜单权限管理"
|
||
],
|
||
"parameters": [
|
||
{
|
||
"name": "owner_type",
|
||
"in": "query",
|
||
"description": "所属类型",
|
||
"required": false,
|
||
"schema": {
|
||
"type": "string",
|
||
"enum": [
|
||
"user",
|
||
"group"
|
||
],
|
||
"default": "group"
|
||
}
|
||
},
|
||
{
|
||
"name": "user_id",
|
||
"in": "query",
|
||
"description": "用户ID(owner_type为user时必填)",
|
||
"required": false,
|
||
"schema": {
|
||
"type": "integer"
|
||
}
|
||
},
|
||
{
|
||
"name": "admin_group_id",
|
||
"in": "query",
|
||
"description": "管理员组ID(owner_type为group时必填)",
|
||
"required": false,
|
||
"schema": {
|
||
"type": "integer"
|
||
}
|
||
},
|
||
{
|
||
"name": "Authorization",
|
||
"in": "header",
|
||
"description": "",
|
||
"example": "Bearer {{token}}",
|
||
"schema": {
|
||
"type": "string",
|
||
"default": "Bearer {{token}}"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/AdminWebRoutsPermission"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"headers": {}
|
||
}
|
||
},
|
||
"security": []
|
||
}
|
||
},
|
||
"/api/v1/admin/server/web_routs/permission/add": {
|
||
"post": {
|
||
"summary": "新增后台菜单权限",
|
||
"deprecated": false,
|
||
"description": "",
|
||
"tags": [
|
||
"后台菜单权限管理"
|
||
],
|
||
"parameters": [
|
||
{
|
||
"name": "Authorization",
|
||
"in": "header",
|
||
"description": "",
|
||
"example": "Bearer {{token}}",
|
||
"schema": {
|
||
"type": "string",
|
||
"default": "Bearer {{token}}"
|
||
}
|
||
}
|
||
],
|
||
"requestBody": {
|
||
"content": {
|
||
"multipart/form-data": {
|
||
"schema": {
|
||
"type": "object",
|
||
"properties": {
|
||
"web_routs_id": {
|
||
"type": "integer",
|
||
"description": "菜单ID",
|
||
"example": 0
|
||
},
|
||
"enable": {
|
||
"type": "boolean",
|
||
"default": true,
|
||
"description": "是否启用",
|
||
"example": "true"
|
||
},
|
||
"owner_type": {
|
||
"type": "string",
|
||
"enum": [
|
||
"user",
|
||
"group"
|
||
],
|
||
"description": "所属类型",
|
||
"example": ""
|
||
},
|
||
"admin_group_id": {
|
||
"type": "integer",
|
||
"description": "管理员组ID(owner_type为group时使用)",
|
||
"example": 0
|
||
},
|
||
"user_id": {
|
||
"type": "integer",
|
||
"description": "用户ID(owner_type为user时使用)",
|
||
"example": 0
|
||
}
|
||
},
|
||
"required": [
|
||
"web_routs_id",
|
||
"owner_type"
|
||
]
|
||
}
|
||
}
|
||
},
|
||
"required": true
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/AdminWebRoutsPermission"
|
||
}
|
||
}
|
||
},
|
||
"headers": {}
|
||
}
|
||
},
|
||
"security": []
|
||
}
|
||
},
|
||
"/api/v1/admin/server/web_routs/permission/update": {
|
||
"post": {
|
||
"summary": "修改后台菜单权限",
|
||
"deprecated": false,
|
||
"description": "",
|
||
"tags": [
|
||
"后台菜单权限管理"
|
||
],
|
||
"parameters": [
|
||
{
|
||
"name": "Authorization",
|
||
"in": "header",
|
||
"description": "",
|
||
"example": "Bearer {{token}}",
|
||
"schema": {
|
||
"type": "string",
|
||
"default": "Bearer {{token}}"
|
||
}
|
||
}
|
||
],
|
||
"requestBody": {
|
||
"content": {
|
||
"multipart/form-data": {
|
||
"schema": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"description": "权限记录ID",
|
||
"example": 0
|
||
},
|
||
"web_routs_id": {
|
||
"type": "integer",
|
||
"description": "菜单ID",
|
||
"example": 0
|
||
},
|
||
"enable": {
|
||
"type": "boolean",
|
||
"description": "是否启用",
|
||
"example": ""
|
||
},
|
||
"admin_group_id": {
|
||
"type": "integer",
|
||
"description": "管理员组ID",
|
||
"example": 0
|
||
},
|
||
"user_id": {
|
||
"type": "integer",
|
||
"description": "用户ID",
|
||
"example": 0
|
||
},
|
||
"owner_type": {
|
||
"type": "string",
|
||
"enum": [
|
||
"user",
|
||
"group"
|
||
],
|
||
"description": "所属类型",
|
||
"example": ""
|
||
}
|
||
},
|
||
"required": [
|
||
"id"
|
||
]
|
||
}
|
||
}
|
||
},
|
||
"required": true
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/AdminWebRoutsPermission"
|
||
}
|
||
}
|
||
},
|
||
"headers": {}
|
||
}
|
||
},
|
||
"security": []
|
||
}
|
||
},
|
||
"/api/v1/admin/server/web_routs/permission/delete": {
|
||
"delete": {
|
||
"summary": "删除后台菜单权限",
|
||
"deprecated": false,
|
||
"description": "",
|
||
"tags": [
|
||
"后台菜单权限管理"
|
||
],
|
||
"parameters": [
|
||
{
|
||
"name": "Authorization",
|
||
"in": "header",
|
||
"description": "",
|
||
"example": "Bearer {{token}}",
|
||
"schema": {
|
||
"type": "string",
|
||
"default": "Bearer {{token}}"
|
||
}
|
||
}
|
||
],
|
||
"requestBody": {
|
||
"content": {
|
||
"multipart/form-data": {
|
||
"schema": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"description": "权限记录ID",
|
||
"example": 0
|
||
}
|
||
},
|
||
"required": [
|
||
"id"
|
||
]
|
||
}
|
||
}
|
||
},
|
||
"required": true
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"headers": {}
|
||
}
|
||
},
|
||
"security": []
|
||
}
|
||
},
|
||
"/api/v1/admin/server/web_routs/my": {
|
||
"get": {
|
||
"summary": "获取当前用户的后台菜单权限树",
|
||
"deprecated": false,
|
||
"description": "自动读取当前用户的 user_id 与 AdminGroupId,合并用户级与管理员组级菜单权限,返回完整的菜单树形结构。每个菜单节点包含 enable 状态,用户级权限优先于管理员组级权限。",
|
||
"tags": [
|
||
"后台菜单权限管理"
|
||
],
|
||
"parameters": [
|
||
{
|
||
"name": "Authorization",
|
||
"in": "header",
|
||
"description": "",
|
||
"example": "Bearer {{token}}",
|
||
"schema": {
|
||
"type": "string",
|
||
"default": "Bearer {{token}}"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/WebRoutsWithPermission"
|
||
}
|
||
},
|
||
"example": {
|
||
"id": 1,
|
||
"path": "/dashboard",
|
||
"title": "仪表盘",
|
||
"icon": "dashboard",
|
||
"parentId": null,
|
||
"enable": true,
|
||
"children": [
|
||
{
|
||
"id": 2,
|
||
"path": "/dashboard/overview",
|
||
"title": "概览",
|
||
"icon": "overview",
|
||
"parentId": 1,
|
||
"enable": true,
|
||
"children": []
|
||
}
|
||
]
|
||
}
|
||
}
|
||
},
|
||
"headers": {}
|
||
}
|
||
},
|
||
"security": []
|
||
}
|
||
},
|
||
"/api/v1/admin/server/web_routs/list": {
|
||
"get": {
|
||
"summary": "获取后台菜单列表",
|
||
"deprecated": false,
|
||
"description": "",
|
||
"tags": [
|
||
"后台菜单管理"
|
||
],
|
||
"parameters": [
|
||
{
|
||
"name": "page",
|
||
"in": "query",
|
||
"description": "页码",
|
||
"required": false,
|
||
"schema": {
|
||
"type": "integer",
|
||
"default": 1
|
||
}
|
||
},
|
||
{
|
||
"name": "count",
|
||
"in": "query",
|
||
"description": "每页数量",
|
||
"required": false,
|
||
"schema": {
|
||
"type": "integer",
|
||
"default": 10
|
||
}
|
||
},
|
||
{
|
||
"name": "key",
|
||
"in": "query",
|
||
"description": "搜索关键字(匹配标题或路径)",
|
||
"required": false,
|
||
"schema": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
{
|
||
"name": "parent_id",
|
||
"in": "query",
|
||
"description": "父级菜单ID,不传则获取顶级菜单",
|
||
"required": false,
|
||
"schema": {
|
||
"type": "integer"
|
||
}
|
||
},
|
||
{
|
||
"name": "Authorization",
|
||
"in": "header",
|
||
"description": "",
|
||
"example": "Bearer {{token}}",
|
||
"schema": {
|
||
"type": "string",
|
||
"default": "Bearer {{token}}"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"type": "object",
|
||
"properties": {
|
||
"list": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/AdminWebRouts"
|
||
}
|
||
},
|
||
"all_count": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"headers": {}
|
||
}
|
||
},
|
||
"security": []
|
||
}
|
||
},
|
||
"/api/v1/admin/server/web_routs/add": {
|
||
"post": {
|
||
"summary": "新增后台菜单",
|
||
"deprecated": false,
|
||
"description": "",
|
||
"tags": [
|
||
"后台菜单管理"
|
||
],
|
||
"parameters": [
|
||
{
|
||
"name": "Authorization",
|
||
"in": "header",
|
||
"description": "",
|
||
"example": "Bearer {{token}}",
|
||
"schema": {
|
||
"type": "string",
|
||
"default": "Bearer {{token}}"
|
||
}
|
||
}
|
||
],
|
||
"requestBody": {
|
||
"content": {
|
||
"multipart/form-data": {
|
||
"schema": {
|
||
"type": "object",
|
||
"properties": {
|
||
"path": {
|
||
"type": "string",
|
||
"description": "菜单路径",
|
||
"example": ""
|
||
},
|
||
"title": {
|
||
"type": "string",
|
||
"description": "菜单名称",
|
||
"example": ""
|
||
},
|
||
"icon": {
|
||
"type": "string",
|
||
"description": "菜单图标",
|
||
"example": ""
|
||
},
|
||
"parent_id": {
|
||
"type": "integer",
|
||
"description": "父级菜单ID",
|
||
"example": 0
|
||
}
|
||
},
|
||
"required": [
|
||
"path",
|
||
"title",
|
||
"icon"
|
||
]
|
||
}
|
||
}
|
||
},
|
||
"required": true
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/AdminWebRouts"
|
||
}
|
||
}
|
||
},
|
||
"headers": {}
|
||
}
|
||
},
|
||
"security": []
|
||
}
|
||
},
|
||
"/api/v1/admin/server/web_routs/update": {
|
||
"post": {
|
||
"summary": "修改后台菜单",
|
||
"deprecated": false,
|
||
"description": "",
|
||
"tags": [
|
||
"后台菜单管理"
|
||
],
|
||
"parameters": [
|
||
{
|
||
"name": "Authorization",
|
||
"in": "header",
|
||
"description": "",
|
||
"example": "Bearer {{token}}",
|
||
"schema": {
|
||
"type": "string",
|
||
"default": "Bearer {{token}}"
|
||
}
|
||
}
|
||
],
|
||
"requestBody": {
|
||
"content": {
|
||
"multipart/form-data": {
|
||
"schema": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"description": "菜单ID",
|
||
"example": 0
|
||
},
|
||
"path": {
|
||
"type": "string",
|
||
"description": "菜单路径",
|
||
"example": ""
|
||
},
|
||
"title": {
|
||
"type": "string",
|
||
"description": "菜单名称",
|
||
"example": ""
|
||
},
|
||
"icon": {
|
||
"type": "string",
|
||
"description": "菜单图标",
|
||
"example": ""
|
||
},
|
||
"parent_id": {
|
||
"type": "integer",
|
||
"description": "父级菜单ID",
|
||
"example": 0
|
||
}
|
||
},
|
||
"required": [
|
||
"id"
|
||
]
|
||
}
|
||
}
|
||
},
|
||
"required": true
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/AdminWebRouts"
|
||
}
|
||
}
|
||
},
|
||
"headers": {}
|
||
}
|
||
},
|
||
"security": []
|
||
}
|
||
},
|
||
"/api/v1/admin/server/web_routs/delete": {
|
||
"delete": {
|
||
"summary": "删除后台菜单",
|
||
"deprecated": false,
|
||
"description": "",
|
||
"tags": [
|
||
"后台菜单管理"
|
||
],
|
||
"parameters": [
|
||
{
|
||
"name": "Authorization",
|
||
"in": "header",
|
||
"description": "",
|
||
"example": "Bearer {{token}}",
|
||
"schema": {
|
||
"type": "string",
|
||
"default": "Bearer {{token}}"
|
||
}
|
||
}
|
||
],
|
||
"requestBody": {
|
||
"content": {
|
||
"multipart/form-data": {
|
||
"schema": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"description": "菜单ID",
|
||
"example": 0
|
||
}
|
||
},
|
||
"required": [
|
||
"id"
|
||
]
|
||
}
|
||
}
|
||
},
|
||
"required": true
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"headers": {}
|
||
}
|
||
},
|
||
"security": []
|
||
}
|
||
}
|
||
},
|
||
"components": {
|
||
"schemas": {
|
||
"AdminWebRouts": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"path": {
|
||
"type": "string",
|
||
"description": "菜单路径"
|
||
},
|
||
"title": {
|
||
"type": "string",
|
||
"description": "菜单名称"
|
||
},
|
||
"icon": {
|
||
"type": "string",
|
||
"description": "菜单图标"
|
||
},
|
||
"parentId": {
|
||
"type": "integer",
|
||
"description": "父级菜单ID",
|
||
"nullable": true
|
||
},
|
||
"children": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/AdminWebRouts"
|
||
},
|
||
"description": "子菜单列表"
|
||
},
|
||
"CreatedAt": {
|
||
"type": "string",
|
||
"format": "date-time"
|
||
},
|
||
"UpdatedAt": {
|
||
"type": "string",
|
||
"format": "date-time"
|
||
}
|
||
}
|
||
},
|
||
"WebRoutsWithPermission": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer",
|
||
"description": "菜单ID"
|
||
},
|
||
"path": {
|
||
"type": "string",
|
||
"description": "菜单路径"
|
||
},
|
||
"title": {
|
||
"type": "string",
|
||
"description": "菜单名称"
|
||
},
|
||
"icon": {
|
||
"type": "string",
|
||
"description": "菜单图标"
|
||
},
|
||
"parentId": {
|
||
"type": "integer",
|
||
"description": "父级菜单ID",
|
||
"nullable": true
|
||
},
|
||
"enable": {
|
||
"type": "boolean",
|
||
"description": "是否启用(合并用户级与管理员组级权限后的结果,用户级优先)"
|
||
},
|
||
"children": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/WebRoutsWithPermission"
|
||
},
|
||
"description": "子菜单列表"
|
||
}
|
||
}
|
||
},
|
||
"AdminWebRoutsPermission": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"webRoutsId": {
|
||
"type": "integer",
|
||
"description": "菜单ID"
|
||
},
|
||
"webRouts": {
|
||
"$ref": "#/components/schemas/AdminWebRouts"
|
||
},
|
||
"enable": {
|
||
"type": "boolean",
|
||
"description": "是否启用"
|
||
},
|
||
"adminGroupId": {
|
||
"type": "integer",
|
||
"description": "管理员组ID",
|
||
"nullable": true
|
||
},
|
||
"userId": {
|
||
"type": "integer",
|
||
"description": "用户ID",
|
||
"nullable": true
|
||
},
|
||
"CreatedAt": {
|
||
"type": "string",
|
||
"format": "date-time"
|
||
},
|
||
"UpdatedAt": {
|
||
"type": "string",
|
||
"format": "date-time"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {},
|
||
"securitySchemes": {}
|
||
},
|
||
"servers": [],
|
||
"security": []
|
||
} |