{ "schemes": [ "http", "https" ], "swagger": "2.0", "info": { "description": "一键虚拟化管理平台API接口文档", "title": "OneClickVirt API", "termsOfService": "http://swagger.io/terms/", "contact": { "name": "API Support", "url": "http://www.swagger.io/support", "email": "support@swagger.io" }, "license": { "name": "MIT", "url": "https://opensource.org/licenses/MIT" }, "version": "1.0" }, "host": "0.0.0.0:8888", "basePath": "/api/v1", "paths": { "/admin/announcements": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取系统公告列表(分页)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取公告列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员创建新公告", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "创建公告", "parameters": [ { "description": "创建公告请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.CreateAnnouncementRequest" } } ], "responses": { "200": { "description": "创建成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/announcements/batch-delete": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "管理员批量删除公告", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "批量删除公告", "parameters": [ { "description": "批量操作请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.BatchAnnouncementRequest" } } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "删除失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/announcements/batch-status": { "put": { "security": [ { "BearerAuth": [] } ], "description": "管理员批量更新公告状态", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "批量更新公告状态", "parameters": [ { "description": "批量状态更新请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.BatchUpdateStatusRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/announcements/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "description": "管理员更新公告信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "更新公告", "parameters": [ { "type": "integer", "description": "公告ID", "name": "id", "in": "path", "required": true }, { "description": "更新公告请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.UpdateAnnouncementRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "管理员删除公告", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "删除公告", "parameters": [ { "type": "integer", "description": "公告ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "删除失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/configuration-tasks": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取配置任务列表,支持分页和筛选", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取配置任务列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "页大小", "name": "pageSize", "in": "query" }, { "type": "integer", "description": "Provider ID", "name": "providerId", "in": "query" }, { "type": "string", "description": "任务类型", "name": "taskType", "in": "query" }, { "type": "string", "description": "任务状态", "name": "status", "in": "query" }, { "type": "integer", "description": "执行者ID", "name": "executorId", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.ConfigurationTaskListResponse" } } } ] } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/configuration-tasks/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取指定配置任务的详细信息,包括完整日志", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取配置任务详情", "parameters": [ { "type": "integer", "description": "任务ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.ConfigurationTaskDetailResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "任务不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/configuration-tasks/{id}/cancel": { "post": { "security": [ { "BearerAuth": [] } ], "description": "取消正在运行的配置任务", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "取消配置任务", "parameters": [ { "type": "integer", "description": "任务ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "取消成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "任务不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "取消失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/dashboard": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取管理员后台首页的统计数据", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取管理员仪表板", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/database/stats": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "获取详细的数据库连接池统计信息", "produces": [ "application/json" ], "tags": [ "Health" ], "summary": "数据库统计信息", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": true } } } ] } } } } }, "/admin/instance-type-permissions": { "get": { "security": [ { "BearerAuth": [] } ], "description": "管理员获取实例类型最低等级要求配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取实例类型权限配置", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "管理员更新实例类型最低等级要求配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "更新实例类型权限配置", "parameters": [ { "description": "权限配置参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.UpdateInstanceTypePermissionsRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances": { "get": { "security": [ { "BearerAuth": [] } ], "description": "管理员获取系统中所有实例的列表,支持分页和过滤", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取实例列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" }, { "type": "string", "description": "实例状态", "name": "status", "in": "query" }, { "type": "string", "description": "节点名称", "name": "providerName", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员创建新的虚拟化实例", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "创建实例", "parameters": [ { "description": "创建实例请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.CreateInstanceRequest" } } ], "responses": { "200": { "description": "创建成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances/{id}/action": { "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员对实例执行启动、停止、重启等操作", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员执行实例操作", "parameters": [ { "type": "string", "description": "实例ID", "name": "id", "in": "path", "required": true }, { "description": "操作请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.InstanceActionRequest" } } ], "responses": { "200": { "description": "操作成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "实例不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances/{id}/password/{taskId}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "通过任务ID获取实例重置后的新密码", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员获取实例重置后的新密码", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "任务ID", "name": "taskId", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.GetInstancePasswordResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "实例或任务不存在", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances/{id}/port-mappings": { "get": { "security": [ { "BearerAuth": [] } ], "description": "管理员获取指定实例的所有端口映射", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "端口映射管理" ], "summary": "获取实例端口映射", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances/{id}/reset-password": { "put": { "security": [ { "BearerAuth": [] } ], "description": "管理员重置指定实例的登录密码,创建异步任务执行密码重置操作", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员重置实例密码", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true }, { "description": "重置实例密码请求参数(可为空对象)", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.ResetInstancePasswordRequest" } } ], "responses": { "200": { "description": "任务创建成功,返回任务ID", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.ResetInstancePasswordResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "实例不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建任务失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/invite-codes": { "get": { "security": [ { "BearerAuth": [] } ], "description": "管理员获取系统中的邀请码列表,支持分页和查询", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "邀请码管理" ], "summary": "获取邀请码列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" }, { "type": "string", "description": "搜索关键字", "name": "keyword", "in": "query" }, { "type": "string", "description": "状态筛选", "name": "status", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员创建新的邀请码", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "邀请码管理" ], "summary": "创建邀请码", "parameters": [ { "description": "创建邀请码请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.CreateInviteCodeRequest" } } ], "responses": { "200": { "description": "创建成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/invite-codes/batch-delete": { "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员批量删除指定的邀请码", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "邀请码管理" ], "summary": "批量删除邀请码", "parameters": [ { "description": "批量删除邀请码请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.BatchDeleteInviteCodesRequest" } } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/invite-codes/export": { "get": { "security": [ { "BearerAuth": [] } ], "description": "导出选中的邀请码为文本格式(每行一个)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "邀请码管理" ], "summary": "导出邀请码", "parameters": [ { "type": "array", "items": { "type": "integer" }, "collectionFormat": "csv", "description": "邀请码ID列表,不传则导出全部", "name": "ids", "in": "query" } ], "responses": { "200": { "description": "导出成功,返回邀请码列表", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "string" } } } } ] } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/invite-codes/generate": { "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员批量生成邀请码,可指定数量和权限等级", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "邀请码管理" ], "summary": "批量生成邀请码", "parameters": [ { "description": "生成邀请码请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.CreateInviteCodeRequest" } } ], "responses": { "200": { "description": "生成成功,返回邀请码列表", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "string" } } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/invite-codes/{id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "管理员删除指定的邀请码", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "邀请码管理" ], "summary": "删除邀请码", "parameters": [ { "type": "integer", "description": "邀请码ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/monitoring/health": { "get": { "security": [ { "BearerAuth": [] } ], "description": "检查各个组件的健康状态", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统监控" ], "summary": "获取系统健康检查", "responses": { "200": { "description": "检查成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "401": { "description": "认证失败", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "检查失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/monitoring/metrics": { "get": { "security": [ { "BearerAuth": [] } ], "description": "返回Prometheus格式的系统监控指标,用于监控系统集成", "consumes": [ "application/json" ], "produces": [ "text/plain" ], "tags": [ "系统监控" ], "summary": "获取Prometheus格式的指标", "responses": { "200": { "description": "Prometheus指标数据", "schema": { "type": "string" } }, "401": { "description": "认证失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/monitoring/provider": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取节点的监控和性能数据", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统监控" ], "summary": "获取节点监控数据", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } } } } }, "/admin/monitoring/system": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取服务器的CPU、内存、磁盘、网络等系统资源使用情况", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统监控" ], "summary": "获取系统统计信息", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/system.SystemStats" } } } ] } }, "401": { "description": "认证失败", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/port-mappings": { "get": { "security": [ { "BearerAuth": [] } ], "description": "管理员获取端口映射列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "端口映射管理" ], "summary": "获取端口映射列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" }, { "type": "integer", "description": "Provider ID", "name": "providerId", "in": "query" }, { "type": "integer", "description": "实例ID", "name": "instanceId", "in": "query" }, { "type": "string", "description": "协议类型", "name": "protocol", "in": "query" }, { "type": "string", "description": "状态", "name": "status", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员创建新的端口映射(异步执行)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "端口映射管理" ], "summary": "创建端口映射", "parameters": [ { "description": "创建端口映射请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.CreatePortMappingRequest" } } ], "responses": { "200": { "description": "创建成功,返回任务ID", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/port-mappings/batch-delete": { "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员批量删除端口映射(仅支持删除手动添加的端口,区间映射的端口不能删除)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "端口映射管理" ], "summary": "批量删除端口映射", "parameters": [ { "description": "批量删除端口映射请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.BatchDeletePortMappingRequest" } } ], "responses": { "200": { "description": "删除任务已创建", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建任务失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/port-mappings/{id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "管理员删除端口映射(仅支持删除手动添加的端口,区间映射的端口不能删除)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "端口映射管理" ], "summary": "删除端口映射", "parameters": [ { "type": "integer", "description": "端口映射ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除任务已创建", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建任务失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/provider": { "get": { "security": [ { "BearerAuth": [] } ], "description": "管理员获取系统中的虚拟化提供商列表,支持分页和查询", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "提供商管理" ], "summary": "获取提供商列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" }, { "type": "string", "description": "搜索关键字", "name": "keyword", "in": "query" }, { "type": "string", "description": "提供商类型筛选", "name": "type", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员创建新的虚拟化提供商配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "提供商管理" ], "summary": "创建提供商", "parameters": [ { "description": "创建提供商请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.CreateProviderRequest" } } ], "responses": { "200": { "description": "创建成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/provider/auto-configure": { "post": { "security": [ { "BearerAuth": [] } ], "description": "自动配置Provider,支持检查历史记录和防重复执行", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "自动配置Provider", "parameters": [ { "description": "自动配置请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.AutoConfigureRequest" } } ], "responses": { "200": { "description": "配置响应", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.AutoConfigureResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "配置失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/provider/export-configs": { "post": { "security": [ { "BearerAuth": [] } ], "description": "导出所有已配置的Provider认证信息到文件", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "导出所有Provider配置", "responses": { "200": { "description": "导出成功", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "导出失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/provider/{id}/auto-configure-stream": { "post": { "security": [ { "BearerAuth": [] } ], "description": "使用Server-Sent Events实时显示配置过程和输出", "consumes": [ "application/json" ], "produces": [ "text/plain" ], "tags": [ "管理员管理" ], "summary": "实时自动配置Provider", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "实时配置输出", "schema": { "type": "string" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "配置失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/provider/{id}/generate-cert": { "post": { "security": [ { "BearerAuth": [] } ], "description": "为LXD/Incus Provider生成客户端证书和设置脚本,为Proxmox VE生成API Token配置脚本", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "为Provider生成证书或配置", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "生成成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "生成失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/provider/{id}/health-check": { "post": { "security": [ { "BearerAuth": [] } ], "description": "检查Provider的API和SSH连接状态", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "检查Provider健康状态", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "检查成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.ProviderStatusResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "检查失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/provider/{id}/port-config": { "put": { "security": [ { "BearerAuth": [] } ], "description": "管理员更新Provider的端口映射配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "端口映射管理" ], "summary": "更新Provider端口配置", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true }, { "description": "Provider端口配置请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.ProviderPortConfigRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/provider/{id}/port-usage": { "get": { "security": [ { "BearerAuth": [] } ], "description": "管理员获取Provider的端口使用统计", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "端口映射管理" ], "summary": "获取Provider端口使用情况", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/provider/{id}/status": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取Provider的详细状态信息,包括证书信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取Provider状态详情", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.ProviderStatusResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/test-ssh-connection": { "post": { "security": [ { "BearerAuth": [] } ], "description": "测试SSH连接延迟,执行多次测试并返回最小、最大、平均延迟及推荐超时时间", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "提供商管理" ], "summary": "测试SSH连接延迟", "parameters": [ { "description": "测试SSH连接请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.TestSSHConnectionRequest" } } ], "responses": { "200": { "description": "测试成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.TestSSHConnectionResponse" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "测试失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/system-images": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取系统镜像列表,支持分页和过滤条件", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统镜像管理" ], "summary": "获取系统镜像列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" }, { "enum": [ "proxmox", "lxd", "incus", "docker" ], "type": "string", "description": "提供商类型", "name": "providerType", "in": "query" }, { "enum": [ "vm", "container" ], "type": "string", "description": "实例类型", "name": "instanceType", "in": "query" }, { "enum": [ "amd64", "arm64", "s390x" ], "type": "string", "description": "架构", "name": "architecture", "in": "query" }, { "enum": [ "active", "inactive" ], "type": "string", "description": "状态", "name": "status", "in": "query" }, { "type": "string", "description": "搜索关键字", "name": "search", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "创建新的系统镜像配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统镜像管理" ], "summary": "创建系统镜像", "parameters": [ { "description": "创建系统镜像请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/system.CreateSystemImageRequest" } } ], "responses": { "200": { "description": "创建成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "认证失败", "schema": { "$ref": "#/definitions/common.Response" } }, "409": { "description": "镜像名称已存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/tasks": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取所有用户的任务列表,支持分页和筛选", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取管理员任务列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "页大小", "name": "pageSize", "in": "query" }, { "type": "integer", "description": "Provider ID", "name": "providerId", "in": "query" }, { "type": "string", "description": "用户名", "name": "username", "in": "query" }, { "type": "string", "description": "任务类型", "name": "taskType", "in": "query" }, { "type": "string", "description": "任务状态", "name": "status", "in": "query" }, { "type": "string", "description": "实例类型", "name": "instanceType", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.AdminTaskListResponse" } } } ] } }, "401": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/tasks/force-stop": { "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员强制停止运行中的任务", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "强制停止任务", "parameters": [ { "description": "强制停止任务请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.ForceStopTaskRequest" } } ], "responses": { "200": { "description": "操作成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "操作失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/tasks/overall-stats": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取所有任务的总体统计信息,包括各种状态的任务数量", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取任务总体统计信息", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.TaskStatsResponse" } } } ] } }, "401": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/tasks/stats": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取系统任务统计信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取任务统计", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.TaskStatsResponse" } } } ] } }, "401": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/tasks/{taskId}/cancel": { "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员取消指定用户的任务", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员取消用户任务", "parameters": [ { "type": "integer", "description": "任务ID", "name": "taskId", "in": "path", "required": true } ], "responses": { "200": { "description": "操作成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "操作失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/traffic/sync/all": { "post": { "security": [ { "BearerAuth": [] } ], "description": "立即触发全系统所有实例的流量数据同步", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员-流量同步" ], "summary": "手动同步全系统流量数据", "responses": { "200": { "description": "同步成功", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "未认证", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/traffic/sync/instance/{instance_id}": { "post": { "security": [ { "BearerAuth": [] } ], "description": "立即触发指定实例的流量数据同步", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员-流量同步" ], "summary": "手动同步单个实例的流量数据", "parameters": [ { "type": "integer", "description": "实例ID", "name": "instance_id", "in": "path", "required": true } ], "responses": { "200": { "description": "同步成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "未认证", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/traffic/sync/provider/{provider_id}": { "post": { "security": [ { "BearerAuth": [] } ], "description": "立即触发指定Provider所有实例的流量数据同步", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员-流量同步" ], "summary": "手动同步Provider所有实例的流量数据", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "provider_id", "in": "path", "required": true } ], "responses": { "200": { "description": "同步成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "未认证", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/traffic/sync/user/{user_id}": { "post": { "security": [ { "BearerAuth": [] } ], "description": "立即触发指定用户所有实例的流量数据同步", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员-流量同步" ], "summary": "手动同步用户所有实例的流量数据", "parameters": [ { "type": "integer", "description": "用户ID", "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { "description": "同步成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "未认证", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/users": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取系统中所有用户的列表(分页)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取用户列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" }, { "type": "string", "description": "用户名搜索", "name": "username", "in": "query" }, { "type": "string", "description": "邮箱搜索", "name": "email", "in": "query" }, { "type": "string", "description": "用户状态", "name": "status", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员创建新用户账户", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "创建用户", "parameters": [ { "description": "创建用户请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.CreateUserRequest" } } ], "responses": { "200": { "description": "创建成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/users/batch-delete": { "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员批量删除用户", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员批量删除用户", "parameters": [ { "description": "批量删除用户请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.BatchDeleteUsersRequest" } } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "删除失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/users/batch-level": { "put": { "security": [ { "BearerAuth": [] } ], "description": "管理员批量更新多个用户的等级", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "批量更新用户等级", "parameters": [ { "description": "批量更新用户等级请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.BatchUpdateUserLevelRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/users/batch-status": { "put": { "security": [ { "BearerAuth": [] } ], "description": "管理员批量更新用户状态(启用/禁用)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员批量更新用户状态", "parameters": [ { "description": "批量更新用户状态请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.BatchUpdateUserStatusRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/users/{id}/level": { "put": { "security": [ { "BearerAuth": [] } ], "description": "管理员更新指定用户的等级", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "更新用户等级", "parameters": [ { "type": "integer", "description": "用户ID", "name": "id", "in": "path", "required": true }, { "description": "更新用户等级请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.UpdateUserLevelRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/users/{id}/reset-password": { "put": { "security": [ { "BearerAuth": [] } ], "description": "管理员强制重置指定用户的登录密码,系统自动生成符合安全策略的新密码", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员强制重置用户密码", "parameters": [ { "type": "integer", "description": "用户ID", "name": "id", "in": "path", "required": true }, { "description": "重置密码请求参数(可为空对象)", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.ResetUserPasswordRequest" } } ], "responses": { "200": { "description": "重置成功,返回新密码", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.ResetUserPasswordResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "用户不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "重置失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/users/{id}/reset-password-notify": { "put": { "security": [ { "BearerAuth": [] } ], "description": "管理员重置指定用户的登录密码,系统自动生成符合安全策略的新密码并发送到用户绑定的通信渠道", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员重置用户密码并发送到用户通信渠道", "parameters": [ { "type": "integer", "description": "用户ID", "name": "id", "in": "path", "required": true }, { "description": "重置密码请求参数(可为空对象)", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.ResetUserPasswordRequest" } } ], "responses": { "200": { "description": "重置成功,新密码已发送到用户绑定的通信渠道", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "用户不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "重置失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/users/{id}/status": { "put": { "security": [ { "BearerAuth": [] } ], "description": "管理员更新用户状态(启用/禁用)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "更新用户状态", "parameters": [ { "type": "integer", "description": "用户ID", "name": "id", "in": "path", "required": true }, { "description": "更新用户状态请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.UpdateUserStatusRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/api/v1/admin/logs/cleanup": { "post": { "security": [ { "BearerAuth": [] } ], "description": "根据配置的保留天数清理旧的日志文件", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "System" ], "summary": "清理旧日志文件", "responses": { "200": { "description": "success", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/api/v1/admin/logs/compress": { "post": { "security": [ { "BearerAuth": [] } ], "description": "压缩昨天之前的日志文件以节省存储空间", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "System" ], "summary": "压缩旧日志文件", "responses": { "200": { "description": "success", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/api/v1/admin/logs/files": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取所有日志文件的信息,包括按日期分割的日志文件", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "System" ], "summary": "获取日志文件列表", "responses": { "200": { "description": "success", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/log.LogFileInfo" } } } } ] } } } } }, "/api/v1/admin/logs/read": { "get": { "security": [ { "BearerAuth": [] } ], "description": "读取指定日志文件的内容,支持指定返回行数", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "System" ], "summary": "读取日志文件内容", "parameters": [ { "type": "string", "description": "日志文件名", "name": "filename", "in": "query", "required": true }, { "type": "integer", "description": "返回行数,默认100行", "name": "lines", "in": "query" } ], "responses": { "200": { "description": "success", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "string" } } } } ] } } } } }, "/api/v1/admin/monitoring/audit-logs": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取用户操作审计日志", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取操作审计日志", "parameters": [ { "type": "integer", "description": "用户ID", "name": "user_id", "in": "query" }, { "type": "string", "description": "操作类型", "name": "action", "in": "query" }, { "type": "string", "description": "开始时间", "name": "start_time", "in": "query" }, { "type": "string", "description": "结束时间", "name": "end_time", "in": "query" }, { "type": "integer", "default": 100, "description": "返回条数", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "偏移量", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object" } } } } ] } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/api/v1/admin/monitoring/logs": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取系统运行日志", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "监控管理" ], "summary": "获取系统日志", "parameters": [ { "enum": [ "info", "warn", "error", "debug" ], "type": "string", "description": "日志级别", "name": "level", "in": "query" }, { "type": "integer", "default": 100, "description": "返回条数", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "偏移量", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object" } } } } ] } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/api/v1/admin/storage/cleanup": { "post": { "security": [ { "BearerAuth": [] } ], "description": "清理临时目录中的所有文件", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "System" ], "summary": "清理临时文件", "responses": { "200": { "description": "success", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/api/v1/admin/storage/info": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取存储目录结构和状态信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "System" ], "summary": "获取存储目录信息", "responses": { "200": { "description": "success", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": true } } } ] } } } } }, "/api/v1/admin/storage/init": { "post": { "security": [ { "BearerAuth": [] } ], "description": "重新创建所有必要的存储目录", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "System" ], "summary": "重新初始化存储目录", "responses": { "200": { "description": "success", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/api/v1/admin/traffic/batch-manage": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "批量设置或解除用户的流量限制", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员流量" ], "summary": "批量管理流量限制", "parameters": [ { "description": "批量流量限制管理请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/traffic.BatchManageTrafficLimitRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/api/v1/admin/traffic/batch-sync": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "批量触发用户流量数据同步", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员流量" ], "summary": "批量同步用户流量", "parameters": [ { "description": "批量同步流量请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/traffic.BatchSyncTrafficRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/api/v1/admin/traffic/manage": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "手动设置或解除用户/Provider的流量限制", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员流量" ], "summary": "管理流量限制", "parameters": [ { "description": "流量限制管理请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/traffic.ManageTrafficLimitRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/api/v1/admin/traffic/overview": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "获取整个系统的流量使用情况概览", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员流量" ], "summary": "获取系统流量概览", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/api/v1/admin/traffic/provider/{providerId}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "获取指定Provider的流量使用情况", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员流量" ], "summary": "获取Provider流量统计", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "providerId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/api/v1/admin/traffic/user/{userId}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "获取指定用户的流量使用情况", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员流量" ], "summary": "获取用户流量统计", "parameters": [ { "type": "integer", "description": "用户ID", "name": "userId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/api/v1/admin/traffic/users/rank": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "获取系统中所有用户的流量使用排行榜,支持分页和搜索", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员流量" ], "summary": "获取用户流量排行榜", "parameters": [ { "type": "integer", "description": "页码,默认1", "name": "page", "in": "query" }, { "type": "integer", "description": "每页数量,默认10", "name": "pageSize", "in": "query" }, { "type": "string", "description": "按用户名搜索", "name": "username", "in": "query" }, { "type": "string", "description": "按昵称搜索", "name": "nickname", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/api/v1/user/traffic/instance/{instanceId}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "获取指定实例的详细流量统计信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户流量" ], "summary": "获取实例流量详情", "parameters": [ { "type": "integer", "description": "实例ID", "name": "instanceId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/api/v1/user/traffic/instances": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "获取用户所有实例的流量使用汇总信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户流量" ], "summary": "获取用户所有实例流量汇总", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/api/v1/user/traffic/limit-status": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "获取用户的流量限制状态和受限实例信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户流量" ], "summary": "获取流量限制状态", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/api/v1/user/traffic/overview": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "基于vnStat获取用户流量使用情况概览", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户流量" ], "summary": "获取用户流量概览", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/api/v1/user/traffic/vnstat/{instanceId}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "获取指定实例的原始vnStat统计数据", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户流量" ], "summary": "获取原始vnStat数据", "parameters": [ { "type": "integer", "description": "实例ID", "name": "instanceId", "in": "path", "required": true }, { "type": "string", "description": "网络接口名称", "name": "interface", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/auth/captcha": { "get": { "description": "生成图片验证码用于用户验证", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "认证管理" ], "summary": "获取验证码", "parameters": [ { "type": "integer", "default": 120, "description": "验证码宽度", "name": "width", "in": "query" }, { "type": "integer", "default": 40, "description": "验证码高度", "name": "height", "in": "query" } ], "responses": { "200": { "description": "验证码生成成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/auth/forgot-password": { "post": { "description": "发送密码重置邮件", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "认证管理" ], "summary": "忘记密码", "parameters": [ { "description": "忘记密码请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/auth.ForgotPasswordRequest" } } ], "responses": { "200": { "description": "重置邮件发送成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/auth/login": { "post": { "description": "用户登录接口,验证用户名密码并返回JWT token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "认证管理" ], "summary": "用户登录", "parameters": [ { "description": "登录请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/auth.LoginRequest" } } ], "responses": { "200": { "description": "登录成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "认证失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/auth/logout": { "post": { "security": [ { "BearerAuth": [] } ], "description": "撤销当前用户的JWT token并登出", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "认证管理" ], "summary": "用户登出", "responses": { "200": { "description": "登出成功", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未认证", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/auth/oauth2/callback": { "get": { "description": "处理OAuth2提供商的回调", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "认证" ], "summary": "OAuth2回调", "parameters": [ { "type": "string", "description": "授权码", "name": "code", "in": "query", "required": true }, { "type": "string", "description": "状态令牌", "name": "state", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": true } } } ] } } } } }, "/auth/oauth2/login": { "get": { "description": "跳转到OAuth2提供商的授权页面", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "认证" ], "summary": "OAuth2登录", "parameters": [ { "type": "string", "description": "提供商名称(如linuxdo)", "name": "provider", "in": "query" }, { "type": "integer", "description": "提供商ID", "name": "provider_id", "in": "query" } ], "responses": { "302": { "description": "重定向到OAuth2授权页面", "schema": { "type": "string" } } } } }, "/auth/register": { "post": { "description": "创建新用户账户", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "认证管理" ], "summary": "用户注册", "parameters": [ { "description": "注册请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/auth.RegisterRequest" } } ], "responses": { "200": { "description": "注册成功,返回用户信息和token", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "请求参数错误或注册失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/auth/reset-password": { "post": { "description": "使用重置令牌自动生成新密码并通过用户绑定的通信渠道发送", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "认证管理" ], "summary": "重置密码", "parameters": [ { "description": "重置密码请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/auth.ResetPasswordRequest" } } ], "responses": { "200": { "description": "密码重置成功,新密码已发送到绑定的通信渠道", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/auth/send-verify-code": { "post": { "description": "向指定的邮箱/Telegram/QQ发送登录验证码", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "认证管理" ], "summary": "发送验证码", "parameters": [ { "description": "发送验证码请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/auth.SendVerifyCodeRequest" } } ], "responses": { "200": { "description": "验证码发送成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/config": { "get": { "security": [ { "BearerAuth": [] } ], "description": "根据用户权限返回相应的配置信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "配置管理" ], "summary": "获取系统配置", "parameters": [ { "enum": [ "public", "user", "admin" ], "type": "string", "default": "user", "description": "配置范围", "name": "scope", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": {} } } ] } }, "401": { "description": "认证失败", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "根据用户权限更新相应的配置信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "配置管理" ], "summary": "更新系统配置", "parameters": [ { "description": "配置更新请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/config.UnifiedConfigRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "认证失败", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/dashboard/stats": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取系统总体统计信息,包括用户数、实例数等", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "仪表板" ], "summary": "获取仪表板统计数据", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/health": { "get": { "description": "检查数据库连接和系统状态", "produces": [ "application/json" ], "tags": [ "Health" ], "summary": "系统健康检查", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": true } } } ] } } } } }, "/oauth2/providers": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取所有OAuth2提供商(包括禁用的)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "OAuth2" ], "summary": "获取OAuth2提供商列表", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/oauth2.OAuth2Provider" } } } } ] } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "创建新的OAuth2提供商配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "OAuth2" ], "summary": "创建OAuth2提供商", "parameters": [ { "description": "提供商配置", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/oauth2.CreateProviderRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/oauth2.OAuth2Provider" } } } ] } } } } }, "/oauth2/providers/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取指定OAuth2提供商的详细信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "OAuth2" ], "summary": "获取OAuth2提供商详情", "parameters": [ { "type": "integer", "description": "提供商ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/oauth2.OAuth2Provider" } } } ] } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "更新OAuth2提供商配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "OAuth2" ], "summary": "更新OAuth2提供商", "parameters": [ { "type": "integer", "description": "提供商ID", "name": "id", "in": "path", "required": true }, { "description": "更新内容", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/oauth2.UpdateProviderRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "删除OAuth2提供商(如有用户使用则无法删除)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "OAuth2" ], "summary": "删除OAuth2提供商", "parameters": [ { "type": "integer", "description": "提供商ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/oauth2/providers/{id}/reset-count": { "post": { "security": [ { "BearerAuth": [] } ], "description": "重置OAuth2提供商的注册计数", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "OAuth2" ], "summary": "重置注册计数", "parameters": [ { "type": "integer", "description": "提供商ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/provider/": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取系统中配置的所有虚拟化提供者", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "虚拟化管理" ], "summary": "获取所有Provider", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object" } } } } ] } } } } }, "/provider/connect": { "post": { "security": [ { "BearerAuth": [] } ], "description": "连接到虚拟化提供者(如Docker、LXD、Proxmox等)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "虚拟化管理" ], "summary": "连接虚拟化Provider", "parameters": [ { "description": "连接参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/oneclickvirt_service_provider.ConnectProviderRequest" } } ], "responses": { "200": { "description": "连接成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "连接失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/provider/{id}/capabilities": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取指定Provider支持的功能和实例类型", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "虚拟化管理" ], "summary": "获取Provider能力", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "404": { "description": "Provider不存在", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/provider/{id}/instances": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取指定Provider下的所有实例", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "虚拟化管理" ], "summary": "获取实例列表", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object" } } } } ] } }, "404": { "description": "Provider不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "在指定Provider上创建新的虚拟机或容器实例", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "虚拟化管理" ], "summary": "创建实例", "parameters": [ { "enum": [ "docker", "lxd", "incus", "proxmox" ], "type": "string", "description": "Provider类型", "name": "type", "in": "path", "required": true }, { "description": "创建实例请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/oneclickvirt_service_provider.CreateInstanceRequest" } } ], "responses": { "200": { "description": "创建成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "Provider不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/provider/{id}/status": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取指定Provider的连接状态和支持的实例类型", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "虚拟化管理" ], "summary": "获取Provider状态", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "404": { "description": "Provider不存在", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/init": { "post": { "description": "进行系统的初始化设置,创建管理员和默认用户", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统初始化" ], "summary": "初始化系统", "parameters": [ { "description": "初始化请求参数", "name": "request", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "初始化成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误或系统已初始化", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "初始化失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/init/check": { "get": { "description": "检查系统是否需要进行初始化设置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统初始化" ], "summary": "检查系统初始化状态", "responses": { "200": { "description": "检查成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } } } } }, "/public/oauth2/providers": { "get": { "description": "获取所有启用的OAuth2提供商(公开接口)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "OAuth2" ], "summary": "获取启用的OAuth2提供商", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "additionalProperties": true } } } } ] } } } } }, "/public/recommended-db-type": { "get": { "description": "根据系统架构获取推荐的数据库类型", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统初始化" ], "summary": "获取推荐的数据库类型", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } } } } }, "/public/register-config": { "get": { "description": "获取注册页面所需的配置信息(不需要认证)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统初始化" ], "summary": "获取注册配置信息", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } } } } }, "/public/system-config": { "get": { "description": "获取系统公开配置信息(不需要认证),如默认语言等", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统配置" ], "summary": "获取公开的系统配置信息", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } } } } }, "/public/test-db-connection": { "post": { "description": "测试数据库连接是否可用,用于初始化前验证数据库配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统初始化" ], "summary": "测试数据库连接", "parameters": [ { "description": "数据库连接参数", "name": "request", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "连接成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "连接失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/static/{type}/{path}": { "get": { "description": "获取上传的静态文件(如头像)", "produces": [ "application/octet-stream" ], "tags": [ "文件访问" ], "summary": "获取静态文件", "parameters": [ { "enum": [ "avatars" ], "type": "string", "description": "文件类型", "name": "type", "in": "path", "required": true }, { "type": "string", "description": "文件路径", "name": "path", "in": "path", "required": true } ], "responses": { "200": { "description": "文件内容", "schema": { "type": "file" } }, "403": { "description": "访问被拒绝", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "文件不存在", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/upload/avatar": { "post": { "security": [ { "BearerAuth": [] } ], "description": "上传用户头像图片,仅支持PNG和JPEG格式,最大2MB", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "文件上传" ], "summary": "上传用户头像", "parameters": [ { "type": "file", "description": "头像文件", "name": "avatar", "in": "formData", "required": true } ], "responses": { "200": { "description": "上传成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object", "properties": { "url": { "type": "string" } } } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "413": { "description": "文件过大", "schema": { "$ref": "#/definitions/common.Response" } }, "415": { "description": "文件类型不支持", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/active-reservations": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取当前用户的所有活跃资源预留记录", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取用户的活跃资源预留", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/resource.ResourceReservation" } } } } ] } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/dashboard": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取当前登录用户的仪表板数据", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取用户仪表板", "responses": { "200": { "description": "获取成功", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/images": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取当前用户可以使用的系统镜像列表,支持按Provider和实例类型过滤", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取系统镜像列表", "parameters": [ { "type": "string", "description": "Provider类型", "name": "providerType", "in": "query" }, { "type": "integer", "description": "Provider ID", "name": "providerId", "in": "query" }, { "enum": [ "container", "vm" ], "type": "string", "description": "实例类型", "name": "instanceType", "in": "query" }, { "type": "string", "description": "架构", "name": "architecture", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/user.SystemImageResponse" } } } } ] } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/images/filtered": { "get": { "security": [ { "BearerAuth": [] } ], "description": "根据Provider ID和实例类型获取匹配的系统镜像列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取过滤后的系统镜像列表", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "provider_id", "in": "query", "required": true }, { "enum": [ "container", "vm" ], "type": "string", "description": "实例类型", "name": "instance_type", "in": "query", "required": true }, { "enum": [ "amd64", "arm64" ], "type": "string", "description": "架构类型", "name": "architecture", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/user.SystemImageResponse" } } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/info": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取当前登录用户的详细信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取用户信息", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "401": { "description": "用户未授权", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instance-config": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取可用的镜像、规格等实例创建配置选项", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取实例配置选项", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/user.InstanceConfigResponse" } } } ] } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instance-type-permissions": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取当前用户可以创建的实例类型权限配置,基于用户配额和Provider能力", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取实例类型权限配置", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取当前用户的所有实例", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取用户实例列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" }, { "type": "string", "description": "实例状态", "name": "status", "in": "query" }, { "type": "string", "description": "实例类型", "name": "type", "in": "query" }, { "type": "string", "description": "节点名称", "name": "providerName", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "用户创建新的虚拟机或容器实例(异步处理)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "创建实例", "parameters": [ { "description": "创建实例请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.CreateInstanceRequest" } } ], "responses": { "200": { "description": "任务创建成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/action": { "post": { "security": [ { "BearerAuth": [] } ], "description": "对用户实例执行操作(启动、停止、重启等)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "实例操作", "parameters": [ { "description": "实例操作请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.InstanceActionRequest" } } ], "responses": { "200": { "description": "操作成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "操作失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取用户实例的详细信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取用户实例详情", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/user.UserInstanceDetailResponse" } } } ] } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "实例不存在或无权限", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{id}/monitoring": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取用户实例的监控数据,包括流量统计信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取实例监控数据", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/user.InstanceMonitoringResponse" } } } ] } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "实例不存在或无权限", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{id}/password/{taskId}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "通过任务ID获取实例重置后的新密码", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取实例重置后的新密码", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "任务ID", "name": "taskId", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/user.GetInstancePasswordResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "实例不存在或无权限", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "任务不存在或未完成", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{id}/ports": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取指定实例的端口映射信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取实例端口映射", "parameters": [ { "type": "string", "description": "实例ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "无权限访问", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{id}/reset-password": { "put": { "security": [ { "BearerAuth": [] } ], "description": "用户重置自己实例的登录密码,创建异步任务执行密码重置操作", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "用户重置实例密码", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true }, { "description": "重置实例密码请求参数(可为空对象)", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.ResetInstancePasswordRequest" } } ], "responses": { "200": { "description": "任务创建成功,返回任务ID", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/user.ResetInstancePasswordResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "实例不存在或无权限", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建任务失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{instance_id}/vnstat/dashboard": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取实例的vnStat仪表板数据,包括汇总、趋势图等信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取实例vnStat仪表板数据", "parameters": [ { "type": "integer", "description": "实例ID", "name": "instance_id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": true } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "无权限访问该实例", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "实例不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{instance_id}/vnstat/interfaces": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取实例的所有vnStat监控接口列表及其状态", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取实例vnStat接口列表", "parameters": [ { "type": "integer", "description": "实例ID", "name": "instance_id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/monitoring.VnStatInterface" } } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "无权限访问该实例", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "实例不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{instance_id}/vnstat/query": { "get": { "security": [ { "BearerAuth": [] } ], "description": "根据查询条件获取实例的vnStat流量数据,支持按类型、时间范围查询", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "查询实例vnStat流量数据", "parameters": [ { "type": "integer", "description": "实例ID", "name": "instance_id", "in": "path", "required": true }, { "type": "string", "description": "网络接口名称", "name": "interface", "in": "query" }, { "type": "string", "description": "查询类型:total, daily, monthly, hourly", "name": "type", "in": "query" }, { "type": "string", "description": "时间周期", "name": "period", "in": "query" }, { "type": "string", "description": "开始日期(YYYY-MM-DD)", "name": "start_date", "in": "query" }, { "type": "string", "description": "结束日期(YYYY-MM-DD)", "name": "end_date", "in": "query" }, { "type": "integer", "description": "返回记录数限制(默认100)", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "查询成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/monitoring.VnStatResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "无权限访问该实例", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "实例不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "查询失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{instance_id}/vnstat/summary": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取用户实例的vnStat流量汇总信息,包括今日、本月和总流量统计", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取实例vnStat流量汇总", "parameters": [ { "type": "integer", "description": "实例ID", "name": "instance_id", "in": "path", "required": true }, { "type": "string", "description": "网络接口名称(可选)", "name": "interface", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/monitoring.VnStatResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "无权限访问该实例", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "实例不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/limits": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取当前登录用户的配额限制信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取用户配额限制", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/user.UserLimitsResponse" } } } ] } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/password": { "put": { "security": [ { "BearerAuth": [] } ], "description": "修改当前用户的登录密码", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "修改密码", "parameters": [ { "description": "修改密码请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.ChangePasswordRequest" } } ], "responses": { "200": { "description": "修改成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "修改失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/port-mappings": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取当前登录用户的所有端口映射", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取用户端口映射列表", "parameters": [ { "type": "integer", "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "description": "每页数量", "name": "limit", "in": "query" }, { "type": "string", "description": "搜索关键字", "name": "keyword", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/profile": { "put": { "security": [ { "BearerAuth": [] } ], "description": "更新当前用户的个人资料信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "更新个人信息", "parameters": [ { "description": "更新个人信息请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.UpdateProfileRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/provider/available": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取当前用户可以申领的节点列表,根据资源使用情况筛选", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取可用节点列表", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/user.AvailableProviderResponse" } } } } ] } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/provider/{id}/capabilities": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取指定Provider支持的实例类型和架构信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取Provider能力信息", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/reset-password": { "put": { "security": [ { "BearerAuth": [] } ], "description": "用户重置自己的登录密码,系统自动生成符合安全策略的新密码,并通过绑定的通信渠道发送", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "用户重置自己的密码", "parameters": [ { "description": "重置密码请求参数(可为空对象)", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.ResetPasswordRequest" } } ], "responses": { "200": { "description": "重置成功,新密码已发送到绑定的通信渠道", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "重置失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/resources/available": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取当前用户可以申领的资源列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取可申领资源", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" }, { "type": "string", "description": "资源类型", "name": "resourceType", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/resources/claim": { "post": { "security": [ { "BearerAuth": [] } ], "description": "用户申领可用的资源实例", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "申领资源", "parameters": [ { "description": "申领资源请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.ClaimResourceRequest" } } ], "responses": { "200": { "description": "申领成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "申领失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/tasks": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取当前用户的任务列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取用户任务列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" }, { "type": "string", "description": "任务类型", "name": "taskType", "in": "query" }, { "type": "string", "description": "任务状态", "name": "status", "in": "query" }, { "type": "string", "description": "节点ID", "name": "providerId", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/tasks/{taskId}/cancel": { "post": { "security": [ { "BearerAuth": [] } ], "description": "用户取消自己的等待中任务", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "取消用户任务", "parameters": [ { "type": "integer", "description": "任务ID", "name": "taskId", "in": "path", "required": true } ], "responses": { "200": { "description": "操作成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "操作失败", "schema": { "$ref": "#/definitions/common.Response" } } } } } }, "definitions": { "admin.AdminTaskListResponse": { "type": "object", "properties": { "list": { "type": "array", "items": { "$ref": "#/definitions/admin.AdminTaskResponse" } }, "page": { "type": "integer" }, "pageSize": { "type": "integer" }, "total": { "type": "integer" } } }, "admin.AdminTaskResponse": { "type": "object", "properties": { "canForceStop": { "type": "boolean" }, "cancelReason": { "description": "取消原因", "type": "string" }, "completedAt": { "type": "string" }, "createdAt": { "type": "string" }, "errorMessage": { "type": "string" }, "id": { "type": "integer" }, "instanceId": { "type": "integer" }, "instanceName": { "type": "string" }, "instanceType": { "type": "string" }, "isForceStoppable": { "type": "boolean" }, "progress": { "type": "integer" }, "providerId": { "type": "integer" }, "providerName": { "type": "string" }, "remainingTime": { "description": "剩余时间(秒)", "type": "integer" }, "startedAt": { "type": "string" }, "status": { "type": "string" }, "statusMessage": { "type": "string" }, "taskType": { "type": "string" }, "timeoutDuration": { "type": "integer" }, "userId": { "type": "integer" }, "userName": { "type": "string" }, "uuid": { "type": "string" } } }, "admin.AutoConfigureRequest": { "type": "object", "required": [ "providerId" ], "properties": { "force": { "description": "是否强制执行(即使有正在运行的任务)", "type": "boolean" }, "providerId": { "type": "integer" }, "showHistory": { "description": "是否显示历史记录", "type": "boolean" } } }, "admin.AutoConfigureResponse": { "type": "object", "properties": { "canProceed": { "type": "boolean" }, "historyTasks": { "description": "历史任务", "type": "array", "items": { "$ref": "#/definitions/admin.ConfigurationTaskResponse" } }, "message": { "type": "string" }, "runningTask": { "description": "当前运行的任务", "allOf": [ { "$ref": "#/definitions/admin.ConfigurationTaskResponse" } ] }, "status": { "type": "string" }, "streamUrl": { "description": "实时流URL", "type": "string" }, "taskId": { "type": "integer" } } }, "admin.BatchAnnouncementRequest": { "type": "object", "required": [ "ids" ], "properties": { "ids": { "type": "array", "items": { "type": "integer" } } } }, "admin.BatchDeleteInviteCodesRequest": { "type": "object", "required": [ "ids" ], "properties": { "ids": { "type": "array", "minItems": 1, "items": { "type": "integer" } } } }, "admin.BatchDeletePortMappingRequest": { "type": "object", "required": [ "ids" ], "properties": { "ids": { "type": "array", "items": { "type": "integer" } } } }, "admin.BatchDeleteUsersRequest": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "integer" } } } }, "admin.BatchUpdateStatusRequest": { "type": "object", "required": [ "ids" ], "properties": { "ids": { "type": "array", "items": { "type": "integer" } }, "status": { "type": "integer", "maximum": 1, "minimum": 0 } } }, "admin.BatchUpdateUserLevelRequest": { "type": "object", "required": [ "userIds" ], "properties": { "level": { "type": "integer", "maximum": 5, "minimum": 1 }, "userIds": { "type": "array", "items": { "type": "integer" } } } }, "admin.BatchUpdateUserStatusRequest": { "type": "object", "required": [ "userIds" ], "properties": { "status": { "type": "integer", "maximum": 1, "minimum": 0 }, "userIds": { "type": "array", "items": { "type": "integer" } } } }, "admin.ConfigurationTaskDetailResponse": { "type": "object", "properties": { "completedAt": { "type": "string" }, "createdAt": { "type": "string" }, "duration": { "description": "格式化的时长,如 \"2m30s\"", "type": "string" }, "errorMessage": { "type": "string" }, "executorId": { "type": "integer" }, "executorName": { "type": "string" }, "id": { "type": "integer" }, "logOutput": { "description": "完整日志", "type": "string" }, "logSummary": { "type": "string" }, "progress": { "type": "integer" }, "providerId": { "type": "integer" }, "providerName": { "type": "string" }, "providerType": { "type": "string" }, "resultData": { "description": "结果数据", "type": "object", "additionalProperties": true }, "startedAt": { "type": "string" }, "status": { "type": "string" }, "success": { "type": "boolean" }, "taskType": { "type": "string" }, "updatedAt": { "type": "string" } } }, "admin.ConfigurationTaskListResponse": { "type": "object", "properties": { "list": { "type": "array", "items": { "$ref": "#/definitions/admin.ConfigurationTaskResponse" } }, "total": { "type": "integer" } } }, "admin.ConfigurationTaskResponse": { "type": "object", "properties": { "completedAt": { "type": "string" }, "createdAt": { "type": "string" }, "duration": { "description": "格式化的时长,如 \"2m30s\"", "type": "string" }, "errorMessage": { "type": "string" }, "executorId": { "type": "integer" }, "executorName": { "type": "string" }, "id": { "type": "integer" }, "logSummary": { "type": "string" }, "progress": { "type": "integer" }, "providerId": { "type": "integer" }, "providerName": { "type": "string" }, "providerType": { "type": "string" }, "startedAt": { "type": "string" }, "status": { "type": "string" }, "success": { "type": "boolean" }, "taskType": { "type": "string" }, "updatedAt": { "type": "string" } } }, "admin.CreateAnnouncementRequest": { "type": "object", "required": [ "content", "title", "type" ], "properties": { "content": { "type": "string" }, "contentHtml": { "type": "string" }, "endTime": { "type": "string" }, "isSticky": { "type": "boolean" }, "priority": { "type": "integer" }, "startTime": { "type": "string" }, "title": { "type": "string" }, "type": { "description": "限制类型", "type": "string", "enum": [ "homepage", "topbar" ] } } }, "admin.CreateInstanceRequest": { "type": "object", "required": [ "image", "name", "provider" ], "properties": { "cpu": { "type": "integer" }, "disk": { "type": "integer" }, "image": { "type": "string" }, "instance_type": { "type": "string" }, "memory": { "type": "integer" }, "name": { "type": "string" }, "provider": { "type": "string" }, "userId": { "type": "integer" } } }, "admin.CreateInviteCodeRequest": { "type": "object", "required": [ "count" ], "properties": { "code": { "description": "自定义邀请码,如果为空则自动生成", "type": "string" }, "count": { "type": "integer", "maximum": 100, "minimum": 1 }, "expiresAt": { "type": "string" }, "length": { "description": "邀请码长度,仅在自动生成时有效", "type": "integer" }, "maxUses": { "type": "integer" }, "remark": { "type": "string" } } }, "admin.CreatePortMappingRequest": { "type": "object", "required": [ "guestPort", "instanceId", "protocol" ], "properties": { "description": { "type": "string" }, "guestPort": { "type": "integer", "maximum": 65535, "minimum": 1 }, "hostPort": { "description": "可选,不指定则自动分配", "type": "integer" }, "instanceId": { "type": "integer" }, "protocol": { "type": "string", "enum": [ "tcp", "udp", "both" ] } } }, "admin.CreateProviderRequest": { "type": "object", "required": [ "name", "type" ], "properties": { "allowClaim": { "type": "boolean" }, "allowConcurrentTasks": { "description": "是否允许并发任务,默认false", "type": "boolean" }, "architecture": { "type": "string" }, "city": { "type": "string" }, "config": { "type": "string" }, "container_enabled": { "type": "boolean" }, "country": { "type": "string" }, "countryCode": { "type": "string" }, "defaultInboundBandwidth": { "description": "带宽配置", "type": "integer" }, "defaultOutboundBandwidth": { "description": "默认出站带宽限制(Mbps)", "type": "integer" }, "defaultPortCount": { "description": "端口映射配置", "type": "integer" }, "enableTaskPolling": { "description": "是否启用任务轮询,默认true", "type": "boolean" }, "endpoint": { "type": "string" }, "executionRule": { "description": "操作执行配置", "type": "string", "enum": [ "auto", "api_only", "ssh_only" ] }, "expiresAt": { "description": "过期时间,格式: \"2006-01-02 15:04:05\"", "type": "string" }, "levelLimits": { "description": "节点级别的等级限制配置\n用于限制该节点上不同等级用户能创建的最大资源", "type": "object", "additionalProperties": { "type": "object", "additionalProperties": true } }, "maxConcurrentTasks": { "description": "最大并发任务数,默认1", "type": "integer" }, "maxContainerInstances": { "description": "最大容器数量限制", "type": "integer" }, "maxInboundBandwidth": { "description": "最大入站带宽限制(Mbps)", "type": "integer" }, "maxOutboundBandwidth": { "description": "最大出站带宽限制(Mbps)", "type": "integer" }, "maxTraffic": { "description": "流量管理", "type": "integer" }, "maxVMInstances": { "description": "最大虚拟机数量限制", "type": "integer" }, "name": { "type": "string" }, "networkType": { "description": "网络配置类型:nat_ipv4, nat_ipv4_ipv6, dedicated_ipv4, dedicated_ipv4_ipv6, ipv6_only", "type": "string", "enum": [ "nat_ipv4", "nat_ipv4_ipv6", "dedicated_ipv4", "dedicated_ipv4_ipv6", "ipv6_only" ] }, "password": { "type": "string" }, "portIP": { "description": "端口映射使用的公网IP", "type": "string" }, "portRangeEnd": { "description": "端口映射范围结束,默认65535", "type": "integer" }, "portRangeStart": { "description": "端口映射范围起始,默认10000", "type": "integer" }, "region": { "type": "string" }, "sshConnectTimeout": { "description": "SSH连接配置", "type": "integer" }, "sshExecuteTimeout": { "description": "SSH命令执行超时时间(秒),默认300秒", "type": "integer" }, "sshKey": { "description": "SSH私钥,优先于密码使用", "type": "string" }, "sshPort": { "type": "integer" }, "status": { "type": "string" }, "storagePool": { "description": "存储配置(ProxmoxVE专用)", "type": "string" }, "taskPollInterval": { "description": "任务轮询间隔(秒),默认60秒", "type": "integer" }, "token": { "type": "string" }, "totalQuota": { "type": "integer" }, "type": { "type": "string" }, "username": { "type": "string" }, "vm_enabled": { "type": "boolean" } } }, "admin.CreateUserRequest": { "type": "object", "required": [ "password", "userType", "username" ], "properties": { "email": { "type": "string" }, "level": { "type": "integer" }, "nickname": { "type": "string" }, "password": { "type": "string" }, "phone": { "type": "string" }, "qq": { "type": "string" }, "roleId": { "type": "integer" }, "status": { "type": "integer" }, "telegram": { "type": "string" }, "totalQuota": { "type": "integer" }, "userType": { "type": "string" }, "username": { "type": "string" } } }, "admin.ForceStopTaskRequest": { "type": "object", "required": [ "taskId" ], "properties": { "reason": { "description": "强制停止原因", "type": "string" }, "taskId": { "type": "integer" } } }, "admin.GetInstancePasswordResponse": { "type": "object", "properties": { "newPassword": { "type": "string" }, "resetTime": { "type": "integer" } } }, "admin.InstanceActionRequest": { "type": "object", "required": [ "action" ], "properties": { "action": { "type": "string" } } }, "admin.ProviderPortConfigRequest": { "type": "object", "properties": { "defaultPortCount": { "description": "每个实例默认映射端口数量", "type": "integer", "maximum": 50, "minimum": 1 }, "networkType": { "description": "网络配置类型", "type": "string", "enum": [ "nat_ipv4", "nat_ipv4_ipv6", "dedicated_ipv4", "dedicated_ipv4_ipv6", "ipv6_only" ] }, "portRangeEnd": { "description": "端口映射范围结束", "type": "integer", "maximum": 65535, "minimum": 1024 }, "portRangeStart": { "description": "端口映射范围起始", "type": "integer", "maximum": 65535, "minimum": 1024 } } }, "admin.ProviderStatusResponse": { "type": "object", "properties": { "apiStatus": { "type": "string" }, "certFingerprint": { "type": "string" }, "certPath": { "type": "string" }, "id": { "type": "integer" }, "keyPath": { "type": "string" }, "lastApiCheck": { "type": "string" }, "lastSshCheck": { "type": "string" }, "name": { "type": "string" }, "nodeCpuCores": { "description": "节点资源信息", "type": "integer" }, "nodeDiskTotal": { "type": "integer" }, "nodeMemoryTotal": { "type": "integer" }, "resourceSynced": { "type": "boolean" }, "resourceSyncedAt": { "type": "string" }, "sshStatus": { "type": "string" }, "status": { "type": "string" }, "type": { "type": "string" }, "uuid": { "type": "string" } } }, "admin.ResetInstancePasswordRequest": { "type": "object" }, "admin.ResetInstancePasswordResponse": { "type": "object", "properties": { "taskId": { "description": "异步任务ID", "type": "integer" } } }, "admin.ResetUserPasswordRequest": { "type": "object" }, "admin.ResetUserPasswordResponse": { "type": "object", "properties": { "newPassword": { "description": "生成的新密码", "type": "string" } } }, "admin.TaskStatsResponse": { "type": "object", "properties": { "completedTasks": { "type": "integer" }, "failedTasks": { "type": "integer" }, "pendingTasks": { "type": "integer" }, "runningTasks": { "type": "integer" }, "timeoutTasks": { "type": "integer" }, "totalTasks": { "type": "integer" } } }, "admin.TestSSHConnectionRequest": { "type": "object", "required": [ "host", "port", "username" ], "properties": { "host": { "description": "SSH服务器地址", "type": "string" }, "password": { "description": "SSH密码(使用密码认证时必填)", "type": "string" }, "port": { "description": "SSH端口", "type": "integer" }, "sshKey": { "description": "SSH私钥(使用密钥认证时必填)", "type": "string" }, "testCount": { "description": "测试次数,默认3次", "type": "integer" }, "username": { "description": "SSH用户名", "type": "string" } } }, "admin.TestSSHConnectionResponse": { "type": "object", "properties": { "avgLatency": { "description": "平均延迟(毫秒)", "type": "integer" }, "errorMessage": { "description": "错误信息(如果失败)", "type": "string" }, "maxLatency": { "description": "最大延迟(毫秒)", "type": "integer" }, "minLatency": { "description": "最小延迟(毫秒)", "type": "integer" }, "recommendedTimeout": { "description": "推荐的超时时间(秒),最大延迟*2", "type": "integer" }, "success": { "description": "测试是否成功", "type": "boolean" }, "testCount": { "description": "测试次数", "type": "integer" } } }, "admin.UpdateAnnouncementRequest": { "type": "object", "properties": { "content": { "type": "string" }, "contentHtml": { "type": "string" }, "endTime": { "type": "string" }, "id": { "type": "integer" }, "isSticky": { "type": "boolean" }, "priority": { "type": "integer" }, "startTime": { "type": "string" }, "status": { "type": "integer" }, "title": { "type": "string" }, "type": { "type": "string", "enum": [ "homepage", "topbar" ] } } }, "admin.UpdateInstanceTypePermissionsRequest": { "type": "object", "properties": { "minLevelForContainer": { "type": "integer", "maximum": 5, "minimum": 1 }, "minLevelForDeleteContainer": { "type": "integer", "maximum": 5, "minimum": 1 }, "minLevelForDeleteVM": { "type": "integer", "maximum": 5, "minimum": 1 }, "minLevelForResetContainer": { "type": "integer", "maximum": 5, "minimum": 1 }, "minLevelForResetVM": { "type": "integer", "maximum": 5, "minimum": 1 }, "minLevelForVM": { "type": "integer", "maximum": 5, "minimum": 1 } } }, "admin.UpdateUserLevelRequest": { "type": "object", "properties": { "level": { "type": "integer", "maximum": 5, "minimum": 1 } } }, "admin.UpdateUserStatusRequest": { "type": "object", "properties": { "status": { "type": "integer", "maximum": 1, "minimum": 0 } } }, "auth.ForgotPasswordRequest": { "type": "object", "required": [ "email" ], "properties": { "captcha": { "type": "string" }, "captchaId": { "type": "string" }, "email": { "type": "string", "example": "user@example.com" }, "userType": { "type": "string" } } }, "auth.LoginRequest": { "type": "object", "properties": { "captcha": { "description": "图形验证码", "type": "string" }, "captchaId": { "description": "图形验证码ID", "type": "string" }, "loginType": { "description": "登录类型: username(用户名密码), email(邮箱验证码), telegram(TG验证码), qq(QQ验证码)", "type": "string" }, "password": { "description": "密码登录时必填", "type": "string", "example": "password" }, "target": { "description": "验证码登录时的目标: 邮箱地址/TG用户名/QQ号", "type": "string" }, "userType": { "description": "用户类型: admin, user", "type": "string" }, "username": { "description": "用户名登录时必填", "type": "string", "example": "admin" }, "verifyCode": { "description": "验证码登录时的验证码", "type": "string" } } }, "auth.RegisterRequest": { "type": "object", "required": [ "password", "username" ], "properties": { "captcha": { "type": "string" }, "captchaId": { "type": "string" }, "email": { "type": "string", "example": "user@example.com" }, "inviteCode": { "type": "string", "example": "INVITE123" }, "nickname": { "type": "string", "example": "昵称" }, "password": { "type": "string", "example": "password123" }, "phone": { "type": "string", "example": "13800138000" }, "qq": { "type": "string" }, "telegram": { "type": "string" }, "username": { "type": "string", "example": "user123" } } }, "auth.ResetPasswordRequest": { "type": "object", "required": [ "token" ], "properties": { "token": { "type": "string" } } }, "auth.SendVerifyCodeRequest": { "type": "object", "required": [ "target", "type" ], "properties": { "captcha": { "description": "图形验证码(可选,根据配置)", "type": "string" }, "captchaId": { "description": "图形验证码ID(可选,根据配置)", "type": "string" }, "target": { "description": "目标: 邮箱地址/TG用户名或ID/QQ号", "type": "string" }, "type": { "description": "验证码类型: email, telegram, qq", "type": "string" } } }, "common.Response": { "type": "object", "properties": { "code": { "type": "integer" }, "data": {}, "msg": { "type": "string" } } }, "config.AuthConfig": { "type": "object", "properties": { "emailPassword": { "type": "string" }, "emailSMTPHost": { "type": "string" }, "emailSMTPPort": { "type": "integer" }, "emailUsername": { "type": "string" }, "enableEmail": { "type": "boolean" }, "enableOAuth2": { "description": "是否启用OAuth2登录", "type": "boolean" }, "enablePublicRegistration": { "description": "是否启用公开注册(无需邀请码)", "type": "boolean" }, "enableQQ": { "type": "boolean" }, "enableTelegram": { "type": "boolean" }, "qqAppID": { "type": "string" }, "qqAppKey": { "type": "string" }, "telegramBotToken": { "type": "string" } } }, "config.InviteCodeConfig": { "type": "object", "properties": { "enabled": { "description": "是否启用邀请码系统", "type": "boolean" }, "required": { "description": "是否必须邀请码(兼容旧字段)", "type": "boolean" } } }, "config.OtherConfig": { "type": "object", "properties": { "defaultLanguage": { "description": "系统默认语言,空字符串表示使用浏览器语言", "type": "string" }, "maxAvatarSize": { "description": "头像最大大小(MB)", "type": "number" } } }, "config.QuotaConfig": { "type": "object", "properties": { "defaultLevel": { "type": "integer" }, "levelLimits": { "type": "object", "additionalProperties": { "$ref": "#/definitions/oneclickvirt_model_config.LevelLimitInfo" } } } }, "config.UnifiedConfigRequest": { "type": "object", "required": [ "config", "scope" ], "properties": { "config": { "type": "object", "additionalProperties": true }, "scope": { "description": "public, user, admin", "type": "string" } } }, "config.UpdateConfigRequest": { "type": "object", "properties": { "auth": { "$ref": "#/definitions/config.AuthConfig" }, "inviteCode": { "$ref": "#/definitions/config.InviteCodeConfig" }, "other": { "$ref": "#/definitions/config.OtherConfig" }, "quota": { "$ref": "#/definitions/config.QuotaConfig" } } }, "log.LogFileInfo": { "type": "object", "properties": { "date": { "description": "日期字段,格式为 YYYY-MM-DD", "type": "string" }, "is_gzip": { "type": "boolean" }, "mod_time": { "type": "string" }, "name": { "type": "string" }, "path": { "type": "string" }, "size": { "type": "integer" } } }, "monitoring.VnStatDate": { "type": "object", "properties": { "day": { "type": "integer" }, "month": { "type": "integer" }, "year": { "type": "integer" } } }, "monitoring.VnStatDayRecord": { "type": "object", "properties": { "date": { "$ref": "#/definitions/monitoring.VnStatDate" }, "id": { "description": "v2+ 才有", "type": "integer" }, "rx": { "type": "integer" }, "timestamp": { "description": "v2+ 才有", "type": "integer" }, "tx": { "type": "integer" } } }, "monitoring.VnStatFiveMinRecord": { "type": "object", "properties": { "date": { "$ref": "#/definitions/monitoring.VnStatDate" }, "id": { "type": "integer" }, "rx": { "type": "integer" }, "time": { "$ref": "#/definitions/monitoring.VnStatTime" }, "timestamp": { "type": "integer" }, "tx": { "type": "integer" } } }, "monitoring.VnStatHourRecord": { "type": "object", "properties": { "date": { "$ref": "#/definitions/monitoring.VnStatDate" }, "id": { "type": "integer" }, "rx": { "type": "integer" }, "time": { "$ref": "#/definitions/monitoring.VnStatTime" }, "timestamp": { "type": "integer" }, "tx": { "type": "integer" } } }, "monitoring.VnStatInterface": { "type": "object", "properties": { "created_at": { "type": "string" }, "id": { "type": "integer" }, "instance_id": { "description": "实例ID", "type": "integer" }, "interface": { "description": "接口名称", "type": "string" }, "is_enabled": { "description": "是否启用监控", "type": "boolean" }, "last_sync": { "description": "最后同步时间", "type": "string" }, "provider_id": { "description": "Provider ID", "type": "integer" }, "updated_at": { "type": "string" } } }, "monitoring.VnStatInterfaceData": { "type": "object", "properties": { "alias": { "type": "string" }, "created": { "description": "v2+ 才有", "allOf": [ { "$ref": "#/definitions/monitoring.VnStatTimestamp" } ] }, "name": { "type": "string" }, "traffic": { "$ref": "#/definitions/monitoring.VnStatTrafficData" }, "updated": { "description": "v2+ 才有", "allOf": [ { "$ref": "#/definitions/monitoring.VnStatTimestamp" } ] } } }, "monitoring.VnStatMonthRecord": { "type": "object", "properties": { "date": { "description": "只有年月", "allOf": [ { "$ref": "#/definitions/monitoring.VnStatDate" } ] }, "id": { "description": "v2+ 才有", "type": "integer" }, "rx": { "type": "integer" }, "timestamp": { "description": "v2+ 才有", "type": "integer" }, "tx": { "type": "integer" } } }, "monitoring.VnStatResponse": { "type": "object", "properties": { "interfaces": { "type": "array", "items": { "$ref": "#/definitions/monitoring.VnStatInterfaceData" } }, "jsonversion": { "type": "string" }, "vnstatversion": { "type": "string" } } }, "monitoring.VnStatTime": { "type": "object", "properties": { "hour": { "type": "integer" }, "minute": { "type": "integer" } } }, "monitoring.VnStatTimestamp": { "type": "object", "properties": { "date": { "$ref": "#/definitions/monitoring.VnStatDate" }, "time": { "description": "有些地方没有时间", "allOf": [ { "$ref": "#/definitions/monitoring.VnStatTime" } ] }, "timestamp": { "description": "v2+ 才有", "type": "integer" } } }, "monitoring.VnStatTopRecord": { "type": "object", "properties": { "date": { "$ref": "#/definitions/monitoring.VnStatDate" }, "id": { "description": "v2+ 才有", "type": "integer" }, "rx": { "type": "integer" }, "timestamp": { "description": "v2+ 才有", "type": "integer" }, "tx": { "type": "integer" } } }, "monitoring.VnStatTotal": { "type": "object", "properties": { "rx": { "type": "integer" }, "tx": { "type": "integer" } } }, "monitoring.VnStatTrafficData": { "type": "object", "properties": { "day": { "description": "v2 使用", "type": "array", "items": { "$ref": "#/definitions/monitoring.VnStatDayRecord" } }, "days": { "description": "v1 格式字段 (复数形式)", "type": "array", "items": { "$ref": "#/definitions/monitoring.VnStatDayRecord" } }, "fiveminute": { "description": "v2 格式字段 (单数形式)", "type": "array", "items": { "$ref": "#/definitions/monitoring.VnStatFiveMinRecord" } }, "hour": { "description": "v2+ 新增", "type": "array", "items": { "$ref": "#/definitions/monitoring.VnStatHourRecord" } }, "month": { "description": "v2 使用", "type": "array", "items": { "$ref": "#/definitions/monitoring.VnStatMonthRecord" } }, "months": { "description": "v1 使用", "type": "array", "items": { "$ref": "#/definitions/monitoring.VnStatMonthRecord" } }, "top": { "description": "v2 使用", "type": "array", "items": { "$ref": "#/definitions/monitoring.VnStatTopRecord" } }, "tops": { "description": "v1 使用", "type": "array", "items": { "$ref": "#/definitions/monitoring.VnStatTopRecord" } }, "total": { "$ref": "#/definitions/monitoring.VnStatTotal" }, "year": { "description": "v2+ 新增", "type": "array", "items": { "$ref": "#/definitions/monitoring.VnStatYearRecord" } } } }, "monitoring.VnStatYearRecord": { "type": "object", "properties": { "date": { "description": "只有年", "allOf": [ { "$ref": "#/definitions/monitoring.VnStatDate" } ] }, "id": { "type": "integer" }, "rx": { "type": "integer" }, "timestamp": { "type": "integer" }, "tx": { "type": "integer" } } }, "oauth2.CreateProviderRequest": { "type": "object", "required": [ "authUrl", "clientId", "clientSecret", "displayName", "name", "redirectUrl", "tokenUrl", "userInfoUrl" ], "properties": { "authUrl": { "type": "string" }, "avatarField": { "type": "string" }, "clientId": { "type": "string" }, "clientSecret": { "type": "string" }, "defaultLevel": { "type": "integer" }, "displayName": { "type": "string" }, "emailField": { "type": "string" }, "enabled": { "type": "boolean" }, "levelMapping": { "type": "object", "additionalProperties": { "type": "integer" } }, "maxRegistrations": { "type": "integer" }, "name": { "type": "string" }, "nicknameField": { "type": "string" }, "redirectUrl": { "type": "string" }, "sort": { "type": "integer" }, "tokenUrl": { "type": "string" }, "trustLevelField": { "type": "string" }, "userIdField": { "type": "string" }, "userInfoUrl": { "type": "string" }, "usernameField": { "type": "string" } } }, "oauth2.OAuth2Provider": { "type": "object", "properties": { "authUrl": { "description": "OAuth2授权地址", "type": "string" }, "avatarField": { "description": "头像字段映射", "type": "string" }, "clientId": { "description": "OAuth2配置", "type": "string" }, "clientSecret": { "description": "OAuth2客户端密钥", "type": "string" }, "createdAt": { "type": "string" }, "currentRegistrations": { "description": "当前注册数量", "type": "integer" }, "defaultLevel": { "description": "默认等级(当没有等级映射或无法提取等级时使用)", "type": "integer" }, "displayName": { "description": "显示名称", "type": "string" }, "emailField": { "description": "邮箱字段映射", "type": "string" }, "enabled": { "description": "是否启用", "type": "boolean" }, "id": { "type": "integer" }, "levelMapping": { "description": "等级映射(JSON字符串,如 {\"0\":1,\"1\":2,\"2\":3})\n映射外部信任等级到系统用户等级", "type": "string" }, "maxRegistrations": { "description": "注册限制", "type": "integer" }, "name": { "description": "基础信息", "type": "string" }, "nicknameField": { "description": "可选字段映射", "type": "string" }, "redirectUrl": { "description": "OAuth2回调地址", "type": "string" }, "sort": { "description": "显示顺序", "type": "integer" }, "tokenUrl": { "description": "OAuth2令牌地址", "type": "string" }, "totalUsers": { "description": "统计信息", "type": "integer" }, "trustLevelField": { "description": "信任等级字段映射(可选,如LinuxDo的trust_level)", "type": "string" }, "updatedAt": { "type": "string" }, "userIdField": { "description": "字段映射(支持嵌套字段,如 user.profile.name)", "type": "string" }, "userInfoUrl": { "description": "OAuth2用户信息地址", "type": "string" }, "usernameField": { "description": "用户名字段映射", "type": "string" } } }, "oauth2.UpdateProviderRequest": { "type": "object", "properties": { "authUrl": { "type": "string" }, "avatarField": { "type": "string" }, "clientId": { "type": "string" }, "clientSecret": { "type": "string" }, "defaultLevel": { "type": "integer" }, "displayName": { "type": "string" }, "emailField": { "type": "string" }, "enabled": { "type": "boolean" }, "levelMapping": { "type": "object", "additionalProperties": { "type": "integer" } }, "maxRegistrations": { "type": "integer" }, "name": { "type": "string" }, "nicknameField": { "type": "string" }, "redirectUrl": { "type": "string" }, "sort": { "type": "integer" }, "tokenUrl": { "type": "string" }, "trustLevelField": { "type": "string" }, "userIdField": { "type": "string" }, "userInfoUrl": { "type": "string" }, "usernameField": { "type": "string" } } }, "oneclickvirt_model_config.LevelLimitInfo": { "type": "object", "properties": { "maxInstances": { "type": "integer" }, "maxResources": { "type": "object", "additionalProperties": true }, "maxTraffic": { "description": "最大流量限制(MB)", "type": "integer" } } }, "oneclickvirt_service_provider.ConnectProviderRequest": { "type": "object", "required": [ "host", "name", "password", "type", "username" ], "properties": { "cert_path": { "type": "string" }, "containerLimitCpu": { "description": "容器资源限制配置(Provider层面)", "type": "boolean" }, "containerLimitDisk": { "description": "容器是否限制硬盘大小", "type": "boolean" }, "containerLimitMemory": { "description": "容器是否限制内存大小", "type": "boolean" }, "container_enabled": { "type": "boolean" }, "host": { "type": "string" }, "key_path": { "type": "string" }, "levelLimits": { "description": "节点级别的等级限制配置\n用于限制该节点上不同等级用户能创建的最大资源", "type": "object", "additionalProperties": { "type": "object", "additionalProperties": true } }, "name": { "type": "string" }, "networkType": { "description": "网络配置类型", "type": "string" }, "password": { "type": "string" }, "port": { "description": "兼容旧的port字段", "type": "integer" }, "sshKey": { "description": "SSH私钥内容,优先于密码使用", "type": "string" }, "sshPort": { "description": "新的sshPort字段", "type": "integer" }, "token": { "description": "API Token,用于ProxmoxVE等", "type": "string" }, "type": { "type": "string" }, "username": { "type": "string" }, "vmLimitCpu": { "description": "虚拟机资源限制配置(Provider层面)", "type": "boolean" }, "vmLimitDisk": { "description": "虚拟机是否限制硬盘大小", "type": "boolean" }, "vmLimitMemory": { "description": "虚拟机是否限制内存大小", "type": "boolean" }, "vm_enabled": { "type": "boolean" } } }, "oneclickvirt_service_provider.CreateInstanceRequest": { "type": "object", "properties": { "cpu": { "type": "string" }, "disk": { "type": "string" }, "env": { "type": "object", "additionalProperties": { "type": "string" } }, "image": { "type": "string" }, "image_path": { "description": "镜像文件路径", "type": "string" }, "image_url": { "description": "镜像下载URL", "type": "string" }, "instance_type": { "description": "container 或 vm", "type": "string" }, "memory": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "type": "string" }, "network": { "type": "string" }, "ports": { "type": "array", "items": { "type": "string" } }, "systemImageId": { "description": "系统镜像ID", "type": "integer" }, "use_cdn": { "description": "是否使用CDN加速下载镜像", "type": "boolean" } } }, "resource.ResourceReservation": { "type": "object", "properties": { "bandwidth": { "description": "预留的带宽(Mbps)", "type": "integer" }, "cpu": { "description": "预留的CPU核心数", "type": "integer" }, "createdAt": { "type": "string" }, "disk": { "description": "预留的磁盘(MB)", "type": "integer" }, "expiresAt": { "description": "TTL管理", "type": "string" }, "id": { "type": "integer" }, "instanceType": { "description": "实例规格", "type": "string" }, "memory": { "description": "预留的内存(MB)", "type": "integer" }, "providerId": { "description": "Provider ID", "type": "integer" }, "sessionId": { "description": "会话标识,唯一主键", "type": "string" }, "updatedAt": { "type": "string" }, "userId": { "description": "核心标识字段", "type": "integer" }, "uuid": { "type": "string" } } }, "system.CPUStats": { "type": "object", "properties": { "cores": { "description": "CPU核心数", "type": "integer" }, "load_avg_1": { "description": "1分钟负载平均值", "type": "number" }, "load_avg_15": { "description": "15分钟负载平均值", "type": "number" }, "load_avg_5": { "description": "5分钟负载平均值", "type": "number" }, "usage": { "description": "CPU使用率", "type": "number" } } }, "system.CreateSystemImageRequest": { "type": "object", "required": [ "architecture", "instanceType", "minDiskMB", "minMemoryMB", "name", "providerType", "url" ], "properties": { "architecture": { "type": "string", "enum": [ "amd64", "arm64", "s390x" ] }, "checksum": { "type": "string" }, "description": { "type": "string" }, "instanceType": { "type": "string", "enum": [ "vm", "container" ] }, "minDiskMB": { "type": "integer", "minimum": 1 }, "minMemoryMB": { "type": "integer", "minimum": 1 }, "name": { "type": "string" }, "osType": { "type": "string" }, "osVersion": { "type": "string" }, "providerType": { "type": "string", "enum": [ "proxmox", "lxd", "incus", "docker" ] }, "size": { "type": "integer" }, "tags": { "type": "string" }, "url": { "type": "string" }, "useCdn": { "type": "boolean" } } }, "system.DatabaseStats": { "type": "object", "properties": { "connections": { "description": "当前连接数", "type": "integer" }, "max_connections": { "description": "最大连接数", "type": "integer" }, "queries_total": { "description": "总查询数", "type": "integer" }, "slow_queries": { "description": "慢查询数", "type": "integer" }, "uptime": { "description": "运行时间", "type": "string" } } }, "system.DiskStats": { "type": "object", "properties": { "free": { "description": "磁盘空闲", "type": "integer" }, "total": { "description": "磁盘总大小", "type": "integer" }, "usage": { "description": "磁盘使用率", "type": "number" }, "used": { "description": "磁盘已使用", "type": "integer" } } }, "system.MemoryStats": { "type": "object", "properties": { "free": { "description": "空闲内存", "type": "integer" }, "swap_total": { "description": "交换分区总大小", "type": "integer" }, "swap_used": { "description": "交换分区已使用", "type": "integer" }, "total": { "description": "总内存", "type": "integer" }, "usage": { "description": "内存使用率", "type": "number" }, "used": { "description": "已使用内存", "type": "integer" } } }, "system.NetworkStats": { "type": "object", "properties": { "bytes_received": { "description": "接收字节数", "type": "integer" }, "bytes_sent": { "description": "发送字节数", "type": "integer" }, "packets_recv": { "description": "接收包数", "type": "integer" }, "packets_sent": { "description": "发送包数", "type": "integer" } } }, "system.RuntimeStats": { "type": "object", "properties": { "gc_cycles": { "description": "GC循环次数", "type": "integer" }, "goroutines": { "description": "协程数量", "type": "integer" }, "heap_alloc": { "description": "堆内存分配", "type": "integer" }, "heap_idle": { "description": "堆内存空闲", "type": "integer" }, "heap_inuse": { "description": "堆内存使用中", "type": "integer" }, "heap_sys": { "description": "堆内存系统", "type": "integer" }, "last_gc": { "description": "最后GC时间", "type": "string" }, "uptime": { "description": "运行时间", "type": "string" } } }, "system.SystemStats": { "type": "object", "properties": { "cpu": { "$ref": "#/definitions/system.CPUStats" }, "database": { "$ref": "#/definitions/system.DatabaseStats" }, "disk": { "$ref": "#/definitions/system.DiskStats" }, "memory": { "$ref": "#/definitions/system.MemoryStats" }, "network": { "$ref": "#/definitions/system.NetworkStats" }, "runtime": { "$ref": "#/definitions/system.RuntimeStats" }, "timestamp": { "type": "string" } } }, "traffic.BatchManageTrafficLimitRequest": { "type": "object", "required": [ "action", "user_ids" ], "properties": { "action": { "description": "\"limit\" 或 \"unlimit\"", "type": "string" }, "reason": { "description": "限制原因(仅在action为limit时需要)", "type": "string" }, "user_ids": { "type": "array", "items": { "type": "integer" } } } }, "traffic.BatchSyncTrafficRequest": { "type": "object", "required": [ "user_ids" ], "properties": { "user_ids": { "type": "array", "items": { "type": "integer" } } } }, "traffic.ManageTrafficLimitRequest": { "type": "object", "required": [ "action", "target_id", "type" ], "properties": { "action": { "description": "\"limit\" 或 \"unlimit\"", "type": "string" }, "reason": { "description": "限制原因(仅在action为limit时需要)", "type": "string" }, "target_id": { "description": "目标用户ID或Provider ID", "type": "integer" }, "type": { "description": "\"user\" 或 \"provider\"", "type": "string" } } }, "user.AvailableProviderResponse": { "type": "object", "properties": { "availableContainerSlots": { "description": "可用容器槽位数,-1表示不限制", "type": "integer" }, "availableVMSlots": { "description": "可用虚拟机槽位数,-1表示不限制", "type": "integer" }, "city": { "type": "string" }, "containerEnabled": { "type": "boolean" }, "country": { "type": "string" }, "countryCode": { "type": "string" }, "cpu": { "type": "integer" }, "cpuUsage": { "type": "number" }, "disk": { "description": "总硬盘空间(MB)", "type": "integer" }, "id": { "type": "integer" }, "maxContainerInstances": { "description": "最大容器数量,0表示不限制", "type": "integer" }, "maxVMInstances": { "description": "最大虚拟机数量,0表示不限制", "type": "integer" }, "memory": { "description": "总内存(MB)", "type": "integer" }, "memoryUsage": { "type": "number" }, "name": { "type": "string" }, "region": { "type": "string" }, "status": { "type": "string" }, "type": { "type": "string" }, "vmEnabled": { "type": "boolean" } } }, "user.BandwidthSpecResponse": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "speedMbps": { "type": "integer" } } }, "user.CPUSpecResponse": { "type": "object", "properties": { "cores": { "type": "integer" }, "id": { "type": "string" }, "name": { "type": "string" } } }, "user.ChangePasswordRequest": { "type": "object", "required": [ "newPassword", "oldPassword" ], "properties": { "newPassword": { "type": "string" }, "oldPassword": { "type": "string" } } }, "user.ClaimResourceRequest": { "type": "object", "required": [ "image", "instanceType", "name", "providerId" ], "properties": { "cpu": { "type": "integer" }, "disk": { "type": "integer" }, "image": { "type": "string" }, "instanceType": { "type": "string" }, "memory": { "type": "integer" }, "name": { "type": "string" }, "providerId": { "type": "integer" } } }, "user.CreateInstanceRequest": { "type": "object", "required": [ "bandwidthId", "cpuId", "diskId", "imageId", "memoryId", "providerId" ], "properties": { "bandwidthId": { "description": "带宽规格ID", "type": "string" }, "cpuId": { "description": "CPU规格ID", "type": "string" }, "description": { "description": "描述信息", "type": "string" }, "diskId": { "description": "磁盘规格ID", "type": "string" }, "imageId": { "description": "镜像ID(从数据库获取)", "type": "integer" }, "memoryId": { "description": "内存规格ID", "type": "string" }, "providerId": { "description": "节点ID", "type": "integer" } } }, "user.DiskSpecResponse": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "sizeMB": { "type": "integer" } } }, "user.GetInstancePasswordResponse": { "type": "object", "properties": { "newPassword": { "type": "string" }, "resetTime": { "type": "integer" } } }, "user.InstanceActionRequest": { "type": "object", "required": [ "action", "instanceId" ], "properties": { "action": { "type": "string" }, "instanceId": { "type": "integer" } } }, "user.InstanceConfigResponse": { "type": "object", "properties": { "bandwidthSpecs": { "description": "可用带宽规格列表", "type": "array", "items": { "$ref": "#/definitions/user.BandwidthSpecResponse" } }, "cpuSpecs": { "description": "可用CPU规格列表", "type": "array", "items": { "$ref": "#/definitions/user.CPUSpecResponse" } }, "diskSpecs": { "description": "可用磁盘规格列表", "type": "array", "items": { "$ref": "#/definitions/user.DiskSpecResponse" } }, "images": { "description": "可用镜像列表(从数据库获取)", "type": "array", "items": { "$ref": "#/definitions/user.SystemImageResponse" } }, "memorySpecs": { "description": "可用内存规格列表", "type": "array", "items": { "$ref": "#/definitions/user.MemorySpecResponse" } } } }, "user.InstanceMonitoringResponse": { "type": "object", "properties": { "trafficData": { "description": "硬件监控已移除,只保留流量监控\nCPUUsage float64 `json:\"cpuUsage\"` // 已移除:硬件资源使用率监控\nMemoryUsage float64 `json:\"memoryUsage\"` // 已移除:硬件资源使用率监控\nDiskUsage float64 `json:\"diskUsage\"` // 已移除:硬件资源使用率监控\nNetworkIn int64 `json:\"networkIn\"` // 已移除:网络接收速率\nNetworkOut int64 `json:\"networkOut\"` // 已移除:网络发送速率", "allOf": [ { "$ref": "#/definitions/user.TrafficData" } ] } } }, "user.MemorySpecResponse": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "sizeMB": { "type": "integer" } } }, "user.ResetInstancePasswordRequest": { "type": "object" }, "user.ResetInstancePasswordResponse": { "type": "object", "properties": { "taskId": { "type": "integer" } } }, "user.ResetPasswordRequest": { "type": "object" }, "user.SystemImageResponse": { "type": "object", "properties": { "architecture": { "type": "string" }, "description": { "type": "string" }, "displayName": { "type": "string" }, "id": { "type": "integer" }, "imageUrl": { "type": "string" }, "instanceType": { "type": "string" }, "isActive": { "type": "boolean" }, "minDiskMB": { "type": "integer" }, "minMemoryMB": { "type": "integer" }, "name": { "type": "string" }, "osType": { "type": "string" }, "providerType": { "type": "string" }, "useCdn": { "type": "boolean" }, "version": { "type": "string" } } }, "user.TrafficData": { "type": "object", "properties": { "currentMonth": { "description": "当月已使用流量(MB)", "type": "integer" }, "history": { "description": "历史流量数据", "type": "array", "items": { "$ref": "#/definitions/user.TrafficHistoryItem" } }, "isLimited": { "description": "是否因流量超限被限制", "type": "boolean" }, "limitReason": { "description": "流量限制原因描述", "type": "string" }, "limitType": { "description": "流量限制类型: user, provider, both, unknown", "type": "string" }, "totalLimit": { "description": "流量限制(MB)", "type": "integer" }, "usagePercent": { "description": "使用百分比", "type": "number" } } }, "user.TrafficHistoryItem": { "type": "object", "properties": { "lastSync": { "description": "最后同步时间", "type": "string" }, "month": { "description": "月份", "type": "integer" }, "totalUsed": { "description": "总使用流量(MB)", "type": "integer" }, "trafficIn": { "description": "入站流量(MB)", "type": "integer" }, "trafficOut": { "description": "出站流量(MB)", "type": "integer" }, "year": { "description": "年份", "type": "integer" } } }, "user.UpdateProfileRequest": { "type": "object", "properties": { "email": { "type": "string" }, "nickname": { "type": "string" }, "phone": { "type": "string" }, "telegram": { "type": "string" } } }, "user.UserInstanceDetailResponse": { "type": "object", "properties": { "bandwidth": { "type": "integer" }, "cpu": { "type": "integer" }, "createdAt": { "type": "string" }, "disk": { "type": "integer" }, "expiredAt": { "type": "string" }, "id": { "type": "integer" }, "ipv4MappingType": { "description": "IPv4映射类型:nat(NAT共享IP), dedicated(独立IPv4地址) (已弃用,保留向后兼容)", "type": "string" }, "ipv6Address": { "description": "内网IPv6地址", "type": "string" }, "memory": { "type": "integer" }, "name": { "type": "string" }, "networkType": { "description": "网络配置类型:nat_ipv4, nat_ipv4_ipv6, dedicated_ipv4, dedicated_ipv4_ipv6, ipv6_only", "type": "string" }, "osType": { "type": "string" }, "password": { "type": "string" }, "portRangeEnd": { "description": "端口范围结束", "type": "integer" }, "portRangeStart": { "description": "端口范围起始", "type": "integer" }, "privateIP": { "description": "内网IPv4地址", "type": "string" }, "providerName": { "type": "string" }, "providerStatus": { "description": "Provider状态:active, inactive, partial", "type": "string" }, "publicIP": { "description": "公网IPv4地址", "type": "string" }, "publicIPv6": { "description": "公网IPv6地址", "type": "string" }, "sshPort": { "type": "integer" }, "status": { "type": "string" }, "type": { "type": "string" }, "username": { "type": "string" } } }, "user.UserLimitsResponse": { "type": "object", "properties": { "level": { "type": "integer" }, "maxBandwidth": { "description": "最大带宽(Mbps)", "type": "integer" }, "maxCpu": { "description": "最大CPU核心数", "type": "integer" }, "maxDisk": { "description": "最大磁盘(MB)", "type": "integer" }, "maxInstances": { "type": "integer" }, "maxMemory": { "description": "最大内存(MB)", "type": "integer" }, "maxTraffic": { "description": "最大流量(MB)", "type": "integer" }, "usedBandwidth": { "description": "已使用带宽(Mbps)", "type": "integer" }, "usedCpu": { "description": "已使用CPU核心数", "type": "integer" }, "usedDisk": { "description": "已使用磁盘(MB)", "type": "integer" }, "usedInstances": { "type": "integer" }, "usedMemory": { "description": "已使用内存(MB)", "type": "integer" }, "usedTraffic": { "description": "已使用流量(MB)", "type": "integer" } } } }, "securityDefinitions": { "BearerAuth": { "type": "apiKey", "name": "Authorization", "in": "header" } } }