From 6cabad31976a6531bdc703b26b589acdf7425320 Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 30 Aug 2026 14:17:51 +0800 Subject: [PATCH] fix(cordis): satisfy L2 test and swagger gates --- backend/docs/docs.go | 4088 +++++++++-------- backend/docs/swagger.json | 4088 +++++++++-------- backend/docs/swagger.yaml | 2771 +++++------ .../domain/admin/handler/auth_source.go | 69 +- backend/plugins/domain/auth/handlers.go | 72 + .../message_gateway/handler/push_channel.go | 62 +- .../message_gateway/handler/push_event.go | 85 +- backend/plugins/domain/system/plugin.go | 15 +- .../domain/upload/handler/file_management.go | 2 + backend/plugins/domain/user/handlers.go | 122 +- docs/changelog/index.md | 1 + docs/swagger.json | 4088 +++++++++-------- docs/swagger.yaml | 2771 +++++------ scripts/swagger.sh | 4 +- 14 files changed, 9896 insertions(+), 8342 deletions(-) diff --git a/backend/docs/docs.go b/backend/docs/docs.go index 8bb8140c..c33b94b8 100644 --- a/backend/docs/docs.go +++ b/backend/docs/docs.go @@ -57,7 +57,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/Wavelet_OpenFlare_plugins_server_cap.ChallengeResponse" + "$ref": "#/definitions/cap.ChallengeResponse" } } } @@ -109,7 +109,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/Wavelet_OpenFlare_plugins_server_cap.RedeemResponse" + "$ref": "#/definitions/cap.RedeemResponse" } } } @@ -182,22 +182,7 @@ const docTemplate = `{ "200": { "description": "认证源列表", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.AuthSource" - } - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "401": { @@ -244,7 +229,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/auth_source.AuthSourceRequest" + "$ref": "#/definitions/contracts.AuthSourceDTO" } } ], @@ -252,19 +237,7 @@ const docTemplate = `{ "200": { "description": "创建成功,返回认证源信息", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.AuthSource" - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "400": { @@ -321,7 +294,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/auth_source.AuthSourceRequest" + "$ref": "#/definitions/contracts.AuthSourceDTO" } } ], @@ -329,19 +302,7 @@ const docTemplate = `{ "200": { "description": "更新成功,返回更新后的认证源信息", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.AuthSource" - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "400": { @@ -460,15 +421,6 @@ const docTemplate = `{ "name": "id", "in": "path", "required": true - }, - { - "description": "启用状态", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/auth_source.ToggleAuthSourceRequest" - } } ], "responses": { @@ -579,7 +531,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/cache.updateCacheConfigRequest" + "$ref": "#/definitions/model.UpdateCacheConfigRequest" } } ], @@ -644,7 +596,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/diskcache.Status" + "$ref": "#/definitions/disk.Status" } } } @@ -742,7 +694,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/status.DatabaseInfoResponse" + "$ref": "#/definitions/model.DatabaseInfoResponse" } } } @@ -791,7 +743,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/db_manage.DBOverviewResponse" + "$ref": "#/definitions/model.DBOverviewResponse" } } } @@ -844,7 +796,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/db_manage.ExecuteSQLRequest" + "$ref": "#/definitions/model.ExecuteSQLRequest" } } ], @@ -860,7 +812,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/db_manage.ExecuteSQLResponse" + "$ref": "#/definitions/model.ExecuteSQLResponse" } } } @@ -995,7 +947,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/logs.logsResponse" + "$ref": "#/definitions/model.LogsResponse" } } } @@ -1024,7 +976,7 @@ const docTemplate = `{ "SessionCookie": [] } ], - "description": "分页并按照用户、接口路径、时间范围等维度检索用户访问日志列表(需要管理员权限,日志存储未启用时报错)", + "description": "分页并按照用户、接口路径、时间范围等维度检索用户访问日志列表(需要管理员权限)", "produces": [ "application/json" ], @@ -1084,7 +1036,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/logs.accessLogsResponse" + "$ref": "#/definitions/model.AccessLogsResponse" } } } @@ -1092,7 +1044,7 @@ const docTemplate = `{ } }, "400": { - "description": "日志存储未启用或参数错误", + "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } @@ -1108,6 +1060,12 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/response.Any" } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } } } } @@ -1119,7 +1077,7 @@ const docTemplate = `{ "SessionCookie": [] } ], - "description": "聚合统计最近 7 天的每日访问趋势、浏览器分布以及前 10 名最活跃用户排行(需要管理员权限,日志存储未启用时报错)", + "description": "聚合统计最近 7 天的每日访问趋势、浏览器分布以及前 10 名最活跃用户排行(需要管理员权限)", "produces": [ "application/json" ], @@ -1139,19 +1097,13 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/logs.logsAnalyticsResponse" + "$ref": "#/definitions/model.LogsAnalyticsResponse" } } } ] } }, - "400": { - "description": "日志存储未启用", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, "401": { "description": "未登录", "schema": { @@ -1163,6 +1115,12 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/response.Any" } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } } } } @@ -1177,6 +1135,295 @@ const docTemplate = `{ "responses": {} } }, + "/api/v1/admin/message-gateway/channels": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Returns all messaging channels; secrets are masked", + "produces": [ + "application/json" + ], + "tags": [ + "admin-message-gateway" + ], + "summary": "List message gateway channels", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.ChannelDTO" + } + } + } + } + ] + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Creates a Telegram or QQ channel with encrypted credentials", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "admin-message-gateway" + ], + "summary": "Create message gateway channel", + "parameters": [ + { + "description": "create body", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreateChannelRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ChannelDTO" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/admin/message-gateway/channels/definitions": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Returns form field definitions for Telegram and QQ channels", + "produces": [ + "application/json" + ], + "tags": [ + "admin-message-gateway" + ], + "summary": "List message gateway channel definitions", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.Definition" + } + } + } + } + ] + } + } + } + } + }, + "/api/v1/admin/message-gateway/channels/{id}": { + "delete": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Deletes a channel and cascaded bindings and pairing codes", + "produces": [ + "application/json" + ], + "tags": [ + "admin-message-gateway" + ], + "summary": "Delete message gateway channel", + "parameters": [ + { + "type": "integer", + "description": "channel id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "patch": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Updates a channel; empty secrets keep the current ciphertext", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "admin-message-gateway" + ], + "summary": "Update message gateway channel", + "parameters": [ + { + "type": "integer", + "description": "channel id", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "update body", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateChannelRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ChannelDTO" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/admin/message-gateway/channels/{id}/test": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Probes stored credentials without returning secrets", + "produces": [ + "application/json" + ], + "tags": [ + "admin-message-gateway" + ], + "summary": "Test message gateway channel", + "parameters": [ + { + "type": "integer", + "description": "channel id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, "/api/v1/admin/push/channels": { "get": { "security": [ @@ -1240,7 +1487,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/push.CreateChannelRequest" + "$ref": "#/definitions/model.CreatePushChannelRequest" } } ], @@ -1273,7 +1520,7 @@ const docTemplate = `{ "SessionCookie": [] } ], - "description": "返回系统支持的所有消息通道类型(如飞书、邮件、自定义、Telegram)的动态表单定义,需要管理员权限", + "description": "返回系统支持的所有消息通道类型的动态表单定义,需要管理员权限", "produces": [ "application/json" ], @@ -1285,22 +1532,7 @@ const docTemplate = `{ "200": { "description": "通道配置定义列表", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/push.Definition" - } - } - } - } - ] + "$ref": "#/definitions/response.Any" } } } @@ -1331,7 +1563,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/push.TestChannelRequest" + "$ref": "#/definitions/model.TestPushChannelRequest" } } ], @@ -1378,7 +1610,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/push.UpdateChannelRequest" + "$ref": "#/definitions/model.UpdatePushChannelRequest" } } ], @@ -1500,7 +1732,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/push.CreateEventRequest" + "$ref": "#/definitions/model.CreatePushEventRequest" } } ], @@ -1545,22 +1777,7 @@ const docTemplate = `{ "200": { "description": "内置通知事件列表", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/push.EventMetadata" - } - } - } - } - ] + "$ref": "#/definitions/response.Any" } } } @@ -1598,7 +1815,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/push.UpdateEventRequest" + "$ref": "#/definitions/model.UpdatePushEventRequest" } } ], @@ -1759,19 +1976,7 @@ const docTemplate = `{ "200": { "description": "推送历史列表", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/push.pushHistoriesResponse" - } - } - } - ] + "$ref": "#/definitions/response.Any" } } } @@ -1802,7 +2007,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/push.TestPushRequest" + "$ref": "#/definitions/model.TestPushRequest" } } ], @@ -1855,7 +2060,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/status.SystemStatusResponse" + "$ref": "#/definitions/model.SystemStatusResponse" } } } @@ -1904,7 +2109,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/status.LogDatabaseStatus" + "$ref": "#/definitions/model.LogDatabaseStatus" } } } @@ -1969,7 +2174,7 @@ const docTemplate = `{ "data": { "type": "array", "items": { - "$ref": "#/definitions/model.SystemConfig" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.SystemConfig" } } } @@ -2021,7 +2226,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/system_config.CreateSystemConfigRequest" + "$ref": "#/definitions/model.CreateSystemConfigRequest" } } ], @@ -2096,7 +2301,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/system_config.TestSMTPRequest" + "$ref": "#/definitions/model.TestSMTPRequest" } } ], @@ -2112,7 +2317,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/system_config.TestSMTPResponse" + "$ref": "#/definitions/model.TestSMTPResponse" } } } @@ -2164,7 +2369,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/model.SystemConfig" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.SystemConfig" } } } @@ -2228,7 +2433,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/system_config.UpdateSystemConfigRequest" + "$ref": "#/definitions/model.UpdateSystemConfigRequest" } } ], @@ -2309,7 +2514,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/task.DispatchTaskRequest" + "$ref": "#/definitions/model.DispatchTaskRequest" } } ], @@ -2387,18 +2592,6 @@ const docTemplate = `{ "name": "task_type", "in": "query" }, - { - "type": "string", - "description": "任务类型前缀筛选(与 task_type / task_types 互斥,精确类型优先)", - "name": "task_type_prefix", - "in": "query" - }, - { - "type": "string", - "description": "逗号分隔的精确任务类型列表(IN 筛选,优先于前缀)", - "name": "task_types", - "in": "query" - }, { "type": "integer", "default": 1, @@ -2484,7 +2677,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/model.TaskExecution" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.TaskExecution" } } } @@ -2601,7 +2794,7 @@ const docTemplate = `{ "SessionCookie": [] } ], - "description": "返回管理员可管理的定时任务配置列表,包括名称、关联的异步任务类型、Cron 表达式和启用状态;系统内部排程不会暴露,需要管理员权限", + "description": "返回系统所有的定时任务配置列表,包括名称、关联的异步任务类型、Cron 表达式和启用状态,需要管理员权限", "produces": [ "application/json" ], @@ -2623,7 +2816,7 @@ const docTemplate = `{ "data": { "type": "array", "items": { - "$ref": "#/definitions/model.Schedule" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.Schedule" } } } @@ -2669,7 +2862,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/task.CreateScheduleRequest" + "$ref": "#/definitions/model.CreateScheduleRequest" } } ], @@ -2685,7 +2878,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/model.Schedule" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.Schedule" } } } @@ -2751,7 +2944,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/task.UpdateScheduleRequest" + "$ref": "#/definitions/model.UpdateScheduleRequest" } } ], @@ -2767,7 +2960,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/model.Schedule" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.Schedule" } } } @@ -2866,12 +3059,6 @@ const docTemplate = `{ "$ref": "#/definitions/response.Any" } }, - "404": { - "description": "定时任务不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, "500": { "description": "删除定时任务失败", "schema": { @@ -2910,7 +3097,7 @@ const docTemplate = `{ "data": { "type": "array", "items": { - "$ref": "#/definitions/task.TaskMeta" + "$ref": "#/definitions/contracts.TaskMetaDTO" } } } @@ -2962,7 +3149,7 @@ const docTemplate = `{ "data": { "type": "array", "items": { - "$ref": "#/definitions/model.Template" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.Template" } } } @@ -3014,7 +3201,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/template.CreateTemplateRequest" + "$ref": "#/definitions/model.CreateTemplateRequest" } } ], @@ -3100,7 +3287,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/model.Template" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.Template" } } } @@ -3164,7 +3351,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/template.UpdateTemplateRequest" + "$ref": "#/definitions/model.UpdateTemplateRequest" } } ], @@ -3180,7 +3367,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/model.Template" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.Template" } } } @@ -3321,7 +3508,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/updater.Status" + "$ref": "#/definitions/model.UpdaterStatus" } } } @@ -3446,8 +3633,7 @@ const docTemplate = `{ }, { "type": "integer", - "format": "int64", - "description": "上传用户 ID", + "description": "上传用户 ID 过滤", "name": "user_id", "in": "query" } @@ -3471,14 +3657,8 @@ const docTemplate = `{ ] } }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", + "400": { + "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } @@ -3595,6 +3775,127 @@ const docTemplate = `{ } } }, + "/api/v1/admin/uploads/files": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "分页获取系统上传的文件列表,支持文件名关键词、业务类型、扩展名、上传用户ID过滤", + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "获取文件列表", + "parameters": [ + { + "type": "integer", + "description": "页码(默认 1)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页数量(默认 20,最大 100)", + "name": "page_size", + "in": "query" + }, + { + "type": "string", + "description": "文件名关键词(模糊匹配)", + "name": "keyword", + "in": "query" + }, + { + "type": "string", + "description": "业务分类过滤", + "name": "type", + "in": "query" + }, + { + "type": "string", + "description": "扩展名过滤", + "name": "extension", + "in": "query" + }, + { + "type": "integer", + "description": "上传用户 ID 过滤", + "name": "user_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "查询成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handler.listFilesResponse" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/admin/uploads/files/{id}": { + "delete": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "将指定 ID 的文件状态置为 deleted(软删除)", + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "删除文件", + "parameters": [ + { + "type": "string", + "description": "文件 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "文件不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, "/api/v1/admin/uploads/stats": { "get": { "security": [ @@ -3657,17 +3958,17 @@ const docTemplate = `{ "SessionCookie": [] } ], - "description": "返回数据库中所有已上传文件实际拥有的业务类型列表", + "description": "查询系统内所有不重复的上传业务分类标识(如 avatar, doc 等)", "produces": [ "application/json" ], "tags": [ "admin" ], - "summary": "获取文件业务类型列表", + "summary": "获取业务分类列表", "responses": { "200": { - "description": "业务类型列表", + "description": "查询成功", "schema": { "allOf": [ { @@ -3686,24 +3987,6 @@ const docTemplate = `{ } ] } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } } } } @@ -3715,7 +3998,7 @@ const docTemplate = `{ "SessionCookie": [] } ], - "description": "将文件状态置为 deleted(软删除),不会立即清理底层存储对象", + "description": "将指定 ID 的文件状态置为 deleted(软删除)", "produces": [ "application/json" ], @@ -3739,23 +4022,11 @@ const docTemplate = `{ "$ref": "#/definitions/response.Any" } }, - "403": { - "description": "无权操作", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, "404": { "description": "文件不存在", "schema": { "$ref": "#/definitions/response.Any" } - }, - "409": { - "description": "系统保留类型或存储只读", - "schema": { - "$ref": "#/definitions/response.Any" - } } } } @@ -3817,7 +4088,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/user.listUsersResponse" + "$ref": "#/definitions/model.ListUsersResponse" } } } @@ -3874,7 +4145,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/user.createUserRequest" + "$ref": "#/definitions/model.CreateUserRequest" } } ], @@ -3890,7 +4161,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/user.user" + "$ref": "#/definitions/model.UserResponse" } } } @@ -3960,7 +4231,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/user.user" + "$ref": "#/definitions/model.UserResponse" } } } @@ -4030,7 +4301,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/user.updateUserRequest" + "$ref": "#/definitions/model.UpdateUserRequest" } } ], @@ -4192,7 +4463,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/user.updateUserStatusRequest" + "$ref": "#/definitions/model.UpdateUserStatusRequest" } } ], @@ -12905,6 +13176,205 @@ const docTemplate = `{ } } }, + "/api/v1/message-gateway/bindings": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Returns the current user's bound messaging channels", + "produces": [ + "application/json" + ], + "tags": [ + "message-gateway" + ], + "summary": "List message gateway bindings", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.BindingDTO" + } + } + } + } + ] + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Binds the current user to a platform identity using a one-time pairing code", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "message-gateway" + ], + "summary": "Bind a messaging channel", + "parameters": [ + { + "description": "bind body", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.BindRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.BindingDTO" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "409": { + "description": "Conflict", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/message-gateway/bindings/{id}": { + "delete": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Removes a binding owned by the current user", + "produces": [ + "application/json" + ], + "tags": [ + "message-gateway" + ], + "summary": "Unbind a messaging channel", + "parameters": [ + { + "type": "integer", + "description": "binding id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/message-gateway/channels": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Returns enabled system bots the current user can pair with", + "produces": [ + "application/json" + ], + "tags": [ + "message-gateway" + ], + "summary": "List enabled messaging channels", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.PublicChannelDTO" + } + } + } + } + ] + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, "/api/v1/oauth/callback": { "post": { "description": "接收前端传回的 state 和 code,完成 OAuth/OIDC 认证并建立会话。支持登录(login)和账号绑定(bind)两种场景。", @@ -12925,7 +13395,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/oauth.CallbackRequest" + "$ref": "#/definitions/auth.CallbackRequest" } } ], @@ -12941,7 +13411,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/oauth.OAuthCallbackResult" + "$ref": "#/definitions/auth.OAuthCallbackResult" } } } @@ -12988,22 +13458,7 @@ const docTemplate = `{ "200": { "description": "外部帐号列表", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.ExternalAccountView" - } - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "401": { @@ -13110,7 +13565,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/oauth.OAuthAuthorizeResponse" + "$ref": "#/definitions/auth.OAuthAuthorizeResponse" } } } @@ -13124,7 +13579,7 @@ const docTemplate = `{ } }, "500": { - "description": "Redis 异常 or 构造 URL 失败", + "description": "构造 URL 失败", "schema": { "$ref": "#/definitions/response.Any" } @@ -13199,7 +13654,7 @@ const docTemplate = `{ "data": { "type": "array", "items": { - "$ref": "#/definitions/oauth.AuthSourceView" + "$ref": "#/definitions/auth.AuthSourceView" } } } @@ -13217,7 +13672,7 @@ const docTemplate = `{ "SessionCookie": [] } ], - "description": "返回当前登录用户的基本信息及余额数据,需要登录。包括用户 ID、用户名、信任等级、各类余额信息等。", + "description": "返回当前登录用户的基本信息,需要登录。", "produces": [ "application/json" ], @@ -13237,7 +13692,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/oauth.BasicUserInfo" + "$ref": "#/definitions/auth.BasicUserInfo" } } } @@ -13290,7 +13745,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/oauth.OAuthAuthorizeResponse" + "$ref": "#/definitions/auth.OAuthAuthorizeResponse" } } } @@ -13304,7 +13759,7 @@ const docTemplate = `{ } }, "500": { - "description": "Redis 异常或构造 URL 失败", + "description": "构造 URL 失败", "schema": { "$ref": "#/definitions/response.Any" } @@ -13681,7 +14136,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/model.Upload" + "$ref": "#/definitions/models.Upload" } } } @@ -13700,12 +14155,6 @@ const docTemplate = `{ "$ref": "#/definitions/response.Any" } }, - "409": { - "description": "系统保留类型或存储只读", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, "500": { "description": "内部错误", "schema": { @@ -13838,7 +14287,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/model.Upload" + "$ref": "#/definitions/models.Upload" } } } @@ -13900,12 +14349,6 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/response.Any" } - }, - "409": { - "description": "系统保留类型或存储只读", - "schema": { - "$ref": "#/definitions/response.Any" - } } } } @@ -13917,7 +14360,7 @@ const docTemplate = `{ "SessionCookie": [] } ], - "description": "返回当前登录用户的基本信息及余额数据,需要登录。包括用户 ID、用户名、信任等级、各类余额信息等。", + "description": "返回当前登录用户的基本信息,需要登录。", "produces": [ "application/json" ], @@ -13937,7 +14380,7 @@ const docTemplate = `{ "type": "object", "properties": { "data": { - "$ref": "#/definitions/oauth.BasicUserInfo" + "$ref": "#/definitions/auth.BasicUserInfo" } } } @@ -13982,7 +14425,7 @@ const docTemplate = `{ "data": { "type": "array", "items": { - "$ref": "#/definitions/model.AccessToken" + "$ref": "#/definitions/user.AccessToken" } } } @@ -14004,7 +14447,7 @@ const docTemplate = `{ "SessionCookie": [] } ], - "description": "为当前用户新建一个 API 访问令牌,仅在此接口返回一次明文令牌值,请妥善保存。可通过 is_admin 字段赋予令牌管理员权限(仅管理员用户可设置)。", + "description": "为当前用户新建一个 API 访问令牌,仅在此接口返回一次明文令牌值,请妥善保存。", "consumes": [ "application/json" ], @@ -14022,7 +14465,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/user.createTokenRequest" + "$ref": "#/definitions/user.createAccessTokenRequest" } } ], @@ -14030,19 +14473,7 @@ const docTemplate = `{ "200": { "description": "新建令牌成功", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/user.tokenResponse" - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "400": { @@ -14134,19 +14565,7 @@ const docTemplate = `{ "200": { "description": "令牌轮换成功", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/user.tokenResponse" - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "400": { @@ -14160,7 +14579,7 @@ const docTemplate = `{ }, "/api/v1/user/change-password": { "post": { - "description": "修改当前登录用户的密码。修改成功后,如果是首次明文登录的升级提示,则清除修改密码的提示状态。", + "description": "修改当前登录用户的密码。", "consumes": [ "application/json" ], @@ -14244,19 +14663,7 @@ const docTemplate = `{ "200": { "description": "登录成功,返回用户信息", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/oauth.BasicUserInfo" - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "400": { @@ -14319,7 +14726,7 @@ const docTemplate = `{ }, "/api/v1/user/profile": { "put": { - "description": "修改当前登录用户的昵称、邮箱、头像、简介、电话、性别、个人网站和所在地。", + "description": "修改当前登录用户的昵称、头像、简介、电话、性别、个人网站和所在地。", "consumes": [ "application/json" ], @@ -14345,23 +14752,11 @@ const docTemplate = `{ "200": { "description": "修改成功,返回更新后的用户信息", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/oauth.BasicUserInfo" - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "400": { - "description": "邮箱已被占用或参数错误", + "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } @@ -14377,7 +14772,7 @@ const docTemplate = `{ }, "/api/v1/user/register": { "post": { - "description": "使用用户名和密码注册新账号,注册成功后自动登录并建立 Session。密码长度不能少于 8 位。", + "description": "使用用户名和密码注册新账号,注册成功后自动登录并建立 Session。", "consumes": [ "application/json" ], @@ -14403,19 +14798,7 @@ const docTemplate = `{ "200": { "description": "注册并登录成功,返回用户信息", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/oauth.BasicUserInfo" - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "400": { @@ -14440,31 +14823,19 @@ const docTemplate = `{ "SessionCookie": [] } ], - "description": "返回当前登录用户的基本信息及余额数据,需要登录。包括用户 ID、用户名、信任等级、各类余额信息等。", + "description": "返回当前登录用户的基本信息,需要登录。", "produces": [ "application/json" ], "tags": [ - "oauth" + "user" ], "summary": "获取当前登录用户信息", "responses": { "200": { "description": "用户信息", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/oauth.BasicUserInfo" - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "401": { @@ -14489,17 +14860,6 @@ const docTemplate = `{ "user" ], "summary": "发送邮箱验证码", - "parameters": [ - { - "description": "发送验证码请求参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/user.sendEmailCodeRequest" - } - } - ], "responses": { "200": { "description": "发送成功", @@ -14597,79 +14957,6 @@ const docTemplate = `{ } }, "definitions": { - "Wavelet_OpenFlare_plugins_server_cap.ChallengeResponse": { - "type": "object", - "properties": { - "challenge": { - "type": "object", - "properties": { - "c": { - "type": "integer" - }, - "d": { - "type": "integer" - }, - "s": { - "type": "integer" - } - } - }, - "expires": { - "description": "ms timestamp", - "type": "integer" - }, - "token": { - "type": "string" - } - } - }, - "Wavelet_OpenFlare_plugins_server_cap.RedeemResponse": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "expires": { - "type": "integer" - }, - "success": { - "type": "boolean" - }, - "token": { - "type": "string" - } - } - }, - "Wavelet_OpenFlare_plugins_server_model_analytics.ClickHouseOperationalStats": { - "type": "object", - "properties": { - "active_parts": { - "type": "integer" - }, - "async_insert_bytes": { - "type": "integer" - }, - "async_insert_queue": { - "type": "integer" - }, - "batch_writers": { - "description": "BatchWriters reports in-process queue depth/drops/flush errors for CH writers.", - "type": "array", - "items": { - "$ref": "#/definitions/analytics.BatchWriterStats" - } - }, - "database": { - "type": "string" - }, - "pending_mutations": { - "type": "integer" - }, - "total_rows": { - "type": "integer" - } - } - }, "Wavelet_OpenFlare_share_protocol.ActiveConfigMeta": { "type": "object", "properties": { @@ -14907,6 +15194,157 @@ const docTemplate = `{ } } }, + "Wavelet_plugins_domain_admin_model.Schedule": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "cron": { + "type": "string" + }, + "id": { + "type": "string", + "example": "0" + }, + "is_active": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "payload": { + "type": "string" + }, + "task_type": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "Wavelet_plugins_domain_admin_model.SystemConfig": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "description": { + "type": "string" + }, + "key": { + "type": "string" + }, + "type": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "value": { + "type": "string" + }, + "visibility": { + "type": "integer" + } + } + }, + "Wavelet_plugins_domain_admin_model.TaskExecution": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "duration": { + "type": "integer" + }, + "error_message": { + "type": "string" + }, + "finished_at": { + "type": "string" + }, + "id": { + "type": "string", + "example": "0" + }, + "log": { + "type": "string" + }, + "max_retry": { + "type": "integer" + }, + "payload": { + "type": "string" + }, + "result": { + "type": "string" + }, + "retry_count": { + "type": "integer" + }, + "retryable": { + "type": "boolean" + }, + "started_at": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/model.TaskExecutionStatus" + }, + "task_id": { + "type": "string" + }, + "task_name": { + "type": "string" + }, + "task_type": { + "type": "string" + }, + "triggered_by": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "Wavelet_plugins_domain_admin_model.Template": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "description": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "is_system": { + "type": "boolean" + }, + "key": { + "type": "string" + }, + "name": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "type": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, "agent.ActiveConfigMeta": { "type": "object", "properties": { @@ -15166,29 +15604,6 @@ const docTemplate = `{ } } }, - "analytics.BatchWriterStats": { - "type": "object", - "properties": { - "cap": { - "type": "integer" - }, - "depth": { - "type": "integer" - }, - "drops": { - "type": "integer" - }, - "flush_errors": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "running": { - "type": "boolean" - } - } - }, "apply_log.CleanupInput": { "type": "object", "properties": { @@ -15237,14 +15652,11 @@ const docTemplate = `{ } } }, - "auth_source.AuthSourceRequest": { + "auth.AuthSourceView": { "type": "object", "properties": { - "client_id": { - "type": "string" - }, - "client_secret": { - "type": "string" + "client_secret_configured": { + "type": "boolean" }, "display_name": { "type": "string" @@ -15252,48 +15664,135 @@ const docTemplate = `{ "icon_url": { "type": "string" }, + "id": { + "type": "integer" + }, "is_active": { "type": "boolean" }, "name": { "type": "string" }, - "openid_discovery_url": { - "type": "string" - }, - "scopes": { - "type": "string" - }, "type": { "type": "string" } } }, - "auth_source.ToggleAuthSourceRequest": { + "auth.BasicUserInfo": { "type": "object", "properties": { - "is_active": { + "avatar_url": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "email": { + "type": "string" + }, + "gender": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "is_admin": { "type": "boolean" + }, + "location": { + "type": "string" + }, + "need_change_password": { + "type": "boolean" + }, + "nickname": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "username": { + "type": "string" + }, + "website": { + "type": "string" } } }, - "cache.updateCacheConfigRequest": { + "auth.CallbackRequest": { "type": "object", "required": [ - "max_size_mb", - "ttl_minutes" + "code", + "state" ], "properties": { - "lru_enabled": { + "code": { + "type": "string" + }, + "state": { + "type": "string" + } + } + }, + "auth.OAuthAuthorizeResponse": { + "type": "object", + "properties": { + "authorize_url": { + "type": "string" + } + } + }, + "auth.OAuthCallbackResult": { + "type": "object", + "properties": { + "status": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/auth.BasicUserInfo" + } + } + }, + "cap.ChallengeResponse": { + "type": "object", + "properties": { + "challenge": { + "type": "object", + "properties": { + "c": { + "type": "integer" + }, + "d": { + "type": "integer" + }, + "s": { + "type": "integer" + } + } + }, + "expires": { + "description": "ms timestamp", + "type": "integer" + }, + "token": { + "type": "string" + } + } + }, + "cap.RedeemResponse": { + "type": "object", + "properties": { + "error": { + "type": "string" + }, + "expires": { + "type": "integer" + }, + "success": { "type": "boolean" }, - "max_size_mb": { - "type": "integer", - "minimum": 1 - }, - "ttl_minutes": { - "type": "integer", - "minimum": 0 + "token": { + "type": "string" } } }, @@ -15692,6 +16191,119 @@ const docTemplate = `{ } } }, + "contracts.AuthSourceDTO": { + "type": "object", + "properties": { + "client_id": { + "type": "string" + }, + "client_secret": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "display_name": { + "type": "string" + }, + "icon_url": { + "type": "string" + }, + "id": { + "type": "string", + "example": "0" + }, + "is_active": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "openid_discovery_url": { + "type": "string" + }, + "scopes": { + "type": "string" + }, + "type": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "contracts.TaskMetaDTO": { + "type": "object", + "properties": { + "asynq_task": { + "type": "string" + }, + "category": { + "type": "string" + }, + "description": { + "type": "string" + }, + "display_name": { + "type": "string" + }, + "max_retry": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/contracts.TaskParamDTO" + } + }, + "queue": { + "type": "string" + }, + "retryable": { + "type": "boolean" + }, + "schedule": { + "type": "string" + }, + "supports_time": { + "type": "boolean" + }, + "timeout": { + "$ref": "#/definitions/time.Duration" + }, + "type": { + "type": "string" + } + } + }, + "contracts.TaskParamDTO": { + "type": "object", + "properties": { + "default": {}, + "description": { + "type": "string" + }, + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "placeholder": { + "type": "string" + }, + "required": { + "type": "boolean" + }, + "type": { + "type": "string" + } + } + }, "dashboard.Capacity": { "type": "object", "properties": { @@ -15839,69 +16451,7 @@ const docTemplate = `{ } } }, - "db_manage.DBOverviewResponse": { - "type": "object", - "properties": { - "connections": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "size": { - "type": "string" - }, - "table_count": { - "type": "integer" - }, - "type": { - "type": "string" - }, - "version": { - "type": "string" - } - } - }, - "db_manage.ExecuteSQLRequest": { - "type": "object", - "required": [ - "sql" - ], - "properties": { - "sql": { - "type": "string" - } - } - }, - "db_manage.ExecuteSQLResponse": { - "type": "object", - "properties": { - "affected_rows": { - "type": "integer" - }, - "columns": { - "type": "array", - "items": { - "type": "string" - } - }, - "execution_time_ms": { - "type": "integer" - }, - "results": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": {} - } - }, - "type": { - "description": "\"select\" 或 \"exec\"", - "type": "string" - } - } - }, - "diskcache.Status": { + "disk.Status": { "type": "object", "properties": { "base_path": { @@ -16080,7 +16630,7 @@ const docTemplate = `{ "items": { "type": "array", "items": { - "$ref": "#/definitions/model.Upload" + "$ref": "#/definitions/models.Upload" } }, "page": { @@ -16100,7 +16650,7 @@ const docTemplate = `{ "items": { "type": "array", "items": { - "$ref": "#/definitions/model.Upload" + "$ref": "#/definitions/models.Upload" } }, "page": { @@ -16157,7 +16707,7 @@ const docTemplate = `{ } } }, - "logs.accessLogItem": { + "model.AccessLogItem": { "type": "object", "properties": { "created_at": { @@ -16188,6 +16738,9 @@ const docTemplate = `{ "status": { "type": "integer" }, + "trace_id": { + "type": "string" + }, "user_agent": { "type": "string" }, @@ -16200,13 +16753,13 @@ const docTemplate = `{ } } }, - "logs.accessLogsResponse": { + "model.AccessLogsResponse": { "type": "object", "properties": { "list": { "type": "array", "items": { - "$ref": "#/definitions/logs.accessLogItem" + "$ref": "#/definitions/model.AccessLogItem" } }, "total": { @@ -16214,113 +16767,6 @@ const docTemplate = `{ } } }, - "logs.browserItem": { - "type": "object", - "properties": { - "browser": { - "type": "string" - }, - "count": { - "type": "integer" - } - } - }, - "logs.logsAnalyticsResponse": { - "type": "object", - "properties": { - "browsers": { - "type": "array", - "items": { - "$ref": "#/definitions/logs.browserItem" - } - }, - "top_users": { - "type": "array", - "items": { - "$ref": "#/definitions/logs.topUserItem" - } - }, - "trend": { - "type": "array", - "items": { - "$ref": "#/definitions/logs.trendItem" - } - } - } - }, - "logs.logsResponse": { - "type": "object", - "properties": { - "has_more": { - "type": "boolean" - }, - "lines": { - "type": "array", - "items": { - "$ref": "#/definitions/logger.LogEntry" - } - }, - "next_cursor": { - "description": "用于加载更早日志的 cursor", - "type": "integer" - } - } - }, - "logs.topUserItem": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "nickname": { - "type": "string" - }, - "user_id": { - "type": "string", - "example": "0" - }, - "username": { - "type": "string" - } - } - }, - "logs.trendItem": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "date": { - "type": "string" - } - } - }, - "model.AccessToken": { - "type": "object", - "properties": { - "created_at": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "is_admin": { - "type": "boolean" - }, - "masked_token": { - "type": "string" - }, - "name": { - "type": "string" - }, - "updated_at": { - "type": "string" - }, - "user_id": { - "type": "integer" - } - } - }, "model.AcmeAccount": { "type": "object", "properties": { @@ -16341,44 +16787,91 @@ const docTemplate = `{ } } }, - "model.AuthSource": { + "model.BindRequest": { "type": "object", "properties": { - "client_id": { + "channel_id": { "type": "string" }, - "client_secret_configured": { - "type": "boolean" + "code": { + "type": "string" + } + } + }, + "model.BindingDTO": { + "type": "object", + "properties": { + "channel_id": { + "type": "string", + "example": "0" + }, + "channel_name": { + "type": "string" + }, + "channel_type": { + "type": "string" }, "created_at": { "type": "string" }, - "display_name": { + "id": { + "type": "string", + "example": "0" + }, + "platform_user_id": { "type": "string" }, - "icon_url": { + "user_id": { + "type": "string", + "example": "0" + } + } + }, + "model.BrowserItem": { + "type": "object", + "properties": { + "browser": { "type": "string" }, + "count": { + "type": "integer" + } + } + }, + "model.ChannelDTO": { + "type": "object", + "properties": { + "credentials": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "enabled": { + "type": "boolean" + }, + "extra": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, "id": { - "type": "integer" - }, - "is_active": { - "type": "boolean" + "type": "string", + "example": "0" }, "name": { "type": "string" }, - "openid_discovery_url": { - "type": "string" + "owner_id": { + "type": "string", + "example": "0" }, - "scopes": { + "owner_scope": { "type": "string" }, "type": { "type": "string" - }, - "updated_at": { - "type": "string" } } }, @@ -16440,6 +16933,243 @@ const docTemplate = `{ } } }, + "model.CreateChannelRequest": { + "type": "object", + "properties": { + "credentials": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "enabled": { + "type": "boolean" + }, + "extra": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "model.CreatePushChannelRequest": { + "type": "object", + "required": [ + "name", + "type" + ], + "properties": { + "description": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "other": { + "type": "string" + }, + "token": { + "type": "string" + }, + "type": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, + "model.CreatePushEventRequest": { + "type": "object", + "properties": { + "channels": { + "type": "array", + "items": { + "type": "string" + } + }, + "enabled": { + "type": "boolean" + }, + "event_key": { + "type": "string" + }, + "targets": { + "type": "array", + "items": { + "type": "string" + } + }, + "task_type": { + "type": "string" + }, + "template": { + "type": "string" + } + } + }, + "model.CreateScheduleRequest": { + "type": "object", + "required": [ + "cron", + "is_active", + "name", + "task_type" + ], + "properties": { + "cron": { + "type": "string" + }, + "is_active": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "payload": { + "type": "string" + }, + "task_type": { + "type": "string" + } + } + }, + "model.CreateSystemConfigRequest": { + "type": "object", + "required": [ + "key", + "type", + "value" + ], + "properties": { + "description": { + "type": "string", + "maxLength": 255 + }, + "key": { + "type": "string", + "maxLength": 64 + }, + "type": { + "type": "string", + "enum": [ + "system", + "business" + ] + }, + "value": { + "type": "string" + }, + "visibility": { + "type": "integer", + "enum": [ + 0, + 1 + ] + } + } + }, + "model.CreateTemplateRequest": { + "type": "object", + "required": [ + "content", + "key", + "name", + "type" + ], + "properties": { + "content": { + "type": "string" + }, + "description": { + "type": "string", + "maxLength": 255 + }, + "key": { + "type": "string", + "maxLength": 80 + }, + "name": { + "type": "string", + "maxLength": 100 + }, + "subject": { + "type": "string", + "maxLength": 255 + }, + "type": { + "type": "string", + "maxLength": 20 + } + } + }, + "model.CreateUserRequest": { + "type": "object", + "required": [ + "email", + "password", + "username" + ], + "properties": { + "email": { + "type": "string", + "maxLength": 255 + }, + "is_active": { + "type": "boolean" + }, + "is_admin": { + "type": "boolean" + }, + "nickname": { + "type": "string", + "maxLength": 64 + }, + "password": { + "type": "string", + "maxLength": 64, + "minLength": 8 + }, + "username": { + "type": "string", + "maxLength": 64, + "minLength": 3 + } + } + }, + "model.DBOverviewResponse": { + "type": "object", + "properties": { + "connections": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "size": { + "type": "string" + }, + "table_count": { + "type": "integer" + }, + "type": { + "type": "string" + }, + "version": { + "type": "string" + } + } + }, "model.DNSAccount": { "type": "object", "properties": { @@ -16460,31 +17190,184 @@ const docTemplate = `{ } } }, - "model.ExternalAccountView": { + "model.DatabaseInfoResponse": { "type": "object", "properties": { - "auth_source_id": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "version": { + "type": "string" + } + } + }, + "model.Definition": { + "type": "object", + "properties": { + "fields": { + "type": "array", + "items": { + "$ref": "#/definitions/model.Field" + } + }, + "type": { + "type": "string" + } + } + }, + "model.DispatchTaskRequest": { + "type": "object", + "required": [ + "task_type" + ], + "properties": { + "end_time": { + "type": "string" + }, + "payload": { + "type": "string" + }, + "start_time": { + "type": "string" + }, + "task_type": { + "type": "string" + }, + "user_id": { + "type": "integer" + } + } + }, + "model.ExecuteSQLRequest": { + "type": "object", + "required": [ + "sql" + ], + "properties": { + "sql": { + "type": "string" + } + } + }, + "model.ExecuteSQLResponse": { + "type": "object", + "properties": { + "affected_rows": { "type": "integer" }, - "auth_source_label": { + "columns": { + "type": "array", + "items": { + "type": "string" + } + }, + "execution_time_ms": { + "type": "integer" + }, + "results": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "type": { + "description": "\"select\" 或 \"exec\"", + "type": "string" + } + } + }, + "model.Field": { + "type": "object", + "properties": { + "key": { "type": "string" }, - "auth_source_name": { + "required": { + "type": "boolean" + }, + "type": { + "type": "string" + } + } + }, + "model.ListUsersResponse": { + "type": "object", + "properties": { + "total": { + "type": "integer" + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/model.UserResponse" + } + } + } + }, + "model.LogDatabaseStatus": { + "type": "object", + "properties": { + "active_database": { "type": "string" }, - "auth_source_type": { + "available_targets": { + "type": "array", + "items": { + "type": "string" + } + }, + "migration": { "type": "string" }, - "created_at": { - "type": "string" + "retention_days": { + "type": "object", + "additionalProperties": { + "type": "integer" + } + } + } + }, + "model.LogsAnalyticsResponse": { + "type": "object", + "properties": { + "browsers": { + "type": "array", + "items": { + "$ref": "#/definitions/model.BrowserItem" + } }, - "email": { - "type": "string" + "top_users": { + "type": "array", + "items": { + "$ref": "#/definitions/model.TopUserItem" + } }, - "external_username": { - "type": "string" + "trend": { + "type": "array", + "items": { + "$ref": "#/definitions/model.TrendItem" + } + } + } + }, + "model.LogsResponse": { + "type": "object", + "properties": { + "has_more": { + "type": "boolean" }, - "id": { + "lines": { + "type": "array", + "items": { + "$ref": "#/definitions/logger.LogEntry" + } + }, + "next_cursor": { + "description": "用于加载更早日志的 cursor", "type": "integer" } } @@ -16733,6 +17616,21 @@ const docTemplate = `{ } } }, + "model.PublicChannelDTO": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "0" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, "model.PushChannel": { "type": "object", "properties": { @@ -16740,37 +17638,30 @@ const docTemplate = `{ "type": "string" }, "description": { - "description": "备注", "type": "string" }, "enabled": { - "description": "通道是否启用", "type": "boolean" }, "id": { "type": "integer" }, "name": { - "description": "通道名称,仅英文字母和下划线,唯一", "type": "string" }, "other": { - "description": "请求体/SMTP 密码等", "type": "string" }, "token": { - "description": "鉴权令牌或发信用户名等", "type": "string" }, "type": { - "description": "通道类型:custom, lark, email", "type": "string" }, "updated_at": { "type": "string" }, "url": { - "description": "请求地址,HTTPS 协议或 SMTP 地址", "type": "string" } } @@ -16779,7 +17670,6 @@ const docTemplate = `{ "type": "object", "properties": { "channels": { - "description": "推送渠道列表,如 [\"lark\"]", "type": "array", "items": { "type": "string" @@ -16789,33 +17679,27 @@ const docTemplate = `{ "type": "string" }, "enabled": { - "description": "是否启用", "type": "boolean" }, "event_key": { - "description": "如 admin_login", "type": "string" }, "id": { "type": "integer" }, "name": { - "description": "如 管理员登录", "type": "string" }, "targets": { - "description": "推送目标用户/邮箱列表", "type": "array", "items": { "type": "string" } }, "task_type": { - "description": "关联的异步任务类型", "type": "string" }, "template": { - "description": "消息模板 JSON", "type": "string" }, "updated_at": { @@ -16823,95 +17707,92 @@ const docTemplate = `{ } } }, - "model.PushHistory": { + "model.SystemStatusResponse": { "type": "object", "properties": { - "channel": { + "alloc": { "type": "string" }, - "content": { + "buck_hash_sys": { "type": "string" }, - "created_at": { - "type": "string" - }, - "error_msg": { - "type": "string" - }, - "event_key": { - "type": "string" - }, - "id": { + "frees": { "type": "integer" }, - "level": { + "gc_sys": { "type": "string" }, - "status": { - "description": "success / failed", + "heap_alloc": { "type": "string" }, - "target": { + "heap_idle": { "type": "string" }, - "title": { - "type": "string" - } - } - }, - "model.Schedule": { - "type": "object", - "properties": { - "created_at": { + "heap_inuse": { "type": "string" }, - "cron": { - "type": "string" - }, - "id": { - "type": "string", - "example": "0" - }, - "is_active": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "payload": { - "type": "string" - }, - "task_type": { - "type": "string" - }, - "updated_at": { - "type": "string" - } - } - }, - "model.SystemConfig": { - "type": "object", - "properties": { - "created_at": { - "type": "string" - }, - "description": { - "type": "string" - }, - "key": { - "type": "string" - }, - "type": { - "type": "string" - }, - "updated_at": { - "type": "string" - }, - "value": { - "type": "string" - }, - "visibility": { + "heap_objects": { "type": "integer" + }, + "heap_released": { + "type": "string" + }, + "heap_sys": { + "type": "string" + }, + "last_gc_time": { + "type": "string" + }, + "last_pause": { + "type": "string" + }, + "lookups": { + "type": "integer" + }, + "mallocs": { + "type": "integer" + }, + "mcache_inuse": { + "type": "string" + }, + "mcache_sys": { + "type": "string" + }, + "mspan_inuse": { + "type": "string" + }, + "mspan_sys": { + "type": "string" + }, + "next_gc": { + "type": "string" + }, + "num_gc": { + "type": "integer" + }, + "num_goroutine": { + "type": "integer" + }, + "other_sys": { + "type": "string" + }, + "pause_total_ns": { + "type": "string" + }, + "stack_inuse": { + "type": "string" + }, + "stack_sys": { + "type": "string" + }, + "sys": { + "type": "string" + }, + "total_alloc": { + "type": "string" + }, + "uptime": { + "type": "string" } } }, @@ -16980,66 +17861,6 @@ const docTemplate = `{ } } }, - "model.TaskExecution": { - "type": "object", - "properties": { - "created_at": { - "type": "string" - }, - "duration": { - "type": "integer" - }, - "error_message": { - "type": "string" - }, - "finished_at": { - "type": "string" - }, - "id": { - "type": "string", - "example": "0" - }, - "log": { - "type": "string" - }, - "max_retry": { - "type": "integer" - }, - "payload": { - "type": "string" - }, - "result": { - "type": "string" - }, - "retry_count": { - "type": "integer" - }, - "retryable": { - "type": "boolean" - }, - "started_at": { - "type": "string" - }, - "status": { - "$ref": "#/definitions/model.TaskExecutionStatus" - }, - "task_id": { - "type": "string" - }, - "task_name": { - "type": "string" - }, - "task_type": { - "type": "string" - }, - "triggered_by": { - "type": "string" - }, - "updated_at": { - "type": "string" - } - } - }, "model.TaskExecutionStatus": { "type": "string", "enum": [ @@ -17055,167 +17876,414 @@ const docTemplate = `{ "TaskExecutionStatusFailed" ] }, - "model.Template": { + "model.TestPushChannelRequest": { "type": "object", "properties": { - "content": { - "type": "string" - }, - "created_at": { - "type": "string" - }, - "description": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "is_system": { - "type": "boolean" - }, - "key": { - "type": "string" - }, "name": { "type": "string" }, - "subject": { + "other": { + "type": "string" + }, + "target": { + "type": "string" + }, + "token": { "type": "string" }, "type": { "type": "string" }, - "updated_at": { + "url": { "type": "string" } } }, - "model.Upload": { + "model.TestPushRequest": { + "type": "object", + "required": [ + "config" + ], + "properties": { + "config": { + "$ref": "#/definitions/push.Config" + }, + "target": { + "type": "string" + } + } + }, + "model.TestSMTPRequest": { + "type": "object", + "required": [ + "smtp_host", + "smtp_password", + "smtp_port", + "smtp_username", + "to" + ], + "properties": { + "smtp_host": { + "type": "string", + "maxLength": 255 + }, + "smtp_password": { + "type": "string", + "maxLength": 255 + }, + "smtp_port": { + "type": "integer" + }, + "smtp_username": { + "type": "string", + "maxLength": 255 + }, + "to": { + "type": "string" + } + } + }, + "model.TestSMTPResponse": { "type": "object", "properties": { - "access_mode": { + "error": { + "type": "string" + }, + "log": { + "type": "string" + }, + "success": { + "type": "boolean" + } + } + }, + "model.TopUserItem": { + "type": "object", + "properties": { + "count": { "type": "integer" }, - "created_at": { - "type": "string" - }, - "extension": { - "description": "文件后缀名 (不含点,如 png, pdf)", - "type": "string" - }, - "file_name": { - "description": "原始文件名 (例如: image.png)", - "type": "string" - }, - "file_path": { - "description": "文件相对路径 / S3 Key", - "type": "string" - }, - "file_size": { - "description": "文件大小(字节)", - "type": "integer" - }, - "hash": { - "description": "文件哈希 (SHA-256/MD5,可用于排重)", - "type": "string" - }, - "id": { - "type": "string", - "example": "0" - }, - "metadata": { - "description": "业务扩展元数据", - "allOf": [ - { - "$ref": "#/definitions/model.UploadMetadata" - } - ] - }, - "mime_type": { - "description": "媒体类型 (MIME, 如 image/png)", - "type": "string" - }, - "status": { - "description": "状态", - "allOf": [ - { - "$ref": "#/definitions/model.UploadStatus" - } - ] - }, - "type": { - "description": "业务标识类型 (如 avatar, doc, attachment)", - "type": "string" - }, - "updated_at": { + "nickname": { "type": "string" }, "user_id": { "type": "string", "example": "0" + }, + "username": { + "type": "string" } } }, - "model.UploadMetadata": { + "model.TrendItem": { "type": "object", "properties": { - "bucket": { - "description": "存储桶名称 (适用于 S3 等)", - "type": "string" - }, - "client_ip": { - "description": "上传者 IP", - "type": "string" - }, - "duration": { - "description": "音视频时长 (s)", - "type": "number" - }, - "extra": { - "description": "其它任意业务自定义元数据", - "type": "object", - "additionalProperties": {} - }, - "height": { - "description": "图像/视频高度 (px)", + "count": { "type": "integer" }, - "original_mime": { - "description": "原始 MIME 类型", + "date": { "type": "string" - }, - "user_agent": { - "description": "上传者的 UA", - "type": "string" - }, - "width": { - "description": "图像/视频宽度 (px)", - "type": "integer" } } }, - "model.UploadStatus": { - "type": "string", - "enum": [ - "pending", - "used", - "deleted" + "model.UpdateCacheConfigRequest": { + "type": "object", + "required": [ + "max_size_mb", + "ttl_minutes" ], - "x-enum-comments": { - "UploadStatusDeleted": "已删除", - "UploadStatusPending": "待使用", - "UploadStatusUsed": "已使用" - }, - "x-enum-descriptions": [ - "待使用", - "已使用", - "已删除" + "properties": { + "lru_enabled": { + "type": "boolean" + }, + "max_size_mb": { + "type": "integer", + "minimum": 1 + }, + "ttl_minutes": { + "type": "integer", + "minimum": 0 + } + } + }, + "model.UpdateChannelRequest": { + "type": "object", + "properties": { + "credentials": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "enabled": { + "type": "boolean" + }, + "extra": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "type": "string" + } + } + }, + "model.UpdatePushChannelRequest": { + "type": "object", + "required": [ + "type" ], - "x-enum-varnames": [ - "UploadStatusPending", - "UploadStatusUsed", - "UploadStatusDeleted" - ] + "properties": { + "description": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "other": { + "type": "string" + }, + "token": { + "type": "string" + }, + "type": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, + "model.UpdatePushEventRequest": { + "type": "object", + "required": [ + "template" + ], + "properties": { + "channels": { + "type": "array", + "items": { + "type": "string" + } + }, + "enabled": { + "type": "boolean" + }, + "targets": { + "type": "array", + "items": { + "type": "string" + } + }, + "template": { + "type": "string" + } + } + }, + "model.UpdateScheduleRequest": { + "type": "object", + "required": [ + "cron", + "is_active", + "name", + "task_type" + ], + "properties": { + "cron": { + "type": "string" + }, + "is_active": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "payload": { + "type": "string" + }, + "task_type": { + "type": "string" + } + } + }, + "model.UpdateSystemConfigRequest": { + "type": "object", + "required": [ + "value" + ], + "properties": { + "description": { + "type": "string", + "maxLength": 255 + }, + "value": { + "type": "string" + }, + "visibility": { + "type": "integer", + "enum": [ + 0, + 1 + ] + } + } + }, + "model.UpdateTemplateRequest": { + "type": "object", + "required": [ + "content", + "name", + "type" + ], + "properties": { + "content": { + "type": "string" + }, + "description": { + "type": "string", + "maxLength": 255 + }, + "name": { + "type": "string", + "maxLength": 100 + }, + "subject": { + "type": "string", + "maxLength": 255 + }, + "type": { + "type": "string", + "maxLength": 20 + } + } + }, + "model.UpdateUserRequest": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "email": { + "type": "string", + "maxLength": 255 + }, + "is_admin": { + "type": "boolean" + }, + "nickname": { + "type": "string", + "maxLength": 64 + }, + "password": { + "type": "string", + "maxLength": 64, + "minLength": 8 + } + } + }, + "model.UpdateUserStatusRequest": { + "type": "object", + "properties": { + "is_active": { + "type": "boolean" + } + } + }, + "model.UpdaterStatus": { + "type": "object", + "properties": { + "asset_name": { + "type": "string" + }, + "build_time": { + "type": "string" + }, + "can_upgrade": { + "type": "boolean" + }, + "current_version": { + "type": "string" + }, + "latest_version": { + "type": "string" + }, + "platform": { + "type": "string" + }, + "prerelease": { + "type": "boolean" + }, + "published_at": { + "type": "string" + }, + "release_name": { + "type": "string" + }, + "release_notes": { + "type": "string" + }, + "release_url": { + "type": "string" + }, + "update_available": { + "type": "boolean" + }, + "upstream_repository": { + "type": "string" + } + } + }, + "model.UserResponse": { + "type": "object", + "properties": { + "avatar_url": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "email": { + "type": "string" + }, + "gender": { + "type": "string" + }, + "id": { + "type": "string", + "example": "0" + }, + "is_active": { + "type": "boolean" + }, + "is_admin": { + "type": "boolean" + }, + "last_login_at": { + "type": "string" + }, + "location": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "username": { + "type": "string" + }, + "website": { + "type": "string" + } + } }, "model.Zone": { "type": "object", @@ -17260,6 +18328,108 @@ const docTemplate = `{ } } }, + "models.Upload": { + "type": "object", + "properties": { + "access_mode": { + "type": "integer" + }, + "created_at": { + "type": "string" + }, + "extension": { + "type": "string" + }, + "file_name": { + "type": "string" + }, + "file_path": { + "type": "string" + }, + "file_size": { + "type": "integer" + }, + "hash": { + "type": "string" + }, + "id": { + "type": "string", + "example": "0" + }, + "metadata": { + "$ref": "#/definitions/models.UploadMetadata" + }, + "mime_type": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/models.UploadStatus" + }, + "type": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "user_id": { + "type": "string", + "example": "0" + } + } + }, + "models.UploadMetadata": { + "type": "object", + "properties": { + "bucket": { + "type": "string" + }, + "client_ip": { + "type": "string" + }, + "duration": { + "type": "number" + }, + "extra": { + "type": "object", + "additionalProperties": {} + }, + "height": { + "type": "integer" + }, + "original_mime": { + "type": "string" + }, + "user_agent": { + "type": "string" + }, + "width": { + "type": "integer" + } + } + }, + "models.UploadStatus": { + "type": "string", + "enum": [ + "pending", + "used", + "deleted" + ], + "x-enum-comments": { + "UploadStatusDeleted": "已删除", + "UploadStatusPending": "待使用", + "UploadStatusUsed": "已使用" + }, + "x-enum-descriptions": [ + "待使用", + "已使用", + "已删除" + ], + "x-enum-varnames": [ + "UploadStatusPending", + "UploadStatusUsed", + "UploadStatusDeleted" + ] + }, "node.AgentReleaseInfo": { "type": "object", "properties": { @@ -17533,107 +18703,6 @@ const docTemplate = `{ } } }, - "oauth.AuthSourceView": { - "type": "object", - "properties": { - "client_secret_configured": { - "type": "boolean" - }, - "display_name": { - "type": "string" - }, - "icon_url": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "is_active": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, - "oauth.BasicUserInfo": { - "type": "object", - "properties": { - "avatar_url": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "email": { - "type": "string" - }, - "gender": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "is_admin": { - "type": "boolean" - }, - "location": { - "type": "string" - }, - "need_change_password": { - "type": "boolean" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "username": { - "type": "string" - }, - "website": { - "type": "string" - } - } - }, - "oauth.CallbackRequest": { - "type": "object", - "required": [ - "code", - "state" - ], - "properties": { - "code": { - "type": "string" - }, - "state": { - "type": "string" - } - } - }, - "oauth.OAuthAuthorizeResponse": { - "type": "object", - "properties": { - "authorize_url": { - "type": "string" - } - } - }, - "oauth.OAuthCallbackResult": { - "type": "object", - "properties": { - "status": { - "type": "string" - }, - "user": { - "$ref": "#/definitions/oauth.BasicUserInfo" - } - } - }, "observability.AccessLogCleanupInput": { "type": "object", "properties": { @@ -19448,257 +20517,6 @@ const docTemplate = `{ } } }, - "push.CreateChannelRequest": { - "type": "object", - "required": [ - "name", - "type" - ], - "properties": { - "description": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "other": { - "type": "string" - }, - "token": { - "type": "string" - }, - "type": { - "type": "string" - }, - "url": { - "type": "string" - } - } - }, - "push.CreateEventRequest": { - "type": "object", - "properties": { - "channels": { - "type": "array", - "items": { - "type": "string" - } - }, - "enabled": { - "type": "boolean" - }, - "event_key": { - "type": "string" - }, - "targets": { - "type": "array", - "items": { - "type": "string" - } - }, - "task_type": { - "description": "关联的异步任务类型", - "type": "string" - }, - "template": { - "type": "string" - } - } - }, - "push.Definition": { - "type": "object", - "properties": { - "description": { - "description": "short description", - "type": "string" - }, - "fields": { - "description": "form fields", - "type": "array", - "items": { - "$ref": "#/definitions/push.Field" - } - }, - "name": { - "description": "display name", - "type": "string" - }, - "type": { - "description": "channel type (e.g., custom, lark, email)", - "type": "string" - } - } - }, - "push.EventMetadata": { - "type": "object", - "properties": { - "default_template": { - "$ref": "#/definitions/push.NotificationMessage" - }, - "description": { - "type": "string" - }, - "key": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "push.Field": { - "type": "object", - "properties": { - "description": { - "description": "field explanation/help text", - "type": "string" - }, - "key": { - "description": "unique key for the field (e.g. url, token, other)", - "type": "string" - }, - "label": { - "description": "human readable label (e.g. \"Webhook 地址\")", - "type": "string" - }, - "placeholder": { - "description": "input placeholder", - "type": "string" - }, - "required": { - "description": "whether this field is required", - "type": "boolean" - }, - "type": { - "description": "input type: \"text\" | \"password\" | \"textarea\"", - "type": "string" - } - } - }, - "push.NotificationMessage": { - "type": "object", - "properties": { - "content": { - "type": "string" - }, - "ext": { - "type": "object", - "additionalProperties": {} - }, - "level": { - "type": "string" - }, - "title": { - "type": "string" - } - } - }, - "push.TestChannelRequest": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "other": { - "type": "string" - }, - "target": { - "type": "string" - }, - "token": { - "type": "string" - }, - "type": { - "type": "string" - }, - "url": { - "type": "string" - } - } - }, - "push.TestPushRequest": { - "type": "object", - "required": [ - "config" - ], - "properties": { - "config": { - "$ref": "#/definitions/push.Config" - }, - "target": { - "type": "string" - } - } - }, - "push.UpdateChannelRequest": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "description": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "other": { - "type": "string" - }, - "token": { - "type": "string" - }, - "type": { - "type": "string" - }, - "url": { - "type": "string" - } - } - }, - "push.UpdateEventRequest": { - "type": "object", - "required": [ - "template" - ], - "properties": { - "channels": { - "type": "array", - "items": { - "type": "string" - } - }, - "enabled": { - "type": "boolean" - }, - "targets": { - "type": "array", - "items": { - "type": "string" - } - }, - "template": { - "type": "string" - } - } - }, - "push.pushHistoriesResponse": { - "type": "object", - "properties": { - "results": { - "type": "array", - "items": { - "$ref": "#/definitions/model.PushHistory" - } - }, - "total": { - "type": "integer" - } - } - }, "relay.HeartbeatPayload": { "type": "object", "properties": { @@ -19767,439 +20585,29 @@ const docTemplate = `{ } } }, - "status.DatabaseInfoResponse": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "version": { - "type": "string" - } - } - }, - "status.LogDatabaseStatus": { - "type": "object", - "properties": { - "active_database": { - "type": "string" - }, - "available_targets": { - "type": "array", - "items": { - "type": "string" - } - }, - "clickhouse": { - "$ref": "#/definitions/Wavelet_OpenFlare_plugins_server_model_analytics.ClickHouseOperationalStats" - }, - "migration": { - "description": "idle | migrating", - "type": "string" - }, - "retention_days": { - "type": "object", - "additionalProperties": { - "type": "integer" - } - } - } - }, - "status.SystemStatusResponse": { - "type": "object", - "properties": { - "alloc": { - "type": "string" - }, - "buck_hash_sys": { - "type": "string" - }, - "frees": { - "type": "integer" - }, - "gc_sys": { - "type": "string" - }, - "heap_alloc": { - "type": "string" - }, - "heap_idle": { - "type": "string" - }, - "heap_inuse": { - "type": "string" - }, - "heap_objects": { - "type": "integer" - }, - "heap_released": { - "type": "string" - }, - "heap_sys": { - "type": "string" - }, - "last_gc_time": { - "type": "string" - }, - "last_pause": { - "type": "string" - }, - "lookups": { - "type": "integer" - }, - "mallocs": { - "type": "integer" - }, - "mcache_inuse": { - "type": "string" - }, - "mcache_sys": { - "type": "string" - }, - "mspan_inuse": { - "type": "string" - }, - "mspan_sys": { - "type": "string" - }, - "next_gc": { - "type": "string" - }, - "num_gc": { - "type": "integer" - }, - "num_goroutine": { - "type": "integer" - }, - "other_sys": { - "type": "string" - }, - "pause_total_ns": { - "type": "string" - }, - "stack_inuse": { - "type": "string" - }, - "stack_sys": { - "type": "string" - }, - "sys": { - "type": "string" - }, - "total_alloc": { - "type": "string" - }, - "uptime": { - "type": "string" - } - } - }, - "system_config.CreateSystemConfigRequest": { - "type": "object", - "required": [ - "key", - "type", - "value" + "time.Duration": { + "type": "integer", + "format": "int64", + "enum": [ + -9223372036854775808, + 9223372036854775807, + 1, + 1000, + 1000000, + 1000000000, + 60000000000, + 3600000000000 ], - "properties": { - "description": { - "type": "string", - "maxLength": 255 - }, - "key": { - "type": "string", - "maxLength": 64 - }, - "type": { - "type": "string", - "enum": [ - "system", - "business" - ] - }, - "value": { - "type": "string" - }, - "visibility": { - "type": "integer", - "enum": [ - 0, - 1 - ] - } - } - }, - "system_config.TestSMTPRequest": { - "type": "object", - "required": [ - "smtp_host", - "smtp_password", - "smtp_port", - "smtp_username", - "to" - ], - "properties": { - "smtp_host": { - "type": "string", - "maxLength": 255 - }, - "smtp_password": { - "type": "string", - "maxLength": 255 - }, - "smtp_port": { - "type": "integer" - }, - "smtp_username": { - "type": "string", - "maxLength": 255 - }, - "to": { - "type": "string" - } - } - }, - "system_config.TestSMTPResponse": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "log": { - "type": "string" - }, - "success": { - "type": "boolean" - } - } - }, - "system_config.UpdateSystemConfigRequest": { - "type": "object", - "required": [ - "value" - ], - "properties": { - "description": { - "type": "string", - "maxLength": 255 - }, - "value": { - "type": "string" - }, - "visibility": { - "type": "integer", - "enum": [ - 0, - 1 - ] - } - } - }, - "task.CreateScheduleRequest": { - "type": "object", - "required": [ - "cron", - "is_active", - "name", - "task_type" - ], - "properties": { - "cron": { - "type": "string" - }, - "is_active": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "payload": { - "type": "string" - }, - "task_type": { - "type": "string" - } - } - }, - "task.DispatchTaskRequest": { - "type": "object", - "required": [ - "task_type" - ], - "properties": { - "end_time": { - "type": "string" - }, - "payload": { - "type": "string" - }, - "start_time": { - "type": "string" - }, - "task_type": { - "type": "string" - }, - "user_id": { - "type": "integer" - } - } - }, - "task.TaskMeta": { - "type": "object", - "properties": { - "asynq_task": { - "type": "string" - }, - "description": { - "type": "string" - }, - "max_retry": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "params": { - "type": "array", - "items": { - "$ref": "#/definitions/task.TaskParam" - } - }, - "queue": { - "type": "string" - }, - "retryable": { - "description": "是否支持手动重试", - "type": "boolean" - }, - "supports_time": { - "type": "boolean" - }, - "type": { - "type": "string" - } - } - }, - "task.TaskParam": { - "type": "object", - "properties": { - "description": { - "description": "描述", - "type": "string" - }, - "label": { - "description": "显示名称", - "type": "string" - }, - "name": { - "description": "参数键名", - "type": "string" - }, - "placeholder": { - "description": "占位符", - "type": "string" - }, - "required": { - "description": "是否必填", - "type": "boolean" - }, - "type": { - "description": "类型:string, text, number, boolean", - "type": "string" - } - } - }, - "task.UpdateScheduleRequest": { - "type": "object", - "required": [ - "cron", - "is_active", - "name", - "task_type" - ], - "properties": { - "cron": { - "type": "string" - }, - "is_active": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "payload": { - "type": "string" - }, - "task_type": { - "type": "string" - } - } - }, - "template.CreateTemplateRequest": { - "type": "object", - "required": [ - "content", - "key", - "name", - "type" - ], - "properties": { - "content": { - "type": "string" - }, - "description": { - "type": "string", - "maxLength": 255 - }, - "key": { - "type": "string", - "maxLength": 80 - }, - "name": { - "type": "string", - "maxLength": 100 - }, - "subject": { - "type": "string", - "maxLength": 255 - }, - "type": { - "type": "string", - "maxLength": 20 - } - } - }, - "template.UpdateTemplateRequest": { - "type": "object", - "required": [ - "content", - "name", - "type" - ], - "properties": { - "content": { - "type": "string" - }, - "description": { - "type": "string", - "maxLength": 255 - }, - "name": { - "type": "string", - "maxLength": 100 - }, - "subject": { - "type": "string", - "maxLength": 255 - }, - "type": { - "type": "string", - "maxLength": 20 - } - } + "x-enum-varnames": [ + "minDuration", + "maxDuration", + "Nanosecond", + "Microsecond", + "Millisecond", + "Second", + "Minute", + "Hour" + ] }, "tls.ApplyInput": { "type": "object", @@ -20376,8 +20784,38 @@ const docTemplate = `{ } } }, + "user.AccessToken": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "is_admin": { + "type": "boolean" + }, + "masked_token": { + "type": "string" + }, + "name": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "user_id": { + "type": "integer" + } + } + }, "user.changePasswordRequest": { "type": "object", + "required": [ + "new_password", + "old_password" + ], "properties": { "new_password": { "type": "string" @@ -20387,9 +20825,15 @@ const docTemplate = `{ } } }, - "user.createTokenRequest": { + "user.createAccessTokenRequest": { "type": "object", + "required": [ + "name" + ], "properties": { + "expires_at": { + "type": "string" + }, "is_admin": { "type": "boolean" }, @@ -20398,60 +20842,13 @@ const docTemplate = `{ } } }, - "user.createUserRequest": { + "user.loginRequest": { "type": "object", "required": [ - "email", "password", "username" ], "properties": { - "email": { - "type": "string", - "maxLength": 255 - }, - "is_active": { - "type": "boolean" - }, - "is_admin": { - "type": "boolean" - }, - "nickname": { - "type": "string", - "maxLength": 64 - }, - "password": { - "type": "string", - "maxLength": 64, - "minLength": 8 - }, - "username": { - "type": "string", - "maxLength": 64, - "minLength": 3 - } - } - }, - "user.listUsersResponse": { - "type": "object", - "properties": { - "total": { - "type": "integer" - }, - "users": { - "type": "array", - "items": { - "$ref": "#/definitions/user.user" - } - } - } - }, - "user.loginRequest": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, "password": { "type": "string" }, @@ -20462,19 +20859,14 @@ const docTemplate = `{ }, "user.registerRequest": { "type": "object", + "required": [ + "password", + "username" + ], "properties": { - "code": { - "type": "string" - }, - "display_name": { - "type": "string" - }, "email": { "type": "string" }, - "nickname": { - "type": "string" - }, "password": { "type": "string" }, @@ -20483,32 +20875,6 @@ const docTemplate = `{ } } }, - "user.sendEmailCodeRequest": { - "type": "object", - "required": [ - "email", - "scene" - ], - "properties": { - "email": { - "type": "string" - }, - "scene": { - "type": "string" - } - } - }, - "user.tokenResponse": { - "type": "object", - "properties": { - "record": { - "$ref": "#/definitions/model.AccessToken" - }, - "token": { - "type": "string" - } - } - }, "user.updateProfileRequest": { "type": "object", "properties": { @@ -20518,9 +20884,6 @@ const docTemplate = `{ "bio": { "type": "string" }, - "email": { - "type": "string" - }, "gender": { "type": "string" }, @@ -20538,89 +20901,6 @@ const docTemplate = `{ } } }, - "user.updateUserRequest": { - "type": "object", - "required": [ - "email" - ], - "properties": { - "email": { - "type": "string", - "maxLength": 255 - }, - "is_admin": { - "type": "boolean" - }, - "nickname": { - "type": "string", - "maxLength": 64 - }, - "password": { - "type": "string", - "maxLength": 64, - "minLength": 8 - } - } - }, - "user.updateUserStatusRequest": { - "type": "object", - "properties": { - "is_active": { - "type": "boolean" - } - } - }, - "user.user": { - "type": "object", - "properties": { - "avatar_url": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "created_at": { - "type": "string" - }, - "email": { - "type": "string" - }, - "gender": { - "type": "string" - }, - "id": { - "type": "string", - "example": "0" - }, - "is_active": { - "type": "boolean" - }, - "is_admin": { - "type": "boolean" - }, - "last_login_at": { - "type": "string" - }, - "location": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "updated_at": { - "type": "string" - }, - "username": { - "type": "string" - }, - "website": { - "type": "string" - } - } - }, "waf.CreateRuleInput": { "type": "object", "properties": { diff --git a/backend/docs/swagger.json b/backend/docs/swagger.json index 00149de2..87fa6049 100644 --- a/backend/docs/swagger.json +++ b/backend/docs/swagger.json @@ -50,7 +50,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/Wavelet_OpenFlare_plugins_server_cap.ChallengeResponse" + "$ref": "#/definitions/cap.ChallengeResponse" } } } @@ -102,7 +102,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/Wavelet_OpenFlare_plugins_server_cap.RedeemResponse" + "$ref": "#/definitions/cap.RedeemResponse" } } } @@ -175,22 +175,7 @@ "200": { "description": "认证源列表", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.AuthSource" - } - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "401": { @@ -237,7 +222,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/auth_source.AuthSourceRequest" + "$ref": "#/definitions/contracts.AuthSourceDTO" } } ], @@ -245,19 +230,7 @@ "200": { "description": "创建成功,返回认证源信息", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.AuthSource" - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "400": { @@ -314,7 +287,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/auth_source.AuthSourceRequest" + "$ref": "#/definitions/contracts.AuthSourceDTO" } } ], @@ -322,19 +295,7 @@ "200": { "description": "更新成功,返回更新后的认证源信息", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.AuthSource" - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "400": { @@ -453,15 +414,6 @@ "name": "id", "in": "path", "required": true - }, - { - "description": "启用状态", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/auth_source.ToggleAuthSourceRequest" - } } ], "responses": { @@ -572,7 +524,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/cache.updateCacheConfigRequest" + "$ref": "#/definitions/model.UpdateCacheConfigRequest" } } ], @@ -637,7 +589,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/diskcache.Status" + "$ref": "#/definitions/disk.Status" } } } @@ -735,7 +687,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/status.DatabaseInfoResponse" + "$ref": "#/definitions/model.DatabaseInfoResponse" } } } @@ -784,7 +736,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/db_manage.DBOverviewResponse" + "$ref": "#/definitions/model.DBOverviewResponse" } } } @@ -837,7 +789,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/db_manage.ExecuteSQLRequest" + "$ref": "#/definitions/model.ExecuteSQLRequest" } } ], @@ -853,7 +805,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/db_manage.ExecuteSQLResponse" + "$ref": "#/definitions/model.ExecuteSQLResponse" } } } @@ -988,7 +940,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/logs.logsResponse" + "$ref": "#/definitions/model.LogsResponse" } } } @@ -1017,7 +969,7 @@ "SessionCookie": [] } ], - "description": "分页并按照用户、接口路径、时间范围等维度检索用户访问日志列表(需要管理员权限,日志存储未启用时报错)", + "description": "分页并按照用户、接口路径、时间范围等维度检索用户访问日志列表(需要管理员权限)", "produces": [ "application/json" ], @@ -1077,7 +1029,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/logs.accessLogsResponse" + "$ref": "#/definitions/model.AccessLogsResponse" } } } @@ -1085,7 +1037,7 @@ } }, "400": { - "description": "日志存储未启用或参数错误", + "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } @@ -1101,6 +1053,12 @@ "schema": { "$ref": "#/definitions/response.Any" } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } } } } @@ -1112,7 +1070,7 @@ "SessionCookie": [] } ], - "description": "聚合统计最近 7 天的每日访问趋势、浏览器分布以及前 10 名最活跃用户排行(需要管理员权限,日志存储未启用时报错)", + "description": "聚合统计最近 7 天的每日访问趋势、浏览器分布以及前 10 名最活跃用户排行(需要管理员权限)", "produces": [ "application/json" ], @@ -1132,19 +1090,13 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/logs.logsAnalyticsResponse" + "$ref": "#/definitions/model.LogsAnalyticsResponse" } } } ] } }, - "400": { - "description": "日志存储未启用", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, "401": { "description": "未登录", "schema": { @@ -1156,6 +1108,12 @@ "schema": { "$ref": "#/definitions/response.Any" } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } } } } @@ -1170,6 +1128,295 @@ "responses": {} } }, + "/api/v1/admin/message-gateway/channels": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Returns all messaging channels; secrets are masked", + "produces": [ + "application/json" + ], + "tags": [ + "admin-message-gateway" + ], + "summary": "List message gateway channels", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.ChannelDTO" + } + } + } + } + ] + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Creates a Telegram or QQ channel with encrypted credentials", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "admin-message-gateway" + ], + "summary": "Create message gateway channel", + "parameters": [ + { + "description": "create body", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreateChannelRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ChannelDTO" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/admin/message-gateway/channels/definitions": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Returns form field definitions for Telegram and QQ channels", + "produces": [ + "application/json" + ], + "tags": [ + "admin-message-gateway" + ], + "summary": "List message gateway channel definitions", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.Definition" + } + } + } + } + ] + } + } + } + } + }, + "/api/v1/admin/message-gateway/channels/{id}": { + "delete": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Deletes a channel and cascaded bindings and pairing codes", + "produces": [ + "application/json" + ], + "tags": [ + "admin-message-gateway" + ], + "summary": "Delete message gateway channel", + "parameters": [ + { + "type": "integer", + "description": "channel id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "patch": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Updates a channel; empty secrets keep the current ciphertext", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "admin-message-gateway" + ], + "summary": "Update message gateway channel", + "parameters": [ + { + "type": "integer", + "description": "channel id", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "update body", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateChannelRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ChannelDTO" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/admin/message-gateway/channels/{id}/test": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Probes stored credentials without returning secrets", + "produces": [ + "application/json" + ], + "tags": [ + "admin-message-gateway" + ], + "summary": "Test message gateway channel", + "parameters": [ + { + "type": "integer", + "description": "channel id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, "/api/v1/admin/push/channels": { "get": { "security": [ @@ -1233,7 +1480,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/push.CreateChannelRequest" + "$ref": "#/definitions/model.CreatePushChannelRequest" } } ], @@ -1266,7 +1513,7 @@ "SessionCookie": [] } ], - "description": "返回系统支持的所有消息通道类型(如飞书、邮件、自定义、Telegram)的动态表单定义,需要管理员权限", + "description": "返回系统支持的所有消息通道类型的动态表单定义,需要管理员权限", "produces": [ "application/json" ], @@ -1278,22 +1525,7 @@ "200": { "description": "通道配置定义列表", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/push.Definition" - } - } - } - } - ] + "$ref": "#/definitions/response.Any" } } } @@ -1324,7 +1556,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/push.TestChannelRequest" + "$ref": "#/definitions/model.TestPushChannelRequest" } } ], @@ -1371,7 +1603,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/push.UpdateChannelRequest" + "$ref": "#/definitions/model.UpdatePushChannelRequest" } } ], @@ -1493,7 +1725,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/push.CreateEventRequest" + "$ref": "#/definitions/model.CreatePushEventRequest" } } ], @@ -1538,22 +1770,7 @@ "200": { "description": "内置通知事件列表", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/push.EventMetadata" - } - } - } - } - ] + "$ref": "#/definitions/response.Any" } } } @@ -1591,7 +1808,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/push.UpdateEventRequest" + "$ref": "#/definitions/model.UpdatePushEventRequest" } } ], @@ -1752,19 +1969,7 @@ "200": { "description": "推送历史列表", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/push.pushHistoriesResponse" - } - } - } - ] + "$ref": "#/definitions/response.Any" } } } @@ -1795,7 +2000,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/push.TestPushRequest" + "$ref": "#/definitions/model.TestPushRequest" } } ], @@ -1848,7 +2053,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/status.SystemStatusResponse" + "$ref": "#/definitions/model.SystemStatusResponse" } } } @@ -1897,7 +2102,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/status.LogDatabaseStatus" + "$ref": "#/definitions/model.LogDatabaseStatus" } } } @@ -1962,7 +2167,7 @@ "data": { "type": "array", "items": { - "$ref": "#/definitions/model.SystemConfig" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.SystemConfig" } } } @@ -2014,7 +2219,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/system_config.CreateSystemConfigRequest" + "$ref": "#/definitions/model.CreateSystemConfigRequest" } } ], @@ -2089,7 +2294,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/system_config.TestSMTPRequest" + "$ref": "#/definitions/model.TestSMTPRequest" } } ], @@ -2105,7 +2310,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/system_config.TestSMTPResponse" + "$ref": "#/definitions/model.TestSMTPResponse" } } } @@ -2157,7 +2362,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/model.SystemConfig" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.SystemConfig" } } } @@ -2221,7 +2426,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/system_config.UpdateSystemConfigRequest" + "$ref": "#/definitions/model.UpdateSystemConfigRequest" } } ], @@ -2302,7 +2507,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/task.DispatchTaskRequest" + "$ref": "#/definitions/model.DispatchTaskRequest" } } ], @@ -2380,18 +2585,6 @@ "name": "task_type", "in": "query" }, - { - "type": "string", - "description": "任务类型前缀筛选(与 task_type / task_types 互斥,精确类型优先)", - "name": "task_type_prefix", - "in": "query" - }, - { - "type": "string", - "description": "逗号分隔的精确任务类型列表(IN 筛选,优先于前缀)", - "name": "task_types", - "in": "query" - }, { "type": "integer", "default": 1, @@ -2477,7 +2670,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/model.TaskExecution" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.TaskExecution" } } } @@ -2594,7 +2787,7 @@ "SessionCookie": [] } ], - "description": "返回管理员可管理的定时任务配置列表,包括名称、关联的异步任务类型、Cron 表达式和启用状态;系统内部排程不会暴露,需要管理员权限", + "description": "返回系统所有的定时任务配置列表,包括名称、关联的异步任务类型、Cron 表达式和启用状态,需要管理员权限", "produces": [ "application/json" ], @@ -2616,7 +2809,7 @@ "data": { "type": "array", "items": { - "$ref": "#/definitions/model.Schedule" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.Schedule" } } } @@ -2662,7 +2855,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/task.CreateScheduleRequest" + "$ref": "#/definitions/model.CreateScheduleRequest" } } ], @@ -2678,7 +2871,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/model.Schedule" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.Schedule" } } } @@ -2744,7 +2937,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/task.UpdateScheduleRequest" + "$ref": "#/definitions/model.UpdateScheduleRequest" } } ], @@ -2760,7 +2953,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/model.Schedule" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.Schedule" } } } @@ -2859,12 +3052,6 @@ "$ref": "#/definitions/response.Any" } }, - "404": { - "description": "定时任务不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, "500": { "description": "删除定时任务失败", "schema": { @@ -2903,7 +3090,7 @@ "data": { "type": "array", "items": { - "$ref": "#/definitions/task.TaskMeta" + "$ref": "#/definitions/contracts.TaskMetaDTO" } } } @@ -2955,7 +3142,7 @@ "data": { "type": "array", "items": { - "$ref": "#/definitions/model.Template" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.Template" } } } @@ -3007,7 +3194,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/template.CreateTemplateRequest" + "$ref": "#/definitions/model.CreateTemplateRequest" } } ], @@ -3093,7 +3280,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/model.Template" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.Template" } } } @@ -3157,7 +3344,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/template.UpdateTemplateRequest" + "$ref": "#/definitions/model.UpdateTemplateRequest" } } ], @@ -3173,7 +3360,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/model.Template" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.Template" } } } @@ -3314,7 +3501,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/updater.Status" + "$ref": "#/definitions/model.UpdaterStatus" } } } @@ -3439,8 +3626,7 @@ }, { "type": "integer", - "format": "int64", - "description": "上传用户 ID", + "description": "上传用户 ID 过滤", "name": "user_id", "in": "query" } @@ -3464,14 +3650,8 @@ ] } }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", + "400": { + "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } @@ -3588,6 +3768,127 @@ } } }, + "/api/v1/admin/uploads/files": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "分页获取系统上传的文件列表,支持文件名关键词、业务类型、扩展名、上传用户ID过滤", + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "获取文件列表", + "parameters": [ + { + "type": "integer", + "description": "页码(默认 1)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页数量(默认 20,最大 100)", + "name": "page_size", + "in": "query" + }, + { + "type": "string", + "description": "文件名关键词(模糊匹配)", + "name": "keyword", + "in": "query" + }, + { + "type": "string", + "description": "业务分类过滤", + "name": "type", + "in": "query" + }, + { + "type": "string", + "description": "扩展名过滤", + "name": "extension", + "in": "query" + }, + { + "type": "integer", + "description": "上传用户 ID 过滤", + "name": "user_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "查询成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handler.listFilesResponse" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/admin/uploads/files/{id}": { + "delete": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "将指定 ID 的文件状态置为 deleted(软删除)", + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "删除文件", + "parameters": [ + { + "type": "string", + "description": "文件 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "文件不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, "/api/v1/admin/uploads/stats": { "get": { "security": [ @@ -3650,17 +3951,17 @@ "SessionCookie": [] } ], - "description": "返回数据库中所有已上传文件实际拥有的业务类型列表", + "description": "查询系统内所有不重复的上传业务分类标识(如 avatar, doc 等)", "produces": [ "application/json" ], "tags": [ "admin" ], - "summary": "获取文件业务类型列表", + "summary": "获取业务分类列表", "responses": { "200": { - "description": "业务类型列表", + "description": "查询成功", "schema": { "allOf": [ { @@ -3679,24 +3980,6 @@ } ] } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } } } } @@ -3708,7 +3991,7 @@ "SessionCookie": [] } ], - "description": "将文件状态置为 deleted(软删除),不会立即清理底层存储对象", + "description": "将指定 ID 的文件状态置为 deleted(软删除)", "produces": [ "application/json" ], @@ -3732,23 +4015,11 @@ "$ref": "#/definitions/response.Any" } }, - "403": { - "description": "无权操作", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, "404": { "description": "文件不存在", "schema": { "$ref": "#/definitions/response.Any" } - }, - "409": { - "description": "系统保留类型或存储只读", - "schema": { - "$ref": "#/definitions/response.Any" - } } } } @@ -3810,7 +4081,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/user.listUsersResponse" + "$ref": "#/definitions/model.ListUsersResponse" } } } @@ -3867,7 +4138,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/user.createUserRequest" + "$ref": "#/definitions/model.CreateUserRequest" } } ], @@ -3883,7 +4154,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/user.user" + "$ref": "#/definitions/model.UserResponse" } } } @@ -3953,7 +4224,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/user.user" + "$ref": "#/definitions/model.UserResponse" } } } @@ -4023,7 +4294,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/user.updateUserRequest" + "$ref": "#/definitions/model.UpdateUserRequest" } } ], @@ -4185,7 +4456,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/user.updateUserStatusRequest" + "$ref": "#/definitions/model.UpdateUserStatusRequest" } } ], @@ -12898,6 +13169,205 @@ } } }, + "/api/v1/message-gateway/bindings": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Returns the current user's bound messaging channels", + "produces": [ + "application/json" + ], + "tags": [ + "message-gateway" + ], + "summary": "List message gateway bindings", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.BindingDTO" + } + } + } + } + ] + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Binds the current user to a platform identity using a one-time pairing code", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "message-gateway" + ], + "summary": "Bind a messaging channel", + "parameters": [ + { + "description": "bind body", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.BindRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.BindingDTO" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "409": { + "description": "Conflict", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/message-gateway/bindings/{id}": { + "delete": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Removes a binding owned by the current user", + "produces": [ + "application/json" + ], + "tags": [ + "message-gateway" + ], + "summary": "Unbind a messaging channel", + "parameters": [ + { + "type": "integer", + "description": "binding id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/message-gateway/channels": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Returns enabled system bots the current user can pair with", + "produces": [ + "application/json" + ], + "tags": [ + "message-gateway" + ], + "summary": "List enabled messaging channels", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.PublicChannelDTO" + } + } + } + } + ] + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, "/api/v1/oauth/callback": { "post": { "description": "接收前端传回的 state 和 code,完成 OAuth/OIDC 认证并建立会话。支持登录(login)和账号绑定(bind)两种场景。", @@ -12918,7 +13388,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/oauth.CallbackRequest" + "$ref": "#/definitions/auth.CallbackRequest" } } ], @@ -12934,7 +13404,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/oauth.OAuthCallbackResult" + "$ref": "#/definitions/auth.OAuthCallbackResult" } } } @@ -12981,22 +13451,7 @@ "200": { "description": "外部帐号列表", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.ExternalAccountView" - } - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "401": { @@ -13103,7 +13558,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/oauth.OAuthAuthorizeResponse" + "$ref": "#/definitions/auth.OAuthAuthorizeResponse" } } } @@ -13117,7 +13572,7 @@ } }, "500": { - "description": "Redis 异常 or 构造 URL 失败", + "description": "构造 URL 失败", "schema": { "$ref": "#/definitions/response.Any" } @@ -13192,7 +13647,7 @@ "data": { "type": "array", "items": { - "$ref": "#/definitions/oauth.AuthSourceView" + "$ref": "#/definitions/auth.AuthSourceView" } } } @@ -13210,7 +13665,7 @@ "SessionCookie": [] } ], - "description": "返回当前登录用户的基本信息及余额数据,需要登录。包括用户 ID、用户名、信任等级、各类余额信息等。", + "description": "返回当前登录用户的基本信息,需要登录。", "produces": [ "application/json" ], @@ -13230,7 +13685,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/oauth.BasicUserInfo" + "$ref": "#/definitions/auth.BasicUserInfo" } } } @@ -13283,7 +13738,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/oauth.OAuthAuthorizeResponse" + "$ref": "#/definitions/auth.OAuthAuthorizeResponse" } } } @@ -13297,7 +13752,7 @@ } }, "500": { - "description": "Redis 异常或构造 URL 失败", + "description": "构造 URL 失败", "schema": { "$ref": "#/definitions/response.Any" } @@ -13674,7 +14129,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/model.Upload" + "$ref": "#/definitions/models.Upload" } } } @@ -13693,12 +14148,6 @@ "$ref": "#/definitions/response.Any" } }, - "409": { - "description": "系统保留类型或存储只读", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, "500": { "description": "内部错误", "schema": { @@ -13831,7 +14280,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/model.Upload" + "$ref": "#/definitions/models.Upload" } } } @@ -13893,12 +14342,6 @@ "schema": { "$ref": "#/definitions/response.Any" } - }, - "409": { - "description": "系统保留类型或存储只读", - "schema": { - "$ref": "#/definitions/response.Any" - } } } } @@ -13910,7 +14353,7 @@ "SessionCookie": [] } ], - "description": "返回当前登录用户的基本信息及余额数据,需要登录。包括用户 ID、用户名、信任等级、各类余额信息等。", + "description": "返回当前登录用户的基本信息,需要登录。", "produces": [ "application/json" ], @@ -13930,7 +14373,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/oauth.BasicUserInfo" + "$ref": "#/definitions/auth.BasicUserInfo" } } } @@ -13975,7 +14418,7 @@ "data": { "type": "array", "items": { - "$ref": "#/definitions/model.AccessToken" + "$ref": "#/definitions/user.AccessToken" } } } @@ -13997,7 +14440,7 @@ "SessionCookie": [] } ], - "description": "为当前用户新建一个 API 访问令牌,仅在此接口返回一次明文令牌值,请妥善保存。可通过 is_admin 字段赋予令牌管理员权限(仅管理员用户可设置)。", + "description": "为当前用户新建一个 API 访问令牌,仅在此接口返回一次明文令牌值,请妥善保存。", "consumes": [ "application/json" ], @@ -14015,7 +14458,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/user.createTokenRequest" + "$ref": "#/definitions/user.createAccessTokenRequest" } } ], @@ -14023,19 +14466,7 @@ "200": { "description": "新建令牌成功", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/user.tokenResponse" - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "400": { @@ -14127,19 +14558,7 @@ "200": { "description": "令牌轮换成功", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/user.tokenResponse" - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "400": { @@ -14153,7 +14572,7 @@ }, "/api/v1/user/change-password": { "post": { - "description": "修改当前登录用户的密码。修改成功后,如果是首次明文登录的升级提示,则清除修改密码的提示状态。", + "description": "修改当前登录用户的密码。", "consumes": [ "application/json" ], @@ -14237,19 +14656,7 @@ "200": { "description": "登录成功,返回用户信息", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/oauth.BasicUserInfo" - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "400": { @@ -14312,7 +14719,7 @@ }, "/api/v1/user/profile": { "put": { - "description": "修改当前登录用户的昵称、邮箱、头像、简介、电话、性别、个人网站和所在地。", + "description": "修改当前登录用户的昵称、头像、简介、电话、性别、个人网站和所在地。", "consumes": [ "application/json" ], @@ -14338,23 +14745,11 @@ "200": { "description": "修改成功,返回更新后的用户信息", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/oauth.BasicUserInfo" - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "400": { - "description": "邮箱已被占用或参数错误", + "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } @@ -14370,7 +14765,7 @@ }, "/api/v1/user/register": { "post": { - "description": "使用用户名和密码注册新账号,注册成功后自动登录并建立 Session。密码长度不能少于 8 位。", + "description": "使用用户名和密码注册新账号,注册成功后自动登录并建立 Session。", "consumes": [ "application/json" ], @@ -14396,19 +14791,7 @@ "200": { "description": "注册并登录成功,返回用户信息", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/oauth.BasicUserInfo" - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "400": { @@ -14433,31 +14816,19 @@ "SessionCookie": [] } ], - "description": "返回当前登录用户的基本信息及余额数据,需要登录。包括用户 ID、用户名、信任等级、各类余额信息等。", + "description": "返回当前登录用户的基本信息,需要登录。", "produces": [ "application/json" ], "tags": [ - "oauth" + "user" ], "summary": "获取当前登录用户信息", "responses": { "200": { "description": "用户信息", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/oauth.BasicUserInfo" - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "401": { @@ -14482,17 +14853,6 @@ "user" ], "summary": "发送邮箱验证码", - "parameters": [ - { - "description": "发送验证码请求参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/user.sendEmailCodeRequest" - } - } - ], "responses": { "200": { "description": "发送成功", @@ -14590,79 +14950,6 @@ } }, "definitions": { - "Wavelet_OpenFlare_plugins_server_cap.ChallengeResponse": { - "type": "object", - "properties": { - "challenge": { - "type": "object", - "properties": { - "c": { - "type": "integer" - }, - "d": { - "type": "integer" - }, - "s": { - "type": "integer" - } - } - }, - "expires": { - "description": "ms timestamp", - "type": "integer" - }, - "token": { - "type": "string" - } - } - }, - "Wavelet_OpenFlare_plugins_server_cap.RedeemResponse": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "expires": { - "type": "integer" - }, - "success": { - "type": "boolean" - }, - "token": { - "type": "string" - } - } - }, - "Wavelet_OpenFlare_plugins_server_model_analytics.ClickHouseOperationalStats": { - "type": "object", - "properties": { - "active_parts": { - "type": "integer" - }, - "async_insert_bytes": { - "type": "integer" - }, - "async_insert_queue": { - "type": "integer" - }, - "batch_writers": { - "description": "BatchWriters reports in-process queue depth/drops/flush errors for CH writers.", - "type": "array", - "items": { - "$ref": "#/definitions/analytics.BatchWriterStats" - } - }, - "database": { - "type": "string" - }, - "pending_mutations": { - "type": "integer" - }, - "total_rows": { - "type": "integer" - } - } - }, "Wavelet_OpenFlare_share_protocol.ActiveConfigMeta": { "type": "object", "properties": { @@ -14900,6 +15187,157 @@ } } }, + "Wavelet_plugins_domain_admin_model.Schedule": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "cron": { + "type": "string" + }, + "id": { + "type": "string", + "example": "0" + }, + "is_active": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "payload": { + "type": "string" + }, + "task_type": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "Wavelet_plugins_domain_admin_model.SystemConfig": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "description": { + "type": "string" + }, + "key": { + "type": "string" + }, + "type": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "value": { + "type": "string" + }, + "visibility": { + "type": "integer" + } + } + }, + "Wavelet_plugins_domain_admin_model.TaskExecution": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "duration": { + "type": "integer" + }, + "error_message": { + "type": "string" + }, + "finished_at": { + "type": "string" + }, + "id": { + "type": "string", + "example": "0" + }, + "log": { + "type": "string" + }, + "max_retry": { + "type": "integer" + }, + "payload": { + "type": "string" + }, + "result": { + "type": "string" + }, + "retry_count": { + "type": "integer" + }, + "retryable": { + "type": "boolean" + }, + "started_at": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/model.TaskExecutionStatus" + }, + "task_id": { + "type": "string" + }, + "task_name": { + "type": "string" + }, + "task_type": { + "type": "string" + }, + "triggered_by": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "Wavelet_plugins_domain_admin_model.Template": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "description": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "is_system": { + "type": "boolean" + }, + "key": { + "type": "string" + }, + "name": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "type": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, "agent.ActiveConfigMeta": { "type": "object", "properties": { @@ -15159,29 +15597,6 @@ } } }, - "analytics.BatchWriterStats": { - "type": "object", - "properties": { - "cap": { - "type": "integer" - }, - "depth": { - "type": "integer" - }, - "drops": { - "type": "integer" - }, - "flush_errors": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "running": { - "type": "boolean" - } - } - }, "apply_log.CleanupInput": { "type": "object", "properties": { @@ -15230,14 +15645,11 @@ } } }, - "auth_source.AuthSourceRequest": { + "auth.AuthSourceView": { "type": "object", "properties": { - "client_id": { - "type": "string" - }, - "client_secret": { - "type": "string" + "client_secret_configured": { + "type": "boolean" }, "display_name": { "type": "string" @@ -15245,48 +15657,135 @@ "icon_url": { "type": "string" }, + "id": { + "type": "integer" + }, "is_active": { "type": "boolean" }, "name": { "type": "string" }, - "openid_discovery_url": { - "type": "string" - }, - "scopes": { - "type": "string" - }, "type": { "type": "string" } } }, - "auth_source.ToggleAuthSourceRequest": { + "auth.BasicUserInfo": { "type": "object", "properties": { - "is_active": { + "avatar_url": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "email": { + "type": "string" + }, + "gender": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "is_admin": { "type": "boolean" + }, + "location": { + "type": "string" + }, + "need_change_password": { + "type": "boolean" + }, + "nickname": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "username": { + "type": "string" + }, + "website": { + "type": "string" } } }, - "cache.updateCacheConfigRequest": { + "auth.CallbackRequest": { "type": "object", "required": [ - "max_size_mb", - "ttl_minutes" + "code", + "state" ], "properties": { - "lru_enabled": { + "code": { + "type": "string" + }, + "state": { + "type": "string" + } + } + }, + "auth.OAuthAuthorizeResponse": { + "type": "object", + "properties": { + "authorize_url": { + "type": "string" + } + } + }, + "auth.OAuthCallbackResult": { + "type": "object", + "properties": { + "status": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/auth.BasicUserInfo" + } + } + }, + "cap.ChallengeResponse": { + "type": "object", + "properties": { + "challenge": { + "type": "object", + "properties": { + "c": { + "type": "integer" + }, + "d": { + "type": "integer" + }, + "s": { + "type": "integer" + } + } + }, + "expires": { + "description": "ms timestamp", + "type": "integer" + }, + "token": { + "type": "string" + } + } + }, + "cap.RedeemResponse": { + "type": "object", + "properties": { + "error": { + "type": "string" + }, + "expires": { + "type": "integer" + }, + "success": { "type": "boolean" }, - "max_size_mb": { - "type": "integer", - "minimum": 1 - }, - "ttl_minutes": { - "type": "integer", - "minimum": 0 + "token": { + "type": "string" } } }, @@ -15685,6 +16184,119 @@ } } }, + "contracts.AuthSourceDTO": { + "type": "object", + "properties": { + "client_id": { + "type": "string" + }, + "client_secret": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "display_name": { + "type": "string" + }, + "icon_url": { + "type": "string" + }, + "id": { + "type": "string", + "example": "0" + }, + "is_active": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "openid_discovery_url": { + "type": "string" + }, + "scopes": { + "type": "string" + }, + "type": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "contracts.TaskMetaDTO": { + "type": "object", + "properties": { + "asynq_task": { + "type": "string" + }, + "category": { + "type": "string" + }, + "description": { + "type": "string" + }, + "display_name": { + "type": "string" + }, + "max_retry": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/contracts.TaskParamDTO" + } + }, + "queue": { + "type": "string" + }, + "retryable": { + "type": "boolean" + }, + "schedule": { + "type": "string" + }, + "supports_time": { + "type": "boolean" + }, + "timeout": { + "$ref": "#/definitions/time.Duration" + }, + "type": { + "type": "string" + } + } + }, + "contracts.TaskParamDTO": { + "type": "object", + "properties": { + "default": {}, + "description": { + "type": "string" + }, + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "placeholder": { + "type": "string" + }, + "required": { + "type": "boolean" + }, + "type": { + "type": "string" + } + } + }, "dashboard.Capacity": { "type": "object", "properties": { @@ -15832,69 +16444,7 @@ } } }, - "db_manage.DBOverviewResponse": { - "type": "object", - "properties": { - "connections": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "size": { - "type": "string" - }, - "table_count": { - "type": "integer" - }, - "type": { - "type": "string" - }, - "version": { - "type": "string" - } - } - }, - "db_manage.ExecuteSQLRequest": { - "type": "object", - "required": [ - "sql" - ], - "properties": { - "sql": { - "type": "string" - } - } - }, - "db_manage.ExecuteSQLResponse": { - "type": "object", - "properties": { - "affected_rows": { - "type": "integer" - }, - "columns": { - "type": "array", - "items": { - "type": "string" - } - }, - "execution_time_ms": { - "type": "integer" - }, - "results": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": {} - } - }, - "type": { - "description": "\"select\" 或 \"exec\"", - "type": "string" - } - } - }, - "diskcache.Status": { + "disk.Status": { "type": "object", "properties": { "base_path": { @@ -16073,7 +16623,7 @@ "items": { "type": "array", "items": { - "$ref": "#/definitions/model.Upload" + "$ref": "#/definitions/models.Upload" } }, "page": { @@ -16093,7 +16643,7 @@ "items": { "type": "array", "items": { - "$ref": "#/definitions/model.Upload" + "$ref": "#/definitions/models.Upload" } }, "page": { @@ -16150,7 +16700,7 @@ } } }, - "logs.accessLogItem": { + "model.AccessLogItem": { "type": "object", "properties": { "created_at": { @@ -16181,6 +16731,9 @@ "status": { "type": "integer" }, + "trace_id": { + "type": "string" + }, "user_agent": { "type": "string" }, @@ -16193,13 +16746,13 @@ } } }, - "logs.accessLogsResponse": { + "model.AccessLogsResponse": { "type": "object", "properties": { "list": { "type": "array", "items": { - "$ref": "#/definitions/logs.accessLogItem" + "$ref": "#/definitions/model.AccessLogItem" } }, "total": { @@ -16207,113 +16760,6 @@ } } }, - "logs.browserItem": { - "type": "object", - "properties": { - "browser": { - "type": "string" - }, - "count": { - "type": "integer" - } - } - }, - "logs.logsAnalyticsResponse": { - "type": "object", - "properties": { - "browsers": { - "type": "array", - "items": { - "$ref": "#/definitions/logs.browserItem" - } - }, - "top_users": { - "type": "array", - "items": { - "$ref": "#/definitions/logs.topUserItem" - } - }, - "trend": { - "type": "array", - "items": { - "$ref": "#/definitions/logs.trendItem" - } - } - } - }, - "logs.logsResponse": { - "type": "object", - "properties": { - "has_more": { - "type": "boolean" - }, - "lines": { - "type": "array", - "items": { - "$ref": "#/definitions/logger.LogEntry" - } - }, - "next_cursor": { - "description": "用于加载更早日志的 cursor", - "type": "integer" - } - } - }, - "logs.topUserItem": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "nickname": { - "type": "string" - }, - "user_id": { - "type": "string", - "example": "0" - }, - "username": { - "type": "string" - } - } - }, - "logs.trendItem": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "date": { - "type": "string" - } - } - }, - "model.AccessToken": { - "type": "object", - "properties": { - "created_at": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "is_admin": { - "type": "boolean" - }, - "masked_token": { - "type": "string" - }, - "name": { - "type": "string" - }, - "updated_at": { - "type": "string" - }, - "user_id": { - "type": "integer" - } - } - }, "model.AcmeAccount": { "type": "object", "properties": { @@ -16334,44 +16780,91 @@ } } }, - "model.AuthSource": { + "model.BindRequest": { "type": "object", "properties": { - "client_id": { + "channel_id": { "type": "string" }, - "client_secret_configured": { - "type": "boolean" + "code": { + "type": "string" + } + } + }, + "model.BindingDTO": { + "type": "object", + "properties": { + "channel_id": { + "type": "string", + "example": "0" + }, + "channel_name": { + "type": "string" + }, + "channel_type": { + "type": "string" }, "created_at": { "type": "string" }, - "display_name": { + "id": { + "type": "string", + "example": "0" + }, + "platform_user_id": { "type": "string" }, - "icon_url": { + "user_id": { + "type": "string", + "example": "0" + } + } + }, + "model.BrowserItem": { + "type": "object", + "properties": { + "browser": { "type": "string" }, + "count": { + "type": "integer" + } + } + }, + "model.ChannelDTO": { + "type": "object", + "properties": { + "credentials": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "enabled": { + "type": "boolean" + }, + "extra": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, "id": { - "type": "integer" - }, - "is_active": { - "type": "boolean" + "type": "string", + "example": "0" }, "name": { "type": "string" }, - "openid_discovery_url": { - "type": "string" + "owner_id": { + "type": "string", + "example": "0" }, - "scopes": { + "owner_scope": { "type": "string" }, "type": { "type": "string" - }, - "updated_at": { - "type": "string" } } }, @@ -16433,6 +16926,243 @@ } } }, + "model.CreateChannelRequest": { + "type": "object", + "properties": { + "credentials": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "enabled": { + "type": "boolean" + }, + "extra": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "model.CreatePushChannelRequest": { + "type": "object", + "required": [ + "name", + "type" + ], + "properties": { + "description": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "other": { + "type": "string" + }, + "token": { + "type": "string" + }, + "type": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, + "model.CreatePushEventRequest": { + "type": "object", + "properties": { + "channels": { + "type": "array", + "items": { + "type": "string" + } + }, + "enabled": { + "type": "boolean" + }, + "event_key": { + "type": "string" + }, + "targets": { + "type": "array", + "items": { + "type": "string" + } + }, + "task_type": { + "type": "string" + }, + "template": { + "type": "string" + } + } + }, + "model.CreateScheduleRequest": { + "type": "object", + "required": [ + "cron", + "is_active", + "name", + "task_type" + ], + "properties": { + "cron": { + "type": "string" + }, + "is_active": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "payload": { + "type": "string" + }, + "task_type": { + "type": "string" + } + } + }, + "model.CreateSystemConfigRequest": { + "type": "object", + "required": [ + "key", + "type", + "value" + ], + "properties": { + "description": { + "type": "string", + "maxLength": 255 + }, + "key": { + "type": "string", + "maxLength": 64 + }, + "type": { + "type": "string", + "enum": [ + "system", + "business" + ] + }, + "value": { + "type": "string" + }, + "visibility": { + "type": "integer", + "enum": [ + 0, + 1 + ] + } + } + }, + "model.CreateTemplateRequest": { + "type": "object", + "required": [ + "content", + "key", + "name", + "type" + ], + "properties": { + "content": { + "type": "string" + }, + "description": { + "type": "string", + "maxLength": 255 + }, + "key": { + "type": "string", + "maxLength": 80 + }, + "name": { + "type": "string", + "maxLength": 100 + }, + "subject": { + "type": "string", + "maxLength": 255 + }, + "type": { + "type": "string", + "maxLength": 20 + } + } + }, + "model.CreateUserRequest": { + "type": "object", + "required": [ + "email", + "password", + "username" + ], + "properties": { + "email": { + "type": "string", + "maxLength": 255 + }, + "is_active": { + "type": "boolean" + }, + "is_admin": { + "type": "boolean" + }, + "nickname": { + "type": "string", + "maxLength": 64 + }, + "password": { + "type": "string", + "maxLength": 64, + "minLength": 8 + }, + "username": { + "type": "string", + "maxLength": 64, + "minLength": 3 + } + } + }, + "model.DBOverviewResponse": { + "type": "object", + "properties": { + "connections": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "size": { + "type": "string" + }, + "table_count": { + "type": "integer" + }, + "type": { + "type": "string" + }, + "version": { + "type": "string" + } + } + }, "model.DNSAccount": { "type": "object", "properties": { @@ -16453,31 +17183,184 @@ } } }, - "model.ExternalAccountView": { + "model.DatabaseInfoResponse": { "type": "object", "properties": { - "auth_source_id": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "version": { + "type": "string" + } + } + }, + "model.Definition": { + "type": "object", + "properties": { + "fields": { + "type": "array", + "items": { + "$ref": "#/definitions/model.Field" + } + }, + "type": { + "type": "string" + } + } + }, + "model.DispatchTaskRequest": { + "type": "object", + "required": [ + "task_type" + ], + "properties": { + "end_time": { + "type": "string" + }, + "payload": { + "type": "string" + }, + "start_time": { + "type": "string" + }, + "task_type": { + "type": "string" + }, + "user_id": { + "type": "integer" + } + } + }, + "model.ExecuteSQLRequest": { + "type": "object", + "required": [ + "sql" + ], + "properties": { + "sql": { + "type": "string" + } + } + }, + "model.ExecuteSQLResponse": { + "type": "object", + "properties": { + "affected_rows": { "type": "integer" }, - "auth_source_label": { + "columns": { + "type": "array", + "items": { + "type": "string" + } + }, + "execution_time_ms": { + "type": "integer" + }, + "results": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "type": { + "description": "\"select\" 或 \"exec\"", + "type": "string" + } + } + }, + "model.Field": { + "type": "object", + "properties": { + "key": { "type": "string" }, - "auth_source_name": { + "required": { + "type": "boolean" + }, + "type": { + "type": "string" + } + } + }, + "model.ListUsersResponse": { + "type": "object", + "properties": { + "total": { + "type": "integer" + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/model.UserResponse" + } + } + } + }, + "model.LogDatabaseStatus": { + "type": "object", + "properties": { + "active_database": { "type": "string" }, - "auth_source_type": { + "available_targets": { + "type": "array", + "items": { + "type": "string" + } + }, + "migration": { "type": "string" }, - "created_at": { - "type": "string" + "retention_days": { + "type": "object", + "additionalProperties": { + "type": "integer" + } + } + } + }, + "model.LogsAnalyticsResponse": { + "type": "object", + "properties": { + "browsers": { + "type": "array", + "items": { + "$ref": "#/definitions/model.BrowserItem" + } }, - "email": { - "type": "string" + "top_users": { + "type": "array", + "items": { + "$ref": "#/definitions/model.TopUserItem" + } }, - "external_username": { - "type": "string" + "trend": { + "type": "array", + "items": { + "$ref": "#/definitions/model.TrendItem" + } + } + } + }, + "model.LogsResponse": { + "type": "object", + "properties": { + "has_more": { + "type": "boolean" }, - "id": { + "lines": { + "type": "array", + "items": { + "$ref": "#/definitions/logger.LogEntry" + } + }, + "next_cursor": { + "description": "用于加载更早日志的 cursor", "type": "integer" } } @@ -16726,6 +17609,21 @@ } } }, + "model.PublicChannelDTO": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "0" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, "model.PushChannel": { "type": "object", "properties": { @@ -16733,37 +17631,30 @@ "type": "string" }, "description": { - "description": "备注", "type": "string" }, "enabled": { - "description": "通道是否启用", "type": "boolean" }, "id": { "type": "integer" }, "name": { - "description": "通道名称,仅英文字母和下划线,唯一", "type": "string" }, "other": { - "description": "请求体/SMTP 密码等", "type": "string" }, "token": { - "description": "鉴权令牌或发信用户名等", "type": "string" }, "type": { - "description": "通道类型:custom, lark, email", "type": "string" }, "updated_at": { "type": "string" }, "url": { - "description": "请求地址,HTTPS 协议或 SMTP 地址", "type": "string" } } @@ -16772,7 +17663,6 @@ "type": "object", "properties": { "channels": { - "description": "推送渠道列表,如 [\"lark\"]", "type": "array", "items": { "type": "string" @@ -16782,33 +17672,27 @@ "type": "string" }, "enabled": { - "description": "是否启用", "type": "boolean" }, "event_key": { - "description": "如 admin_login", "type": "string" }, "id": { "type": "integer" }, "name": { - "description": "如 管理员登录", "type": "string" }, "targets": { - "description": "推送目标用户/邮箱列表", "type": "array", "items": { "type": "string" } }, "task_type": { - "description": "关联的异步任务类型", "type": "string" }, "template": { - "description": "消息模板 JSON", "type": "string" }, "updated_at": { @@ -16816,95 +17700,92 @@ } } }, - "model.PushHistory": { + "model.SystemStatusResponse": { "type": "object", "properties": { - "channel": { + "alloc": { "type": "string" }, - "content": { + "buck_hash_sys": { "type": "string" }, - "created_at": { - "type": "string" - }, - "error_msg": { - "type": "string" - }, - "event_key": { - "type": "string" - }, - "id": { + "frees": { "type": "integer" }, - "level": { + "gc_sys": { "type": "string" }, - "status": { - "description": "success / failed", + "heap_alloc": { "type": "string" }, - "target": { + "heap_idle": { "type": "string" }, - "title": { - "type": "string" - } - } - }, - "model.Schedule": { - "type": "object", - "properties": { - "created_at": { + "heap_inuse": { "type": "string" }, - "cron": { - "type": "string" - }, - "id": { - "type": "string", - "example": "0" - }, - "is_active": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "payload": { - "type": "string" - }, - "task_type": { - "type": "string" - }, - "updated_at": { - "type": "string" - } - } - }, - "model.SystemConfig": { - "type": "object", - "properties": { - "created_at": { - "type": "string" - }, - "description": { - "type": "string" - }, - "key": { - "type": "string" - }, - "type": { - "type": "string" - }, - "updated_at": { - "type": "string" - }, - "value": { - "type": "string" - }, - "visibility": { + "heap_objects": { "type": "integer" + }, + "heap_released": { + "type": "string" + }, + "heap_sys": { + "type": "string" + }, + "last_gc_time": { + "type": "string" + }, + "last_pause": { + "type": "string" + }, + "lookups": { + "type": "integer" + }, + "mallocs": { + "type": "integer" + }, + "mcache_inuse": { + "type": "string" + }, + "mcache_sys": { + "type": "string" + }, + "mspan_inuse": { + "type": "string" + }, + "mspan_sys": { + "type": "string" + }, + "next_gc": { + "type": "string" + }, + "num_gc": { + "type": "integer" + }, + "num_goroutine": { + "type": "integer" + }, + "other_sys": { + "type": "string" + }, + "pause_total_ns": { + "type": "string" + }, + "stack_inuse": { + "type": "string" + }, + "stack_sys": { + "type": "string" + }, + "sys": { + "type": "string" + }, + "total_alloc": { + "type": "string" + }, + "uptime": { + "type": "string" } } }, @@ -16973,66 +17854,6 @@ } } }, - "model.TaskExecution": { - "type": "object", - "properties": { - "created_at": { - "type": "string" - }, - "duration": { - "type": "integer" - }, - "error_message": { - "type": "string" - }, - "finished_at": { - "type": "string" - }, - "id": { - "type": "string", - "example": "0" - }, - "log": { - "type": "string" - }, - "max_retry": { - "type": "integer" - }, - "payload": { - "type": "string" - }, - "result": { - "type": "string" - }, - "retry_count": { - "type": "integer" - }, - "retryable": { - "type": "boolean" - }, - "started_at": { - "type": "string" - }, - "status": { - "$ref": "#/definitions/model.TaskExecutionStatus" - }, - "task_id": { - "type": "string" - }, - "task_name": { - "type": "string" - }, - "task_type": { - "type": "string" - }, - "triggered_by": { - "type": "string" - }, - "updated_at": { - "type": "string" - } - } - }, "model.TaskExecutionStatus": { "type": "string", "enum": [ @@ -17048,167 +17869,414 @@ "TaskExecutionStatusFailed" ] }, - "model.Template": { + "model.TestPushChannelRequest": { "type": "object", "properties": { - "content": { - "type": "string" - }, - "created_at": { - "type": "string" - }, - "description": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "is_system": { - "type": "boolean" - }, - "key": { - "type": "string" - }, "name": { "type": "string" }, - "subject": { + "other": { + "type": "string" + }, + "target": { + "type": "string" + }, + "token": { "type": "string" }, "type": { "type": "string" }, - "updated_at": { + "url": { "type": "string" } } }, - "model.Upload": { + "model.TestPushRequest": { + "type": "object", + "required": [ + "config" + ], + "properties": { + "config": { + "$ref": "#/definitions/push.Config" + }, + "target": { + "type": "string" + } + } + }, + "model.TestSMTPRequest": { + "type": "object", + "required": [ + "smtp_host", + "smtp_password", + "smtp_port", + "smtp_username", + "to" + ], + "properties": { + "smtp_host": { + "type": "string", + "maxLength": 255 + }, + "smtp_password": { + "type": "string", + "maxLength": 255 + }, + "smtp_port": { + "type": "integer" + }, + "smtp_username": { + "type": "string", + "maxLength": 255 + }, + "to": { + "type": "string" + } + } + }, + "model.TestSMTPResponse": { "type": "object", "properties": { - "access_mode": { + "error": { + "type": "string" + }, + "log": { + "type": "string" + }, + "success": { + "type": "boolean" + } + } + }, + "model.TopUserItem": { + "type": "object", + "properties": { + "count": { "type": "integer" }, - "created_at": { - "type": "string" - }, - "extension": { - "description": "文件后缀名 (不含点,如 png, pdf)", - "type": "string" - }, - "file_name": { - "description": "原始文件名 (例如: image.png)", - "type": "string" - }, - "file_path": { - "description": "文件相对路径 / S3 Key", - "type": "string" - }, - "file_size": { - "description": "文件大小(字节)", - "type": "integer" - }, - "hash": { - "description": "文件哈希 (SHA-256/MD5,可用于排重)", - "type": "string" - }, - "id": { - "type": "string", - "example": "0" - }, - "metadata": { - "description": "业务扩展元数据", - "allOf": [ - { - "$ref": "#/definitions/model.UploadMetadata" - } - ] - }, - "mime_type": { - "description": "媒体类型 (MIME, 如 image/png)", - "type": "string" - }, - "status": { - "description": "状态", - "allOf": [ - { - "$ref": "#/definitions/model.UploadStatus" - } - ] - }, - "type": { - "description": "业务标识类型 (如 avatar, doc, attachment)", - "type": "string" - }, - "updated_at": { + "nickname": { "type": "string" }, "user_id": { "type": "string", "example": "0" + }, + "username": { + "type": "string" } } }, - "model.UploadMetadata": { + "model.TrendItem": { "type": "object", "properties": { - "bucket": { - "description": "存储桶名称 (适用于 S3 等)", - "type": "string" - }, - "client_ip": { - "description": "上传者 IP", - "type": "string" - }, - "duration": { - "description": "音视频时长 (s)", - "type": "number" - }, - "extra": { - "description": "其它任意业务自定义元数据", - "type": "object", - "additionalProperties": {} - }, - "height": { - "description": "图像/视频高度 (px)", + "count": { "type": "integer" }, - "original_mime": { - "description": "原始 MIME 类型", + "date": { "type": "string" - }, - "user_agent": { - "description": "上传者的 UA", - "type": "string" - }, - "width": { - "description": "图像/视频宽度 (px)", - "type": "integer" } } }, - "model.UploadStatus": { - "type": "string", - "enum": [ - "pending", - "used", - "deleted" + "model.UpdateCacheConfigRequest": { + "type": "object", + "required": [ + "max_size_mb", + "ttl_minutes" ], - "x-enum-comments": { - "UploadStatusDeleted": "已删除", - "UploadStatusPending": "待使用", - "UploadStatusUsed": "已使用" - }, - "x-enum-descriptions": [ - "待使用", - "已使用", - "已删除" + "properties": { + "lru_enabled": { + "type": "boolean" + }, + "max_size_mb": { + "type": "integer", + "minimum": 1 + }, + "ttl_minutes": { + "type": "integer", + "minimum": 0 + } + } + }, + "model.UpdateChannelRequest": { + "type": "object", + "properties": { + "credentials": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "enabled": { + "type": "boolean" + }, + "extra": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "type": "string" + } + } + }, + "model.UpdatePushChannelRequest": { + "type": "object", + "required": [ + "type" ], - "x-enum-varnames": [ - "UploadStatusPending", - "UploadStatusUsed", - "UploadStatusDeleted" - ] + "properties": { + "description": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "other": { + "type": "string" + }, + "token": { + "type": "string" + }, + "type": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, + "model.UpdatePushEventRequest": { + "type": "object", + "required": [ + "template" + ], + "properties": { + "channels": { + "type": "array", + "items": { + "type": "string" + } + }, + "enabled": { + "type": "boolean" + }, + "targets": { + "type": "array", + "items": { + "type": "string" + } + }, + "template": { + "type": "string" + } + } + }, + "model.UpdateScheduleRequest": { + "type": "object", + "required": [ + "cron", + "is_active", + "name", + "task_type" + ], + "properties": { + "cron": { + "type": "string" + }, + "is_active": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "payload": { + "type": "string" + }, + "task_type": { + "type": "string" + } + } + }, + "model.UpdateSystemConfigRequest": { + "type": "object", + "required": [ + "value" + ], + "properties": { + "description": { + "type": "string", + "maxLength": 255 + }, + "value": { + "type": "string" + }, + "visibility": { + "type": "integer", + "enum": [ + 0, + 1 + ] + } + } + }, + "model.UpdateTemplateRequest": { + "type": "object", + "required": [ + "content", + "name", + "type" + ], + "properties": { + "content": { + "type": "string" + }, + "description": { + "type": "string", + "maxLength": 255 + }, + "name": { + "type": "string", + "maxLength": 100 + }, + "subject": { + "type": "string", + "maxLength": 255 + }, + "type": { + "type": "string", + "maxLength": 20 + } + } + }, + "model.UpdateUserRequest": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "email": { + "type": "string", + "maxLength": 255 + }, + "is_admin": { + "type": "boolean" + }, + "nickname": { + "type": "string", + "maxLength": 64 + }, + "password": { + "type": "string", + "maxLength": 64, + "minLength": 8 + } + } + }, + "model.UpdateUserStatusRequest": { + "type": "object", + "properties": { + "is_active": { + "type": "boolean" + } + } + }, + "model.UpdaterStatus": { + "type": "object", + "properties": { + "asset_name": { + "type": "string" + }, + "build_time": { + "type": "string" + }, + "can_upgrade": { + "type": "boolean" + }, + "current_version": { + "type": "string" + }, + "latest_version": { + "type": "string" + }, + "platform": { + "type": "string" + }, + "prerelease": { + "type": "boolean" + }, + "published_at": { + "type": "string" + }, + "release_name": { + "type": "string" + }, + "release_notes": { + "type": "string" + }, + "release_url": { + "type": "string" + }, + "update_available": { + "type": "boolean" + }, + "upstream_repository": { + "type": "string" + } + } + }, + "model.UserResponse": { + "type": "object", + "properties": { + "avatar_url": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "email": { + "type": "string" + }, + "gender": { + "type": "string" + }, + "id": { + "type": "string", + "example": "0" + }, + "is_active": { + "type": "boolean" + }, + "is_admin": { + "type": "boolean" + }, + "last_login_at": { + "type": "string" + }, + "location": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "username": { + "type": "string" + }, + "website": { + "type": "string" + } + } }, "model.Zone": { "type": "object", @@ -17253,6 +18321,108 @@ } } }, + "models.Upload": { + "type": "object", + "properties": { + "access_mode": { + "type": "integer" + }, + "created_at": { + "type": "string" + }, + "extension": { + "type": "string" + }, + "file_name": { + "type": "string" + }, + "file_path": { + "type": "string" + }, + "file_size": { + "type": "integer" + }, + "hash": { + "type": "string" + }, + "id": { + "type": "string", + "example": "0" + }, + "metadata": { + "$ref": "#/definitions/models.UploadMetadata" + }, + "mime_type": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/models.UploadStatus" + }, + "type": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "user_id": { + "type": "string", + "example": "0" + } + } + }, + "models.UploadMetadata": { + "type": "object", + "properties": { + "bucket": { + "type": "string" + }, + "client_ip": { + "type": "string" + }, + "duration": { + "type": "number" + }, + "extra": { + "type": "object", + "additionalProperties": {} + }, + "height": { + "type": "integer" + }, + "original_mime": { + "type": "string" + }, + "user_agent": { + "type": "string" + }, + "width": { + "type": "integer" + } + } + }, + "models.UploadStatus": { + "type": "string", + "enum": [ + "pending", + "used", + "deleted" + ], + "x-enum-comments": { + "UploadStatusDeleted": "已删除", + "UploadStatusPending": "待使用", + "UploadStatusUsed": "已使用" + }, + "x-enum-descriptions": [ + "待使用", + "已使用", + "已删除" + ], + "x-enum-varnames": [ + "UploadStatusPending", + "UploadStatusUsed", + "UploadStatusDeleted" + ] + }, "node.AgentReleaseInfo": { "type": "object", "properties": { @@ -17526,107 +18696,6 @@ } } }, - "oauth.AuthSourceView": { - "type": "object", - "properties": { - "client_secret_configured": { - "type": "boolean" - }, - "display_name": { - "type": "string" - }, - "icon_url": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "is_active": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, - "oauth.BasicUserInfo": { - "type": "object", - "properties": { - "avatar_url": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "email": { - "type": "string" - }, - "gender": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "is_admin": { - "type": "boolean" - }, - "location": { - "type": "string" - }, - "need_change_password": { - "type": "boolean" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "username": { - "type": "string" - }, - "website": { - "type": "string" - } - } - }, - "oauth.CallbackRequest": { - "type": "object", - "required": [ - "code", - "state" - ], - "properties": { - "code": { - "type": "string" - }, - "state": { - "type": "string" - } - } - }, - "oauth.OAuthAuthorizeResponse": { - "type": "object", - "properties": { - "authorize_url": { - "type": "string" - } - } - }, - "oauth.OAuthCallbackResult": { - "type": "object", - "properties": { - "status": { - "type": "string" - }, - "user": { - "$ref": "#/definitions/oauth.BasicUserInfo" - } - } - }, "observability.AccessLogCleanupInput": { "type": "object", "properties": { @@ -19441,257 +20510,6 @@ } } }, - "push.CreateChannelRequest": { - "type": "object", - "required": [ - "name", - "type" - ], - "properties": { - "description": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "other": { - "type": "string" - }, - "token": { - "type": "string" - }, - "type": { - "type": "string" - }, - "url": { - "type": "string" - } - } - }, - "push.CreateEventRequest": { - "type": "object", - "properties": { - "channels": { - "type": "array", - "items": { - "type": "string" - } - }, - "enabled": { - "type": "boolean" - }, - "event_key": { - "type": "string" - }, - "targets": { - "type": "array", - "items": { - "type": "string" - } - }, - "task_type": { - "description": "关联的异步任务类型", - "type": "string" - }, - "template": { - "type": "string" - } - } - }, - "push.Definition": { - "type": "object", - "properties": { - "description": { - "description": "short description", - "type": "string" - }, - "fields": { - "description": "form fields", - "type": "array", - "items": { - "$ref": "#/definitions/push.Field" - } - }, - "name": { - "description": "display name", - "type": "string" - }, - "type": { - "description": "channel type (e.g., custom, lark, email)", - "type": "string" - } - } - }, - "push.EventMetadata": { - "type": "object", - "properties": { - "default_template": { - "$ref": "#/definitions/push.NotificationMessage" - }, - "description": { - "type": "string" - }, - "key": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "push.Field": { - "type": "object", - "properties": { - "description": { - "description": "field explanation/help text", - "type": "string" - }, - "key": { - "description": "unique key for the field (e.g. url, token, other)", - "type": "string" - }, - "label": { - "description": "human readable label (e.g. \"Webhook 地址\")", - "type": "string" - }, - "placeholder": { - "description": "input placeholder", - "type": "string" - }, - "required": { - "description": "whether this field is required", - "type": "boolean" - }, - "type": { - "description": "input type: \"text\" | \"password\" | \"textarea\"", - "type": "string" - } - } - }, - "push.NotificationMessage": { - "type": "object", - "properties": { - "content": { - "type": "string" - }, - "ext": { - "type": "object", - "additionalProperties": {} - }, - "level": { - "type": "string" - }, - "title": { - "type": "string" - } - } - }, - "push.TestChannelRequest": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "other": { - "type": "string" - }, - "target": { - "type": "string" - }, - "token": { - "type": "string" - }, - "type": { - "type": "string" - }, - "url": { - "type": "string" - } - } - }, - "push.TestPushRequest": { - "type": "object", - "required": [ - "config" - ], - "properties": { - "config": { - "$ref": "#/definitions/push.Config" - }, - "target": { - "type": "string" - } - } - }, - "push.UpdateChannelRequest": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "description": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "other": { - "type": "string" - }, - "token": { - "type": "string" - }, - "type": { - "type": "string" - }, - "url": { - "type": "string" - } - } - }, - "push.UpdateEventRequest": { - "type": "object", - "required": [ - "template" - ], - "properties": { - "channels": { - "type": "array", - "items": { - "type": "string" - } - }, - "enabled": { - "type": "boolean" - }, - "targets": { - "type": "array", - "items": { - "type": "string" - } - }, - "template": { - "type": "string" - } - } - }, - "push.pushHistoriesResponse": { - "type": "object", - "properties": { - "results": { - "type": "array", - "items": { - "$ref": "#/definitions/model.PushHistory" - } - }, - "total": { - "type": "integer" - } - } - }, "relay.HeartbeatPayload": { "type": "object", "properties": { @@ -19760,439 +20578,29 @@ } } }, - "status.DatabaseInfoResponse": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "version": { - "type": "string" - } - } - }, - "status.LogDatabaseStatus": { - "type": "object", - "properties": { - "active_database": { - "type": "string" - }, - "available_targets": { - "type": "array", - "items": { - "type": "string" - } - }, - "clickhouse": { - "$ref": "#/definitions/Wavelet_OpenFlare_plugins_server_model_analytics.ClickHouseOperationalStats" - }, - "migration": { - "description": "idle | migrating", - "type": "string" - }, - "retention_days": { - "type": "object", - "additionalProperties": { - "type": "integer" - } - } - } - }, - "status.SystemStatusResponse": { - "type": "object", - "properties": { - "alloc": { - "type": "string" - }, - "buck_hash_sys": { - "type": "string" - }, - "frees": { - "type": "integer" - }, - "gc_sys": { - "type": "string" - }, - "heap_alloc": { - "type": "string" - }, - "heap_idle": { - "type": "string" - }, - "heap_inuse": { - "type": "string" - }, - "heap_objects": { - "type": "integer" - }, - "heap_released": { - "type": "string" - }, - "heap_sys": { - "type": "string" - }, - "last_gc_time": { - "type": "string" - }, - "last_pause": { - "type": "string" - }, - "lookups": { - "type": "integer" - }, - "mallocs": { - "type": "integer" - }, - "mcache_inuse": { - "type": "string" - }, - "mcache_sys": { - "type": "string" - }, - "mspan_inuse": { - "type": "string" - }, - "mspan_sys": { - "type": "string" - }, - "next_gc": { - "type": "string" - }, - "num_gc": { - "type": "integer" - }, - "num_goroutine": { - "type": "integer" - }, - "other_sys": { - "type": "string" - }, - "pause_total_ns": { - "type": "string" - }, - "stack_inuse": { - "type": "string" - }, - "stack_sys": { - "type": "string" - }, - "sys": { - "type": "string" - }, - "total_alloc": { - "type": "string" - }, - "uptime": { - "type": "string" - } - } - }, - "system_config.CreateSystemConfigRequest": { - "type": "object", - "required": [ - "key", - "type", - "value" + "time.Duration": { + "type": "integer", + "format": "int64", + "enum": [ + -9223372036854775808, + 9223372036854775807, + 1, + 1000, + 1000000, + 1000000000, + 60000000000, + 3600000000000 ], - "properties": { - "description": { - "type": "string", - "maxLength": 255 - }, - "key": { - "type": "string", - "maxLength": 64 - }, - "type": { - "type": "string", - "enum": [ - "system", - "business" - ] - }, - "value": { - "type": "string" - }, - "visibility": { - "type": "integer", - "enum": [ - 0, - 1 - ] - } - } - }, - "system_config.TestSMTPRequest": { - "type": "object", - "required": [ - "smtp_host", - "smtp_password", - "smtp_port", - "smtp_username", - "to" - ], - "properties": { - "smtp_host": { - "type": "string", - "maxLength": 255 - }, - "smtp_password": { - "type": "string", - "maxLength": 255 - }, - "smtp_port": { - "type": "integer" - }, - "smtp_username": { - "type": "string", - "maxLength": 255 - }, - "to": { - "type": "string" - } - } - }, - "system_config.TestSMTPResponse": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "log": { - "type": "string" - }, - "success": { - "type": "boolean" - } - } - }, - "system_config.UpdateSystemConfigRequest": { - "type": "object", - "required": [ - "value" - ], - "properties": { - "description": { - "type": "string", - "maxLength": 255 - }, - "value": { - "type": "string" - }, - "visibility": { - "type": "integer", - "enum": [ - 0, - 1 - ] - } - } - }, - "task.CreateScheduleRequest": { - "type": "object", - "required": [ - "cron", - "is_active", - "name", - "task_type" - ], - "properties": { - "cron": { - "type": "string" - }, - "is_active": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "payload": { - "type": "string" - }, - "task_type": { - "type": "string" - } - } - }, - "task.DispatchTaskRequest": { - "type": "object", - "required": [ - "task_type" - ], - "properties": { - "end_time": { - "type": "string" - }, - "payload": { - "type": "string" - }, - "start_time": { - "type": "string" - }, - "task_type": { - "type": "string" - }, - "user_id": { - "type": "integer" - } - } - }, - "task.TaskMeta": { - "type": "object", - "properties": { - "asynq_task": { - "type": "string" - }, - "description": { - "type": "string" - }, - "max_retry": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "params": { - "type": "array", - "items": { - "$ref": "#/definitions/task.TaskParam" - } - }, - "queue": { - "type": "string" - }, - "retryable": { - "description": "是否支持手动重试", - "type": "boolean" - }, - "supports_time": { - "type": "boolean" - }, - "type": { - "type": "string" - } - } - }, - "task.TaskParam": { - "type": "object", - "properties": { - "description": { - "description": "描述", - "type": "string" - }, - "label": { - "description": "显示名称", - "type": "string" - }, - "name": { - "description": "参数键名", - "type": "string" - }, - "placeholder": { - "description": "占位符", - "type": "string" - }, - "required": { - "description": "是否必填", - "type": "boolean" - }, - "type": { - "description": "类型:string, text, number, boolean", - "type": "string" - } - } - }, - "task.UpdateScheduleRequest": { - "type": "object", - "required": [ - "cron", - "is_active", - "name", - "task_type" - ], - "properties": { - "cron": { - "type": "string" - }, - "is_active": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "payload": { - "type": "string" - }, - "task_type": { - "type": "string" - } - } - }, - "template.CreateTemplateRequest": { - "type": "object", - "required": [ - "content", - "key", - "name", - "type" - ], - "properties": { - "content": { - "type": "string" - }, - "description": { - "type": "string", - "maxLength": 255 - }, - "key": { - "type": "string", - "maxLength": 80 - }, - "name": { - "type": "string", - "maxLength": 100 - }, - "subject": { - "type": "string", - "maxLength": 255 - }, - "type": { - "type": "string", - "maxLength": 20 - } - } - }, - "template.UpdateTemplateRequest": { - "type": "object", - "required": [ - "content", - "name", - "type" - ], - "properties": { - "content": { - "type": "string" - }, - "description": { - "type": "string", - "maxLength": 255 - }, - "name": { - "type": "string", - "maxLength": 100 - }, - "subject": { - "type": "string", - "maxLength": 255 - }, - "type": { - "type": "string", - "maxLength": 20 - } - } + "x-enum-varnames": [ + "minDuration", + "maxDuration", + "Nanosecond", + "Microsecond", + "Millisecond", + "Second", + "Minute", + "Hour" + ] }, "tls.ApplyInput": { "type": "object", @@ -20369,8 +20777,38 @@ } } }, + "user.AccessToken": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "is_admin": { + "type": "boolean" + }, + "masked_token": { + "type": "string" + }, + "name": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "user_id": { + "type": "integer" + } + } + }, "user.changePasswordRequest": { "type": "object", + "required": [ + "new_password", + "old_password" + ], "properties": { "new_password": { "type": "string" @@ -20380,9 +20818,15 @@ } } }, - "user.createTokenRequest": { + "user.createAccessTokenRequest": { "type": "object", + "required": [ + "name" + ], "properties": { + "expires_at": { + "type": "string" + }, "is_admin": { "type": "boolean" }, @@ -20391,60 +20835,13 @@ } } }, - "user.createUserRequest": { + "user.loginRequest": { "type": "object", "required": [ - "email", "password", "username" ], "properties": { - "email": { - "type": "string", - "maxLength": 255 - }, - "is_active": { - "type": "boolean" - }, - "is_admin": { - "type": "boolean" - }, - "nickname": { - "type": "string", - "maxLength": 64 - }, - "password": { - "type": "string", - "maxLength": 64, - "minLength": 8 - }, - "username": { - "type": "string", - "maxLength": 64, - "minLength": 3 - } - } - }, - "user.listUsersResponse": { - "type": "object", - "properties": { - "total": { - "type": "integer" - }, - "users": { - "type": "array", - "items": { - "$ref": "#/definitions/user.user" - } - } - } - }, - "user.loginRequest": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, "password": { "type": "string" }, @@ -20455,19 +20852,14 @@ }, "user.registerRequest": { "type": "object", + "required": [ + "password", + "username" + ], "properties": { - "code": { - "type": "string" - }, - "display_name": { - "type": "string" - }, "email": { "type": "string" }, - "nickname": { - "type": "string" - }, "password": { "type": "string" }, @@ -20476,32 +20868,6 @@ } } }, - "user.sendEmailCodeRequest": { - "type": "object", - "required": [ - "email", - "scene" - ], - "properties": { - "email": { - "type": "string" - }, - "scene": { - "type": "string" - } - } - }, - "user.tokenResponse": { - "type": "object", - "properties": { - "record": { - "$ref": "#/definitions/model.AccessToken" - }, - "token": { - "type": "string" - } - } - }, "user.updateProfileRequest": { "type": "object", "properties": { @@ -20511,9 +20877,6 @@ "bio": { "type": "string" }, - "email": { - "type": "string" - }, "gender": { "type": "string" }, @@ -20531,89 +20894,6 @@ } } }, - "user.updateUserRequest": { - "type": "object", - "required": [ - "email" - ], - "properties": { - "email": { - "type": "string", - "maxLength": 255 - }, - "is_admin": { - "type": "boolean" - }, - "nickname": { - "type": "string", - "maxLength": 64 - }, - "password": { - "type": "string", - "maxLength": 64, - "minLength": 8 - } - } - }, - "user.updateUserStatusRequest": { - "type": "object", - "properties": { - "is_active": { - "type": "boolean" - } - } - }, - "user.user": { - "type": "object", - "properties": { - "avatar_url": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "created_at": { - "type": "string" - }, - "email": { - "type": "string" - }, - "gender": { - "type": "string" - }, - "id": { - "type": "string", - "example": "0" - }, - "is_active": { - "type": "boolean" - }, - "is_admin": { - "type": "boolean" - }, - "last_login_at": { - "type": "string" - }, - "location": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "updated_at": { - "type": "string" - }, - "username": { - "type": "string" - }, - "website": { - "type": "string" - } - } - }, "waf.CreateRuleInput": { "type": "object", "properties": { diff --git a/backend/docs/swagger.yaml b/backend/docs/swagger.yaml index 47fc0e58..649361ae 100644 --- a/backend/docs/swagger.yaml +++ b/backend/docs/swagger.yaml @@ -1,54 +1,5 @@ basePath: / definitions: - Wavelet_OpenFlare_plugins_server_cap.ChallengeResponse: - properties: - challenge: - properties: - c: - type: integer - d: - type: integer - s: - type: integer - type: object - expires: - description: ms timestamp - type: integer - token: - type: string - type: object - Wavelet_OpenFlare_plugins_server_cap.RedeemResponse: - properties: - error: - type: string - expires: - type: integer - success: - type: boolean - token: - type: string - type: object - Wavelet_OpenFlare_plugins_server_model_analytics.ClickHouseOperationalStats: - properties: - active_parts: - type: integer - async_insert_bytes: - type: integer - async_insert_queue: - type: integer - batch_writers: - description: BatchWriters reports in-process queue depth/drops/flush errors - for CH writers. - items: - $ref: '#/definitions/analytics.BatchWriterStats' - type: array - database: - type: string - pending_mutations: - type: integer - total_rows: - type: integer - type: object Wavelet_OpenFlare_share_protocol.ActiveConfigMeta: properties: checksum: @@ -205,6 +156,106 @@ definitions: type: type: string type: object + Wavelet_plugins_domain_admin_model.Schedule: + properties: + created_at: + type: string + cron: + type: string + id: + example: "0" + type: string + is_active: + type: boolean + name: + type: string + payload: + type: string + task_type: + type: string + updated_at: + type: string + type: object + Wavelet_plugins_domain_admin_model.SystemConfig: + properties: + created_at: + type: string + description: + type: string + key: + type: string + type: + type: string + updated_at: + type: string + value: + type: string + visibility: + type: integer + type: object + Wavelet_plugins_domain_admin_model.TaskExecution: + properties: + created_at: + type: string + duration: + type: integer + error_message: + type: string + finished_at: + type: string + id: + example: "0" + type: string + log: + type: string + max_retry: + type: integer + payload: + type: string + result: + type: string + retry_count: + type: integer + retryable: + type: boolean + started_at: + type: string + status: + $ref: '#/definitions/model.TaskExecutionStatus' + task_id: + type: string + task_name: + type: string + task_type: + type: string + triggered_by: + type: string + updated_at: + type: string + type: object + Wavelet_plugins_domain_admin_model.Template: + properties: + content: + type: string + created_at: + type: string + description: + type: string + id: + type: integer + is_system: + type: boolean + key: + type: string + name: + type: string + subject: + type: string + type: + type: string + updated_at: + type: string + type: object agent.ActiveConfigMeta: properties: checksum: @@ -374,21 +425,6 @@ definitions: $ref: '#/definitions/Wavelet_OpenFlare_share_protocol.WAFIPGroup' type: array type: object - analytics.BatchWriterStats: - properties: - cap: - type: integer - depth: - type: integer - drops: - type: integer - flush_errors: - type: integer - name: - type: string - running: - type: boolean - type: object apply_log.CleanupInput: properties: delete_all: @@ -420,45 +456,99 @@ definitions: totalPage: type: integer type: object - auth_source.AuthSourceRequest: + auth.AuthSourceView: properties: - client_id: - type: string - client_secret: - type: string + client_secret_configured: + type: boolean display_name: type: string icon_url: type: string + id: + type: integer is_active: type: boolean name: type: string - openid_discovery_url: - type: string - scopes: - type: string type: type: string type: object - auth_source.ToggleAuthSourceRequest: + auth.BasicUserInfo: properties: - is_active: + avatar_url: + type: string + bio: + type: string + email: + type: string + gender: + type: string + id: + type: integer + is_admin: type: boolean + location: + type: string + need_change_password: + type: boolean + nickname: + type: string + phone: + type: string + username: + type: string + website: + type: string type: object - cache.updateCacheConfigRequest: + auth.CallbackRequest: properties: - lru_enabled: - type: boolean - max_size_mb: - minimum: 1 - type: integer - ttl_minutes: - minimum: 0 - type: integer + code: + type: string + state: + type: string required: - - max_size_mb - - ttl_minutes + - code + - state + type: object + auth.OAuthAuthorizeResponse: + properties: + authorize_url: + type: string + type: object + auth.OAuthCallbackResult: + properties: + status: + type: string + user: + $ref: '#/definitions/auth.BasicUserInfo' + type: object + cap.ChallengeResponse: + properties: + challenge: + properties: + c: + type: integer + d: + type: integer + s: + type: integer + type: object + expires: + description: ms timestamp + type: integer + token: + type: string + type: object + cap.RedeemResponse: + properties: + error: + type: string + expires: + type: integer + success: + type: boolean + token: + type: string type: object cap.challengeRequest: properties: @@ -717,6 +807,81 @@ definitions: path: type: string type: object + contracts.AuthSourceDTO: + properties: + client_id: + type: string + client_secret: + type: string + created_at: + type: string + display_name: + type: string + icon_url: + type: string + id: + example: "0" + type: string + is_active: + type: boolean + name: + type: string + openid_discovery_url: + type: string + scopes: + type: string + type: + type: string + updated_at: + type: string + type: object + contracts.TaskMetaDTO: + properties: + asynq_task: + type: string + category: + type: string + description: + type: string + display_name: + type: string + max_retry: + type: integer + name: + type: string + params: + items: + $ref: '#/definitions/contracts.TaskParamDTO' + type: array + queue: + type: string + retryable: + type: boolean + schedule: + type: string + supports_time: + type: boolean + timeout: + $ref: '#/definitions/time.Duration' + type: + type: string + type: object + contracts.TaskParamDTO: + properties: + default: {} + description: + type: string + label: + type: string + name: + type: string + placeholder: + type: string + required: + type: boolean + type: + type: string + type: object dashboard.Capacity: properties: average_cpu_usage_percent: @@ -816,48 +981,7 @@ definitions: type: array type: array type: object - db_manage.DBOverviewResponse: - properties: - connections: - type: integer - name: - type: string - size: - type: string - table_count: - type: integer - type: - type: string - version: - type: string - type: object - db_manage.ExecuteSQLRequest: - properties: - sql: - type: string - required: - - sql - type: object - db_manage.ExecuteSQLResponse: - properties: - affected_rows: - type: integer - columns: - items: - type: string - type: array - execution_time_ms: - type: integer - results: - items: - additionalProperties: {} - type: object - type: array - type: - description: '"select" 或 "exec"' - type: string - type: object - diskcache.Status: + disk.Status: properties: base_path: type: string @@ -974,7 +1098,7 @@ definitions: properties: items: items: - $ref: '#/definitions/model.Upload' + $ref: '#/definitions/models.Upload' type: array page: type: integer @@ -987,7 +1111,7 @@ definitions: properties: items: items: - $ref: '#/definitions/model.Upload' + $ref: '#/definitions/models.Upload' type: array page: type: integer @@ -1025,7 +1149,7 @@ definitions: description: 全局递增序号 type: integer type: object - logs.accessLogItem: + model.AccessLogItem: properties: created_at: type: string @@ -1046,6 +1170,8 @@ definitions: type: string status: type: integer + trace_id: + type: string user_agent: type: string user_id: @@ -1054,85 +1180,15 @@ definitions: username: type: string type: object - logs.accessLogsResponse: + model.AccessLogsResponse: properties: list: items: - $ref: '#/definitions/logs.accessLogItem' + $ref: '#/definitions/model.AccessLogItem' type: array total: type: integer type: object - logs.browserItem: - properties: - browser: - type: string - count: - type: integer - type: object - logs.logsAnalyticsResponse: - properties: - browsers: - items: - $ref: '#/definitions/logs.browserItem' - type: array - top_users: - items: - $ref: '#/definitions/logs.topUserItem' - type: array - trend: - items: - $ref: '#/definitions/logs.trendItem' - type: array - type: object - logs.logsResponse: - properties: - has_more: - type: boolean - lines: - items: - $ref: '#/definitions/logger.LogEntry' - type: array - next_cursor: - description: 用于加载更早日志的 cursor - type: integer - type: object - logs.topUserItem: - properties: - count: - type: integer - nickname: - type: string - user_id: - example: "0" - type: string - username: - type: string - type: object - logs.trendItem: - properties: - count: - type: integer - date: - type: string - type: object - model.AccessToken: - properties: - created_at: - type: string - id: - type: integer - is_admin: - type: boolean - masked_token: - type: string - name: - type: string - updated_at: - type: string - user_id: - type: integer - type: object model.AcmeAccount: properties: created_at: @@ -1146,32 +1202,64 @@ definitions: url: type: string type: object - model.AuthSource: + model.BindRequest: properties: - client_id: + channel_id: + type: string + code: + type: string + type: object + model.BindingDTO: + properties: + channel_id: + example: "0" + type: string + channel_name: + type: string + channel_type: type: string - client_secret_configured: - type: boolean created_at: type: string - display_name: - type: string - icon_url: - type: string id: + example: "0" + type: string + platform_user_id: + type: string + user_id: + example: "0" + type: string + type: object + model.BrowserItem: + properties: + browser: + type: string + count: type: integer - is_active: + type: object + model.ChannelDTO: + properties: + credentials: + additionalProperties: + type: string + type: object + enabled: type: boolean + extra: + additionalProperties: + type: string + type: object + id: + example: "0" + type: string name: type: string - openid_discovery_url: + owner_id: + example: "0" type: string - scopes: + owner_scope: type: string type: type: string - updated_at: - type: string type: object model.ConfigVersion: properties: @@ -1211,6 +1299,170 @@ definitions: version: type: string type: object + model.CreateChannelRequest: + properties: + credentials: + additionalProperties: + type: string + type: object + enabled: + type: boolean + extra: + additionalProperties: + type: string + type: object + name: + type: string + type: + type: string + type: object + model.CreatePushChannelRequest: + properties: + description: + type: string + enabled: + type: boolean + name: + type: string + other: + type: string + token: + type: string + type: + type: string + url: + type: string + required: + - name + - type + type: object + model.CreatePushEventRequest: + properties: + channels: + items: + type: string + type: array + enabled: + type: boolean + event_key: + type: string + targets: + items: + type: string + type: array + task_type: + type: string + template: + type: string + type: object + model.CreateScheduleRequest: + properties: + cron: + type: string + is_active: + type: boolean + name: + type: string + payload: + type: string + task_type: + type: string + required: + - cron + - is_active + - name + - task_type + type: object + model.CreateSystemConfigRequest: + properties: + description: + maxLength: 255 + type: string + key: + maxLength: 64 + type: string + type: + enum: + - system + - business + type: string + value: + type: string + visibility: + enum: + - 0 + - 1 + type: integer + required: + - key + - type + - value + type: object + model.CreateTemplateRequest: + properties: + content: + type: string + description: + maxLength: 255 + type: string + key: + maxLength: 80 + type: string + name: + maxLength: 100 + type: string + subject: + maxLength: 255 + type: string + type: + maxLength: 20 + type: string + required: + - content + - key + - name + - type + type: object + model.CreateUserRequest: + properties: + email: + maxLength: 255 + type: string + is_active: + type: boolean + is_admin: + type: boolean + nickname: + maxLength: 64 + type: string + password: + maxLength: 64 + minLength: 8 + type: string + username: + maxLength: 64 + minLength: 3 + type: string + required: + - email + - password + - username + type: object + model.DBOverviewResponse: + properties: + connections: + type: integer + name: + type: string + size: + type: string + table_count: + type: integer + type: + type: string + version: + type: string + type: object model.DNSAccount: properties: created_at: @@ -1224,23 +1476,123 @@ definitions: updated_at: type: string type: object - model.ExternalAccountView: + model.DatabaseInfoResponse: properties: - auth_source_id: + name: + type: string + type: + type: string + version: + type: string + type: object + model.Definition: + properties: + fields: + items: + $ref: '#/definitions/model.Field' + type: array + type: + type: string + type: object + model.DispatchTaskRequest: + properties: + end_time: + type: string + payload: + type: string + start_time: + type: string + task_type: + type: string + user_id: type: integer - auth_source_label: + required: + - task_type + type: object + model.ExecuteSQLRequest: + properties: + sql: type: string - auth_source_name: + required: + - sql + type: object + model.ExecuteSQLResponse: + properties: + affected_rows: + type: integer + columns: + items: + type: string + type: array + execution_time_ms: + type: integer + results: + items: + additionalProperties: true + type: object + type: array + type: + description: '"select" 或 "exec"' type: string - auth_source_type: + type: object + model.Field: + properties: + key: type: string - created_at: + required: + type: boolean + type: type: string - email: + type: object + model.ListUsersResponse: + properties: + total: + type: integer + users: + items: + $ref: '#/definitions/model.UserResponse' + type: array + type: object + model.LogDatabaseStatus: + properties: + active_database: type: string - external_username: + available_targets: + items: + type: string + type: array + migration: type: string - id: + retention_days: + additionalProperties: + type: integer + type: object + type: object + model.LogsAnalyticsResponse: + properties: + browsers: + items: + $ref: '#/definitions/model.BrowserItem' + type: array + top_users: + items: + $ref: '#/definitions/model.TopUserItem' + type: array + trend: + items: + $ref: '#/definitions/model.TrendItem' + type: array + type: object + model.LogsResponse: + properties: + has_more: + type: boolean + lines: + items: + $ref: '#/definitions/logger.LogEntry' + type: array + next_cursor: + description: 用于加载更早日志的 cursor type: integer type: object model.OpenFlareApplyLog: @@ -1404,130 +1756,124 @@ definitions: value: type: string type: object + model.PublicChannelDTO: + properties: + id: + example: "0" + type: string + name: + type: string + type: + type: string + type: object model.PushChannel: properties: created_at: type: string description: - description: 备注 type: string enabled: - description: 通道是否启用 type: boolean id: type: integer name: - description: 通道名称,仅英文字母和下划线,唯一 type: string other: - description: 请求体/SMTP 密码等 type: string token: - description: 鉴权令牌或发信用户名等 type: string type: - description: 通道类型:custom, lark, email type: string updated_at: type: string url: - description: 请求地址,HTTPS 协议或 SMTP 地址 type: string type: object model.PushEvent: properties: channels: - description: 推送渠道列表,如 ["lark"] items: type: string type: array created_at: type: string enabled: - description: 是否启用 type: boolean event_key: - description: 如 admin_login type: string id: type: integer name: - description: 如 管理员登录 type: string targets: - description: 推送目标用户/邮箱列表 items: type: string type: array task_type: - description: 关联的异步任务类型 type: string template: - description: 消息模板 JSON type: string updated_at: type: string type: object - model.PushHistory: + model.SystemStatusResponse: properties: - channel: + alloc: type: string - content: + buck_hash_sys: type: string - created_at: - type: string - error_msg: - type: string - event_key: - type: string - id: + frees: type: integer - level: + gc_sys: type: string - status: - description: success / failed + heap_alloc: type: string - target: + heap_idle: type: string - title: + heap_inuse: type: string - type: object - model.Schedule: - properties: - created_at: - type: string - cron: - type: string - id: - example: "0" - type: string - is_active: - type: boolean - name: - type: string - payload: - type: string - task_type: - type: string - updated_at: - type: string - type: object - model.SystemConfig: - properties: - created_at: - type: string - description: - type: string - key: - type: string - type: - type: string - updated_at: - type: string - value: - type: string - visibility: + heap_objects: type: integer + heap_released: + type: string + heap_sys: + type: string + last_gc_time: + type: string + last_pause: + type: string + lookups: + type: integer + mallocs: + type: integer + mcache_inuse: + type: string + mcache_sys: + type: string + mspan_inuse: + type: string + mspan_sys: + type: string + next_gc: + type: string + num_gc: + type: integer + num_goroutine: + type: integer + other_sys: + type: string + pause_total_ns: + type: string + stack_inuse: + type: string + stack_sys: + type: string + sys: + type: string + total_alloc: + type: string + uptime: + type: string type: object model.TLSCertificate: properties: @@ -1572,46 +1918,6 @@ definitions: updated_at: type: string type: object - model.TaskExecution: - properties: - created_at: - type: string - duration: - type: integer - error_message: - type: string - finished_at: - type: string - id: - example: "0" - type: string - log: - type: string - max_retry: - type: integer - payload: - type: string - result: - type: string - retry_count: - type: integer - retryable: - type: boolean - started_at: - type: string - status: - $ref: '#/definitions/model.TaskExecutionStatus' - task_id: - type: string - task_name: - type: string - task_type: - type: string - triggered_by: - type: string - updated_at: - type: string - type: object model.TaskExecutionStatus: enum: - pending @@ -1624,119 +1930,282 @@ definitions: - TaskExecutionStatusRunning - TaskExecutionStatusSucceeded - TaskExecutionStatusFailed - model.Template: + model.TestPushChannelRequest: properties: - content: - type: string - created_at: - type: string - description: - type: string - id: - type: integer - is_system: - type: boolean - key: - type: string name: type: string - subject: + other: + type: string + target: + type: string + token: type: string type: type: string - updated_at: + url: type: string type: object - model.Upload: + model.TestPushRequest: properties: - access_mode: + config: + $ref: '#/definitions/push.Config' + target: + type: string + required: + - config + type: object + model.TestSMTPRequest: + properties: + smtp_host: + maxLength: 255 + type: string + smtp_password: + maxLength: 255 + type: string + smtp_port: type: integer - created_at: + smtp_username: + maxLength: 255 type: string - extension: - description: 文件后缀名 (不含点,如 png, pdf) + to: type: string - file_name: - description: '原始文件名 (例如: image.png)' + required: + - smtp_host + - smtp_password + - smtp_port + - smtp_username + - to + type: object + model.TestSMTPResponse: + properties: + error: type: string - file_path: - description: 文件相对路径 / S3 Key + log: type: string - file_size: - description: 文件大小(字节) + success: + type: boolean + type: object + model.TopUserItem: + properties: + count: type: integer - hash: - description: 文件哈希 (SHA-256/MD5,可用于排重) - type: string - id: - example: "0" - type: string - metadata: - allOf: - - $ref: '#/definitions/model.UploadMetadata' - description: 业务扩展元数据 - mime_type: - description: 媒体类型 (MIME, 如 image/png) - type: string - status: - allOf: - - $ref: '#/definitions/model.UploadStatus' - description: 状态 - type: - description: 业务标识类型 (如 avatar, doc, attachment) - type: string - updated_at: + nickname: type: string user_id: example: "0" type: string + username: + type: string type: object - model.UploadMetadata: + model.TrendItem: properties: - bucket: - description: 存储桶名称 (适用于 S3 等) - type: string - client_ip: - description: 上传者 IP - type: string - duration: - description: 音视频时长 (s) - type: number - extra: - additionalProperties: {} - description: 其它任意业务自定义元数据 - type: object - height: - description: 图像/视频高度 (px) + count: type: integer - original_mime: - description: 原始 MIME 类型 + date: + type: string + type: object + model.UpdateCacheConfigRequest: + properties: + lru_enabled: + type: boolean + max_size_mb: + minimum: 1 + type: integer + ttl_minutes: + minimum: 0 + type: integer + required: + - max_size_mb + - ttl_minutes + type: object + model.UpdateChannelRequest: + properties: + credentials: + additionalProperties: + type: string + type: object + enabled: + type: boolean + extra: + additionalProperties: + type: string + type: object + name: + type: string + type: object + model.UpdatePushChannelRequest: + properties: + description: + type: string + enabled: + type: boolean + other: + type: string + token: + type: string + type: + type: string + url: + type: string + required: + - type + type: object + model.UpdatePushEventRequest: + properties: + channels: + items: + type: string + type: array + enabled: + type: boolean + targets: + items: + type: string + type: array + template: + type: string + required: + - template + type: object + model.UpdateScheduleRequest: + properties: + cron: + type: string + is_active: + type: boolean + name: + type: string + payload: + type: string + task_type: + type: string + required: + - cron + - is_active + - name + - task_type + type: object + model.UpdateSystemConfigRequest: + properties: + description: + maxLength: 255 + type: string + value: + type: string + visibility: + enum: + - 0 + - 1 + type: integer + required: + - value + type: object + model.UpdateTemplateRequest: + properties: + content: + type: string + description: + maxLength: 255 + type: string + name: + maxLength: 100 + type: string + subject: + maxLength: 255 + type: string + type: + maxLength: 20 + type: string + required: + - content + - name + - type + type: object + model.UpdateUserRequest: + properties: + email: + maxLength: 255 + type: string + is_admin: + type: boolean + nickname: + maxLength: 64 + type: string + password: + maxLength: 64 + minLength: 8 + type: string + required: + - email + type: object + model.UpdateUserStatusRequest: + properties: + is_active: + type: boolean + type: object + model.UpdaterStatus: + properties: + asset_name: + type: string + build_time: + type: string + can_upgrade: + type: boolean + current_version: + type: string + latest_version: + type: string + platform: + type: string + prerelease: + type: boolean + published_at: + type: string + release_name: + type: string + release_notes: + type: string + release_url: + type: string + update_available: + type: boolean + upstream_repository: + type: string + type: object + model.UserResponse: + properties: + avatar_url: + type: string + bio: + type: string + created_at: + type: string + email: + type: string + gender: + type: string + id: + example: "0" + type: string + is_active: + type: boolean + is_admin: + type: boolean + last_login_at: + type: string + location: + type: string + nickname: + type: string + phone: + type: string + updated_at: + type: string + username: + type: string + website: type: string - user_agent: - description: 上传者的 UA - type: string - width: - description: 图像/视频宽度 (px) - type: integer type: object - model.UploadStatus: - enum: - - pending - - used - - deleted - type: string - x-enum-comments: - UploadStatusDeleted: 已删除 - UploadStatusPending: 待使用 - UploadStatusUsed: 已使用 - x-enum-descriptions: - - 待使用 - - 已使用 - - 已删除 - x-enum-varnames: - - UploadStatusPending - - UploadStatusUsed - - UploadStatusDeleted model.Zone: properties: created_at: @@ -1765,6 +2234,77 @@ definitions: zone_id: type: integer type: object + models.Upload: + properties: + access_mode: + type: integer + created_at: + type: string + extension: + type: string + file_name: + type: string + file_path: + type: string + file_size: + type: integer + hash: + type: string + id: + example: "0" + type: string + metadata: + $ref: '#/definitions/models.UploadMetadata' + mime_type: + type: string + status: + $ref: '#/definitions/models.UploadStatus' + type: + type: string + updated_at: + type: string + user_id: + example: "0" + type: string + type: object + models.UploadMetadata: + properties: + bucket: + type: string + client_ip: + type: string + duration: + type: number + extra: + additionalProperties: {} + type: object + height: + type: integer + original_mime: + type: string + user_agent: + type: string + width: + type: integer + type: object + models.UploadStatus: + enum: + - pending + - used + - deleted + type: string + x-enum-comments: + UploadStatusDeleted: 已删除 + UploadStatusPending: 待使用 + UploadStatusUsed: 已使用 + x-enum-descriptions: + - 待使用 + - 已使用 + - 已删除 + x-enum-varnames: + - UploadStatusPending + - UploadStatusUsed + - UploadStatusDeleted node.AgentReleaseInfo: properties: body: @@ -1945,72 +2485,6 @@ definitions: version: type: string type: object - oauth.AuthSourceView: - properties: - client_secret_configured: - type: boolean - display_name: - type: string - icon_url: - type: string - id: - type: integer - is_active: - type: boolean - name: - type: string - type: - type: string - type: object - oauth.BasicUserInfo: - properties: - avatar_url: - type: string - bio: - type: string - email: - type: string - gender: - type: string - id: - type: integer - is_admin: - type: boolean - location: - type: string - need_change_password: - type: boolean - nickname: - type: string - phone: - type: string - username: - type: string - website: - type: string - type: object - oauth.CallbackRequest: - properties: - code: - type: string - state: - type: string - required: - - code - - state - type: object - oauth.OAuthAuthorizeResponse: - properties: - authorize_url: - type: string - type: object - oauth.OAuthCallbackResult: - properties: - status: - type: string - user: - $ref: '#/definitions/oauth.BasicUserInfo' - type: object observability.AccessLogCleanupInput: properties: retention_days: @@ -3202,174 +3676,6 @@ definitions: description: Webhook 地址或 SMTP 地址 type: string type: object - push.CreateChannelRequest: - properties: - description: - type: string - enabled: - type: boolean - name: - type: string - other: - type: string - token: - type: string - type: - type: string - url: - type: string - required: - - name - - type - type: object - push.CreateEventRequest: - properties: - channels: - items: - type: string - type: array - enabled: - type: boolean - event_key: - type: string - targets: - items: - type: string - type: array - task_type: - description: 关联的异步任务类型 - type: string - template: - type: string - type: object - push.Definition: - properties: - description: - description: short description - type: string - fields: - description: form fields - items: - $ref: '#/definitions/push.Field' - type: array - name: - description: display name - type: string - type: - description: channel type (e.g., custom, lark, email) - type: string - type: object - push.EventMetadata: - properties: - default_template: - $ref: '#/definitions/push.NotificationMessage' - description: - type: string - key: - type: string - name: - type: string - type: object - push.Field: - properties: - description: - description: field explanation/help text - type: string - key: - description: unique key for the field (e.g. url, token, other) - type: string - label: - description: human readable label (e.g. "Webhook 地址") - type: string - placeholder: - description: input placeholder - type: string - required: - description: whether this field is required - type: boolean - type: - description: 'input type: "text" | "password" | "textarea"' - type: string - type: object - push.NotificationMessage: - properties: - content: - type: string - ext: - additionalProperties: {} - type: object - level: - type: string - title: - type: string - type: object - push.TestChannelRequest: - properties: - name: - type: string - other: - type: string - target: - type: string - token: - type: string - type: - type: string - url: - type: string - type: object - push.TestPushRequest: - properties: - config: - $ref: '#/definitions/push.Config' - target: - type: string - required: - - config - type: object - push.UpdateChannelRequest: - properties: - description: - type: string - enabled: - type: boolean - other: - type: string - token: - type: string - type: - type: string - url: - type: string - required: - - type - type: object - push.UpdateEventRequest: - properties: - channels: - items: - type: string - type: array - enabled: - type: boolean - targets: - items: - type: string - type: array - template: - type: string - required: - - template - type: object - push.pushHistoriesResponse: - properties: - results: - items: - $ref: '#/definitions/model.PushHistory' - type: array - total: - type: integer - type: object relay.HeartbeatPayload: properties: frp_version: @@ -3415,305 +3721,27 @@ definitions: example: "" type: string type: object - status.DatabaseInfoResponse: - properties: - name: - type: string - type: - type: string - version: - type: string - type: object - status.LogDatabaseStatus: - properties: - active_database: - type: string - available_targets: - items: - type: string - type: array - clickhouse: - $ref: '#/definitions/Wavelet_OpenFlare_plugins_server_model_analytics.ClickHouseOperationalStats' - migration: - description: idle | migrating - type: string - retention_days: - additionalProperties: - type: integer - type: object - type: object - status.SystemStatusResponse: - properties: - alloc: - type: string - buck_hash_sys: - type: string - frees: - type: integer - gc_sys: - type: string - heap_alloc: - type: string - heap_idle: - type: string - heap_inuse: - type: string - heap_objects: - type: integer - heap_released: - type: string - heap_sys: - type: string - last_gc_time: - type: string - last_pause: - type: string - lookups: - type: integer - mallocs: - type: integer - mcache_inuse: - type: string - mcache_sys: - type: string - mspan_inuse: - type: string - mspan_sys: - type: string - next_gc: - type: string - num_gc: - type: integer - num_goroutine: - type: integer - other_sys: - type: string - pause_total_ns: - type: string - stack_inuse: - type: string - stack_sys: - type: string - sys: - type: string - total_alloc: - type: string - uptime: - type: string - type: object - system_config.CreateSystemConfigRequest: - properties: - description: - maxLength: 255 - type: string - key: - maxLength: 64 - type: string - type: - enum: - - system - - business - type: string - value: - type: string - visibility: - enum: - - 0 - - 1 - type: integer - required: - - key - - type - - value - type: object - system_config.TestSMTPRequest: - properties: - smtp_host: - maxLength: 255 - type: string - smtp_password: - maxLength: 255 - type: string - smtp_port: - type: integer - smtp_username: - maxLength: 255 - type: string - to: - type: string - required: - - smtp_host - - smtp_password - - smtp_port - - smtp_username - - to - type: object - system_config.TestSMTPResponse: - properties: - error: - type: string - log: - type: string - success: - type: boolean - type: object - system_config.UpdateSystemConfigRequest: - properties: - description: - maxLength: 255 - type: string - value: - type: string - visibility: - enum: - - 0 - - 1 - type: integer - required: - - value - type: object - task.CreateScheduleRequest: - properties: - cron: - type: string - is_active: - type: boolean - name: - type: string - payload: - type: string - task_type: - type: string - required: - - cron - - is_active - - name - - task_type - type: object - task.DispatchTaskRequest: - properties: - end_time: - type: string - payload: - type: string - start_time: - type: string - task_type: - type: string - user_id: - type: integer - required: - - task_type - type: object - task.TaskMeta: - properties: - asynq_task: - type: string - description: - type: string - max_retry: - type: integer - name: - type: string - params: - items: - $ref: '#/definitions/task.TaskParam' - type: array - queue: - type: string - retryable: - description: 是否支持手动重试 - type: boolean - supports_time: - type: boolean - type: - type: string - type: object - task.TaskParam: - properties: - description: - description: 描述 - type: string - label: - description: 显示名称 - type: string - name: - description: 参数键名 - type: string - placeholder: - description: 占位符 - type: string - required: - description: 是否必填 - type: boolean - type: - description: 类型:string, text, number, boolean - type: string - type: object - task.UpdateScheduleRequest: - properties: - cron: - type: string - is_active: - type: boolean - name: - type: string - payload: - type: string - task_type: - type: string - required: - - cron - - is_active - - name - - task_type - type: object - template.CreateTemplateRequest: - properties: - content: - type: string - description: - maxLength: 255 - type: string - key: - maxLength: 80 - type: string - name: - maxLength: 100 - type: string - subject: - maxLength: 255 - type: string - type: - maxLength: 20 - type: string - required: - - content - - key - - name - - type - type: object - template.UpdateTemplateRequest: - properties: - content: - type: string - description: - maxLength: 255 - type: string - name: - maxLength: 100 - type: string - subject: - maxLength: 255 - type: string - type: - maxLength: 20 - type: string - required: - - content - - name - - type - type: object + time.Duration: + enum: + - -9223372036854775808 + - 9223372036854775807 + - 1 + - 1000 + - 1000000 + - 1000000000 + - 60000000000 + - 3600000000000 + format: int64 + type: integer + x-enum-varnames: + - minDuration + - maxDuration + - Nanosecond + - Microsecond + - Millisecond + - Second + - Minute + - Hour tls.ApplyInput: properties: acme_account_id: @@ -3829,94 +3857,65 @@ definitions: upstream_repository: type: string type: object + user.AccessToken: + properties: + created_at: + type: string + id: + type: integer + is_admin: + type: boolean + masked_token: + type: string + name: + type: string + updated_at: + type: string + user_id: + type: integer + type: object user.changePasswordRequest: properties: new_password: type: string old_password: type: string + required: + - new_password + - old_password type: object - user.createTokenRequest: + user.createAccessTokenRequest: properties: + expires_at: + type: string is_admin: type: boolean name: type: string - type: object - user.createUserRequest: - properties: - email: - maxLength: 255 - type: string - is_active: - type: boolean - is_admin: - type: boolean - nickname: - maxLength: 64 - type: string - password: - maxLength: 64 - minLength: 8 - type: string - username: - maxLength: 64 - minLength: 3 - type: string required: - - email - - password - - username - type: object - user.listUsersResponse: - properties: - total: - type: integer - users: - items: - $ref: '#/definitions/user.user' - type: array + - name type: object user.loginRequest: properties: - code: - type: string password: type: string username: type: string + required: + - password + - username type: object user.registerRequest: properties: - code: - type: string - display_name: - type: string email: type: string - nickname: - type: string password: type: string username: type: string - type: object - user.sendEmailCodeRequest: - properties: - email: - type: string - scene: - type: string required: - - email - - scene - type: object - user.tokenResponse: - properties: - record: - $ref: '#/definitions/model.AccessToken' - token: - type: string + - password + - username type: object user.updateProfileRequest: properties: @@ -3924,8 +3923,6 @@ definitions: type: string bio: type: string - email: - type: string gender: type: string location: @@ -3937,62 +3934,6 @@ definitions: website: type: string type: object - user.updateUserRequest: - properties: - email: - maxLength: 255 - type: string - is_admin: - type: boolean - nickname: - maxLength: 64 - type: string - password: - maxLength: 64 - minLength: 8 - type: string - required: - - email - type: object - user.updateUserStatusRequest: - properties: - is_active: - type: boolean - type: object - user.user: - properties: - avatar_url: - type: string - bio: - type: string - created_at: - type: string - email: - type: string - gender: - type: string - id: - example: "0" - type: string - is_active: - type: boolean - is_admin: - type: boolean - last_login_at: - type: string - location: - type: string - nickname: - type: string - phone: - type: string - updated_at: - type: string - username: - type: string - website: - type: string - type: object waf.CreateRuleInput: properties: name: @@ -4357,7 +4298,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/Wavelet_OpenFlare_plugins_server_cap.ChallengeResponse' + $ref: '#/definitions/cap.ChallengeResponse' type: object "500": description: 内部服务错误 @@ -4388,7 +4329,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/Wavelet_OpenFlare_plugins_server_cap.RedeemResponse' + $ref: '#/definitions/cap.RedeemResponse' type: object "400": description: 参数错误或核销失败 @@ -4428,14 +4369,7 @@ paths: "200": description: 认证源列表 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - items: - $ref: '#/definitions/model.AuthSource' - type: array - type: object + $ref: '#/definitions/response.Any' "401": description: 未登录 schema: @@ -4463,19 +4397,14 @@ paths: name: request required: true schema: - $ref: '#/definitions/auth_source.AuthSourceRequest' + $ref: '#/definitions/contracts.AuthSourceDTO' produces: - application/json responses: "200": description: 创建成功,返回认证源信息 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/model.AuthSource' - type: object + $ref: '#/definitions/response.Any' "400": description: 参数错误或验证失败 schema: @@ -4548,19 +4477,14 @@ paths: name: request required: true schema: - $ref: '#/definitions/auth_source.AuthSourceRequest' + $ref: '#/definitions/contracts.AuthSourceDTO' produces: - application/json responses: "200": description: 更新成功,返回更新后的认证源信息 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/model.AuthSource' - type: object + $ref: '#/definitions/response.Any' "400": description: 参数错误或验证失败 schema: @@ -4594,12 +4518,6 @@ paths: name: id required: true type: integer - - description: 启用状态 - in: body - name: request - required: true - schema: - $ref: '#/definitions/auth_source.ToggleAuthSourceRequest' produces: - application/json responses: @@ -4667,7 +4585,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/cache.updateCacheConfigRequest' + $ref: '#/definitions/model.UpdateCacheConfigRequest' produces: - application/json responses: @@ -4709,7 +4627,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/diskcache.Status' + $ref: '#/definitions/disk.Status' type: object "401": description: 未登录 @@ -4768,7 +4686,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/status.DatabaseInfoResponse' + $ref: '#/definitions/model.DatabaseInfoResponse' type: object "401": description: 未登录 @@ -4796,7 +4714,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/db_manage.DBOverviewResponse' + $ref: '#/definitions/model.DBOverviewResponse' type: object "401": description: 未登录 @@ -4826,7 +4744,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/db_manage.ExecuteSQLRequest' + $ref: '#/definitions/model.ExecuteSQLRequest' produces: - application/json responses: @@ -4837,7 +4755,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/db_manage.ExecuteSQLResponse' + $ref: '#/definitions/model.ExecuteSQLResponse' type: object "400": description: SQL 语句错误 @@ -4918,7 +4836,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/logs.logsResponse' + $ref: '#/definitions/model.LogsResponse' type: object "401": description: 未登录 @@ -4935,7 +4853,7 @@ paths: - admin /api/v1/admin/logs/access: get: - description: 分页并按照用户、接口路径、时间范围等维度检索用户访问日志列表(需要管理员权限,日志存储未启用时报错) + description: 分页并按照用户、接口路径、时间范围等维度检索用户访问日志列表(需要管理员权限) parameters: - default: 1 description: 页码 @@ -4973,10 +4891,10 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/logs.accessLogsResponse' + $ref: '#/definitions/model.AccessLogsResponse' type: object "400": - description: 日志存储未启用或参数错误 + description: 参数错误 schema: $ref: '#/definitions/response.Any' "401": @@ -4987,6 +4905,10 @@ paths: description: 无管理员权限 schema: $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' security: - SessionCookie: [] summary: 获取用户访问日志 @@ -4994,7 +4916,7 @@ paths: - admin /api/v1/admin/logs/analytics: get: - description: 聚合统计最近 7 天的每日访问趋势、浏览器分布以及前 10 名最活跃用户排行(需要管理员权限,日志存储未启用时报错) + description: 聚合统计最近 7 天的每日访问趋势、浏览器分布以及前 10 名最活跃用户排行(需要管理员权限) produces: - application/json responses: @@ -5005,12 +4927,8 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/logs.logsAnalyticsResponse' + $ref: '#/definitions/model.LogsAnalyticsResponse' type: object - "400": - description: 日志存储未启用 - schema: - $ref: '#/definitions/response.Any' "401": description: 未登录 schema: @@ -5019,6 +4937,10 @@ paths: description: 无管理员权限 schema: $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' security: - SessionCookie: [] summary: 获取访问日志分析数据 @@ -5031,6 +4953,177 @@ paths: summary: 系统日志实时推送 tags: - admin + /api/v1/admin/message-gateway/channels: + get: + description: Returns all messaging channels; secrets are masked + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + items: + $ref: '#/definitions/model.ChannelDTO' + type: array + type: object + security: + - SessionCookie: [] + summary: List message gateway channels + tags: + - admin-message-gateway + post: + consumes: + - application/json + description: Creates a Telegram or QQ channel with encrypted credentials + parameters: + - description: create body + in: body + name: request + required: true + schema: + $ref: '#/definitions/model.CreateChannelRequest' + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/model.ChannelDTO' + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: Create message gateway channel + tags: + - admin-message-gateway + /api/v1/admin/message-gateway/channels/{id}: + delete: + description: Deletes a channel and cascaded bindings and pairing codes + parameters: + - description: channel id + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/response.Any' + "404": + description: Not Found + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: Delete message gateway channel + tags: + - admin-message-gateway + patch: + consumes: + - application/json + description: Updates a channel; empty secrets keep the current ciphertext + parameters: + - description: channel id + in: path + name: id + required: true + type: integer + - description: update body + in: body + name: request + required: true + schema: + $ref: '#/definitions/model.UpdateChannelRequest' + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/model.ChannelDTO' + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/response.Any' + "404": + description: Not Found + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: Update message gateway channel + tags: + - admin-message-gateway + /api/v1/admin/message-gateway/channels/{id}/test: + post: + description: Probes stored credentials without returning secrets + parameters: + - description: channel id + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/response.Any' + "400": + description: Bad Request + schema: + $ref: '#/definitions/response.Any' + "404": + description: Not Found + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: Test message gateway channel + tags: + - admin-message-gateway + /api/v1/admin/message-gateway/channels/definitions: + get: + description: Returns form field definitions for Telegram and QQ channels + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + items: + $ref: '#/definitions/model.Definition' + type: array + type: object + security: + - SessionCookie: [] + summary: List message gateway channel definitions + tags: + - admin-message-gateway /api/v1/admin/push/channels: get: description: 返回系统配置的所有消息通道列表,需要管理员权限 @@ -5063,7 +5156,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/push.CreateChannelRequest' + $ref: '#/definitions/model.CreatePushChannelRequest' produces: - application/json responses: @@ -5119,7 +5212,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/push.UpdateChannelRequest' + $ref: '#/definitions/model.UpdatePushChannelRequest' produces: - application/json responses: @@ -5139,21 +5232,14 @@ paths: - admin-push /api/v1/admin/push/channels/definitions: get: - description: 返回系统支持的所有消息通道类型(如飞书、邮件、自定义、Telegram)的动态表单定义,需要管理员权限 + description: 返回系统支持的所有消息通道类型的动态表单定义,需要管理员权限 produces: - application/json responses: "200": description: 通道配置定义列表 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - items: - $ref: '#/definitions/push.Definition' - type: array - type: object + $ref: '#/definitions/response.Any' security: - SessionCookie: [] summary: 获取所有消息通道配置字段定义 @@ -5170,7 +5256,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/push.TestChannelRequest' + $ref: '#/definitions/model.TestPushChannelRequest' produces: - application/json responses: @@ -5215,7 +5301,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/push.CreateEventRequest' + $ref: '#/definitions/model.CreatePushEventRequest' produces: - application/json responses: @@ -5274,7 +5360,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/push.UpdateEventRequest' + $ref: '#/definitions/model.UpdatePushEventRequest' produces: - application/json responses: @@ -5327,14 +5413,7 @@ paths: "200": description: 内置通知事件列表 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - items: - $ref: '#/definitions/push.EventMetadata' - type: array - type: object + $ref: '#/definitions/response.Any' security: - SessionCookie: [] summary: 获取所有内置通知事件 @@ -5366,12 +5445,7 @@ paths: "200": description: 推送历史列表 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/push.pushHistoriesResponse' - type: object + $ref: '#/definitions/response.Any' security: - SessionCookie: [] summary: 分页获取通知推送历史 @@ -5388,7 +5462,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/push.TestPushRequest' + $ref: '#/definitions/model.TestPushRequest' produces: - application/json responses: @@ -5419,7 +5493,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/status.SystemStatusResponse' + $ref: '#/definitions/model.SystemStatusResponse' type: object "401": description: 未登录 @@ -5447,7 +5521,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/status.LogDatabaseStatus' + $ref: '#/definitions/model.LogDatabaseStatus' type: object "401": description: 未登录 @@ -5485,7 +5559,7 @@ paths: - properties: data: items: - $ref: '#/definitions/model.SystemConfig' + $ref: '#/definitions/Wavelet_plugins_domain_admin_model.SystemConfig' type: array type: object "401": @@ -5515,7 +5589,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/system_config.CreateSystemConfigRequest' + $ref: '#/definitions/model.CreateSystemConfigRequest' produces: - application/json responses: @@ -5568,7 +5642,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/model.SystemConfig' + $ref: '#/definitions/Wavelet_plugins_domain_admin_model.SystemConfig' type: object "401": description: 未登录 @@ -5606,7 +5680,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/system_config.UpdateSystemConfigRequest' + $ref: '#/definitions/model.UpdateSystemConfigRequest' produces: - application/json responses: @@ -5655,7 +5729,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/system_config.TestSMTPRequest' + $ref: '#/definitions/model.TestSMTPRequest' produces: - application/json responses: @@ -5666,7 +5740,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/system_config.TestSMTPResponse' + $ref: '#/definitions/model.TestSMTPResponse' type: object "400": description: 参数错误 @@ -5688,7 +5762,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/task.DispatchTaskRequest' + $ref: '#/definitions/model.DispatchTaskRequest' produces: - application/json responses: @@ -5734,14 +5808,6 @@ paths: in: query name: task_type type: string - - description: 任务类型前缀筛选(与 task_type / task_types 互斥,精确类型优先) - in: query - name: task_type_prefix - type: string - - description: 逗号分隔的精确任务类型列表(IN 筛选,优先于前缀) - in: query - name: task_types - type: string - default: 1 description: 页码 in: query @@ -5796,7 +5862,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/model.TaskExecution' + $ref: '#/definitions/Wavelet_plugins_domain_admin_model.TaskExecution' type: object "400": description: 参数错误 @@ -5867,7 +5933,7 @@ paths: - admin /api/v1/admin/tasks/schedules: get: - description: 返回管理员可管理的定时任务配置列表,包括名称、关联的异步任务类型、Cron 表达式和启用状态;系统内部排程不会暴露,需要管理员权限 + description: 返回系统所有的定时任务配置列表,包括名称、关联的异步任务类型、Cron 表达式和启用状态,需要管理员权限 produces: - application/json responses: @@ -5879,7 +5945,7 @@ paths: - properties: data: items: - $ref: '#/definitions/model.Schedule' + $ref: '#/definitions/Wavelet_plugins_domain_admin_model.Schedule' type: array type: object "401": @@ -5905,7 +5971,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/task.CreateScheduleRequest' + $ref: '#/definitions/model.CreateScheduleRequest' produces: - application/json responses: @@ -5916,7 +5982,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/model.Schedule' + $ref: '#/definitions/Wavelet_plugins_domain_admin_model.Schedule' type: object "400": description: Cron 表达式无效、异步任务类型不存在或参数错误 @@ -5972,10 +6038,6 @@ paths: description: 无管理员权限 schema: $ref: '#/definitions/response.Any' - "404": - description: 定时任务不存在 - schema: - $ref: '#/definitions/response.Any' "500": description: 删除定时任务失败 schema: @@ -6000,7 +6062,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/task.UpdateScheduleRequest' + $ref: '#/definitions/model.UpdateScheduleRequest' produces: - application/json responses: @@ -6011,7 +6073,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/model.Schedule' + $ref: '#/definitions/Wavelet_plugins_domain_admin_model.Schedule' type: object "400": description: Cron 表达式无效、参数错误 @@ -6052,7 +6114,7 @@ paths: - properties: data: items: - $ref: '#/definitions/task.TaskMeta' + $ref: '#/definitions/contracts.TaskMetaDTO' type: array type: object "401": @@ -6082,7 +6144,7 @@ paths: - properties: data: items: - $ref: '#/definitions/model.Template' + $ref: '#/definitions/Wavelet_plugins_domain_admin_model.Template' type: array type: object "401": @@ -6112,7 +6174,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/template.CreateTemplateRequest' + $ref: '#/definitions/model.CreateTemplateRequest' produces: - application/json responses: @@ -6210,7 +6272,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/model.Template' + $ref: '#/definitions/Wavelet_plugins_domain_admin_model.Template' type: object "401": description: 未登录 @@ -6248,7 +6310,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/template.UpdateTemplateRequest' + $ref: '#/definitions/model.UpdateTemplateRequest' produces: - application/json responses: @@ -6259,7 +6321,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/model.Template' + $ref: '#/definitions/Wavelet_plugins_domain_admin_model.Template' type: object "400": description: 参数错误 @@ -6299,7 +6361,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/updater.Status' + $ref: '#/definitions/model.UpdaterStatus' type: object "401": description: 未登录 @@ -6373,8 +6435,7 @@ paths: in: query name: extension type: string - - description: 上传用户 ID - format: int64 + - description: 上传用户 ID 过滤 in: query name: user_id type: integer @@ -6390,12 +6451,8 @@ paths: data: $ref: '#/definitions/handler.listFilesResponse' type: object - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 + "400": + description: 参数错误 schema: $ref: '#/definitions/response.Any' security: @@ -6405,7 +6462,7 @@ paths: - admin /api/v1/admin/uploads/{id}: delete: - description: 将文件状态置为 deleted(软删除),不会立即清理底层存储对象 + description: 将指定 ID 的文件状态置为 deleted(软删除) parameters: - description: 文件 ID in: path @@ -6419,18 +6476,10 @@ paths: description: 删除成功 schema: $ref: '#/definitions/response.Any' - "403": - description: 无权操作 - schema: - $ref: '#/definitions/response.Any' "404": description: 文件不存在 schema: $ref: '#/definitions/response.Any' - "409": - description: 系统保留类型或存储只读 - schema: - $ref: '#/definitions/response.Any' security: - SessionCookie: [] summary: 删除文件 @@ -6505,6 +6554,80 @@ paths: summary: 批量打包下载 tags: - admin + /api/v1/admin/uploads/files: + get: + description: 分页获取系统上传的文件列表,支持文件名关键词、业务类型、扩展名、上传用户ID过滤 + parameters: + - description: 页码(默认 1) + in: query + name: page + type: integer + - description: 每页数量(默认 20,最大 100) + in: query + name: page_size + type: integer + - description: 文件名关键词(模糊匹配) + in: query + name: keyword + type: string + - description: 业务分类过滤 + in: query + name: type + type: string + - description: 扩展名过滤 + in: query + name: extension + type: string + - description: 上传用户 ID 过滤 + in: query + name: user_id + type: integer + produces: + - application/json + responses: + "200": + description: 查询成功 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/handler.listFilesResponse' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 获取文件列表 + tags: + - admin + /api/v1/admin/uploads/files/{id}: + delete: + description: 将指定 ID 的文件状态置为 deleted(软删除) + parameters: + - description: 文件 ID + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: 删除成功 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 文件不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 删除文件 + tags: + - admin /api/v1/admin/uploads/stats: get: description: 返回系统级的总文件数、占用大小、最近 7 天新增趋势、文件类型/格式分布等数据 @@ -6539,12 +6662,12 @@ paths: - admin /api/v1/admin/uploads/types: get: - description: 返回数据库中所有已上传文件实际拥有的业务类型列表 + description: 查询系统内所有不重复的上传业务分类标识(如 avatar, doc 等) produces: - application/json responses: "200": - description: 业务类型列表 + description: 查询成功 schema: allOf: - $ref: '#/definitions/response.Any' @@ -6554,21 +6677,9 @@ paths: type: string type: array type: object - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' security: - SessionCookie: [] - summary: 获取文件业务类型列表 + summary: 获取业务分类列表 tags: - admin /api/v1/admin/users: @@ -6603,7 +6714,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/user.listUsersResponse' + $ref: '#/definitions/model.ListUsersResponse' type: object "400": description: 参数错误 @@ -6636,7 +6747,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/user.createUserRequest' + $ref: '#/definitions/model.CreateUserRequest' produces: - application/json responses: @@ -6647,7 +6758,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/user.user' + $ref: '#/definitions/model.UserResponse' type: object "400": description: 参数错误或用户名已存在 @@ -6734,7 +6845,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/user.user' + $ref: '#/definitions/model.UserResponse' type: object "400": description: 参数错误 @@ -6776,7 +6887,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/user.updateUserRequest' + $ref: '#/definitions/model.UpdateUserRequest' produces: - application/json responses: @@ -6830,7 +6941,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/user.updateUserStatusRequest' + $ref: '#/definitions/model.UpdateUserStatusRequest' produces: - application/json responses: @@ -12068,6 +12179,124 @@ paths: summary: 更新 Zone tags: - openflare-zone + /api/v1/message-gateway/bindings: + get: + description: Returns the current user's bound messaging channels + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + items: + $ref: '#/definitions/model.BindingDTO' + type: array + type: object + "401": + description: Unauthorized + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: List message gateway bindings + tags: + - message-gateway + post: + consumes: + - application/json + description: Binds the current user to a platform identity using a one-time + pairing code + parameters: + - description: bind body + in: body + name: request + required: true + schema: + $ref: '#/definitions/model.BindRequest' + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/model.BindingDTO' + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/response.Any' + "409": + description: Conflict + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: Bind a messaging channel + tags: + - message-gateway + /api/v1/message-gateway/bindings/{id}: + delete: + description: Removes a binding owned by the current user + parameters: + - description: binding id + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/response.Any' + "403": + description: Forbidden + schema: + $ref: '#/definitions/response.Any' + "404": + description: Not Found + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: Unbind a messaging channel + tags: + - message-gateway + /api/v1/message-gateway/channels: + get: + description: Returns enabled system bots the current user can pair with + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + items: + $ref: '#/definitions/model.PublicChannelDTO' + type: array + type: object + "401": + description: Unauthorized + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: List enabled messaging channels + tags: + - message-gateway /api/v1/oauth/{source}/authorize: get: description: 根据指定认证源名称发起 OAuth 授权,支持 purpose 参数用于区分登录和账号绑定场景。认证源必须已启用。 @@ -12091,14 +12320,14 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/oauth.OAuthAuthorizeResponse' + $ref: '#/definitions/auth.OAuthAuthorizeResponse' type: object "400": description: 认证源不存在或未启用 schema: $ref: '#/definitions/response.Any' "500": - description: Redis 异常或构造 URL 失败 + description: 构造 URL 失败 schema: $ref: '#/definitions/response.Any' summary: 发起指定认证源授权 @@ -12115,7 +12344,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/oauth.CallbackRequest' + $ref: '#/definitions/auth.CallbackRequest' produces: - application/json responses: @@ -12126,7 +12355,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/oauth.OAuthCallbackResult' + $ref: '#/definitions/auth.OAuthCallbackResult' type: object "400": description: state 无效、参数错误或认证源错误 @@ -12152,14 +12381,7 @@ paths: "200": description: 外部帐号列表 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - items: - $ref: '#/definitions/model.ExternalAccountView' - type: array - type: object + $ref: '#/definitions/response.Any' "401": description: 未登录 schema: @@ -12226,14 +12448,14 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/oauth.OAuthAuthorizeResponse' + $ref: '#/definitions/auth.OAuthAuthorizeResponse' type: object "400": description: 认证源不存在或未配置 schema: $ref: '#/definitions/response.Any' "500": - description: Redis 异常 or 构造 URL 失败 + description: 构造 URL 失败 schema: $ref: '#/definitions/response.Any' summary: 获取登录授权地址 @@ -12277,7 +12499,7 @@ paths: - properties: data: items: - $ref: '#/definitions/oauth.AuthSourceView' + $ref: '#/definitions/auth.AuthSourceView' type: array type: object summary: 获取可用登录源 @@ -12285,7 +12507,7 @@ paths: - oauth /api/v1/oauth/user-info: get: - description: 返回当前登录用户的基本信息及余额数据,需要登录。包括用户 ID、用户名、信任等级、各类余额信息等。 + description: 返回当前登录用户的基本信息,需要登录。 produces: - application/json responses: @@ -12296,7 +12518,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/oauth.BasicUserInfo' + $ref: '#/definitions/auth.BasicUserInfo' type: object "401": description: 未登录 @@ -12525,7 +12747,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/model.Upload' + $ref: '#/definitions/models.Upload' type: object "400": description: 请求参数错误或文件受限 @@ -12535,10 +12757,6 @@ paths: description: 未登录 schema: $ref: '#/definitions/response.Any' - "409": - description: 系统保留类型或存储只读 - schema: - $ref: '#/definitions/response.Any' "500": description: 内部错误 schema: @@ -12572,10 +12790,6 @@ paths: description: 文件不存在 schema: $ref: '#/definitions/response.Any' - "409": - description: 系统保留类型或存储只读 - schema: - $ref: '#/definitions/response.Any' security: - SessionCookie: [] summary: 删除我的文件 @@ -12607,7 +12821,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/model.Upload' + $ref: '#/definitions/models.Upload' type: object "403": description: 无权操作 @@ -12669,7 +12883,7 @@ paths: - upload /api/v1/user-info: get: - description: 返回当前登录用户的基本信息及余额数据,需要登录。包括用户 ID、用户名、信任等级、各类余额信息等。 + description: 返回当前登录用户的基本信息,需要登录。 produces: - application/json responses: @@ -12680,7 +12894,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/oauth.BasicUserInfo' + $ref: '#/definitions/auth.BasicUserInfo' type: object "401": description: 未登录 @@ -12705,7 +12919,7 @@ paths: - properties: data: items: - $ref: '#/definitions/model.AccessToken' + $ref: '#/definitions/user.AccessToken' type: array type: object "401": @@ -12720,26 +12934,21 @@ paths: post: consumes: - application/json - description: 为当前用户新建一个 API 访问令牌,仅在此接口返回一次明文令牌值,请妥善保存。可通过 is_admin 字段赋予令牌管理员权限(仅管理员用户可设置)。 + description: 为当前用户新建一个 API 访问令牌,仅在此接口返回一次明文令牌值,请妥善保存。 parameters: - description: 令牌名称 in: body name: request required: true schema: - $ref: '#/definitions/user.createTokenRequest' + $ref: '#/definitions/user.createAccessTokenRequest' produces: - application/json responses: "200": description: 新建令牌成功 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/user.tokenResponse' - type: object + $ref: '#/definitions/response.Any' "400": description: 参数错误或超限 schema: @@ -12794,12 +13003,7 @@ paths: "200": description: 令牌轮换成功 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/user.tokenResponse' - type: object + $ref: '#/definitions/response.Any' "400": description: 参数错误 schema: @@ -12813,7 +13017,7 @@ paths: post: consumes: - application/json - description: 修改当前登录用户的密码。修改成功后,如果是首次明文登录的升级提示,则清除修改密码的提示状态。 + description: 修改当前登录用户的密码。 parameters: - description: 修改密码请求参数 in: body @@ -12862,12 +13066,7 @@ paths: "200": description: 登录成功,返回用户信息 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/oauth.BasicUserInfo' - type: object + $ref: '#/definitions/response.Any' "400": description: 用户名或密码错误 schema: @@ -12907,7 +13106,7 @@ paths: put: consumes: - application/json - description: 修改当前登录用户的昵称、邮箱、头像、简介、电话、性别、个人网站和所在地。 + description: 修改当前登录用户的昵称、头像、简介、电话、性别、个人网站和所在地。 parameters: - description: 更新请求参数 in: body @@ -12921,14 +13120,9 @@ paths: "200": description: 修改成功,返回更新后的用户信息 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/oauth.BasicUserInfo' - type: object + $ref: '#/definitions/response.Any' "400": - description: 邮箱已被占用或参数错误 + description: 参数错误 schema: $ref: '#/definitions/response.Any' "401": @@ -12942,7 +13136,7 @@ paths: post: consumes: - application/json - description: 使用用户名和密码注册新账号,注册成功后自动登录并建立 Session。密码长度不能少于 8 位。 + description: 使用用户名和密码注册新账号,注册成功后自动登录并建立 Session。 parameters: - description: 注册请求参数 in: body @@ -12956,12 +13150,7 @@ paths: "200": description: 注册并登录成功,返回用户信息 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/oauth.BasicUserInfo' - type: object + $ref: '#/definitions/response.Any' "400": description: 参数错误、用户名已存在或注册已关闭 schema: @@ -12975,19 +13164,14 @@ paths: - user /api/v1/user/self: get: - description: 返回当前登录用户的基本信息及余额数据,需要登录。包括用户 ID、用户名、信任等级、各类余额信息等。 + description: 返回当前登录用户的基本信息,需要登录。 produces: - application/json responses: "200": description: 用户信息 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/oauth.BasicUserInfo' - type: object + $ref: '#/definitions/response.Any' "401": description: 未登录 schema: @@ -12996,19 +13180,12 @@ paths: - SessionCookie: [] summary: 获取当前登录用户信息 tags: - - oauth + - user /api/v1/user/send-email-code: post: consumes: - application/json description: 向指定邮箱发送验证码(用于注册场景) - parameters: - - description: 发送验证码请求参数 - in: body - name: request - required: true - schema: - $ref: '#/definitions/user.sendEmailCodeRequest' produces: - application/json responses: diff --git a/backend/plugins/domain/admin/handler/auth_source.go b/backend/plugins/domain/admin/handler/auth_source.go index 27eadc46..71fd7a64 100644 --- a/backend/plugins/domain/admin/handler/auth_source.go +++ b/backend/plugins/domain/admin/handler/auth_source.go @@ -14,7 +14,17 @@ import ( "github.com/gin-gonic/gin" ) -// ListAuthSources lists all configured authentication sources. +// ListAuthSources 获取认证源列表 +// @Summary 获取认证源列表 +// @Description 返回所有已配置的 OAuth/OIDC 认证源列表,包括已启用和未启用的,需要管理员权限 +// @Tags admin +// @Produce json +// @Security SessionCookie +// @Success 200 {object} response.Any "认证源列表" +// @Failure 401 {object} response.Any "未登录" +// @Failure 403 {object} response.Any "无管理员权限" +// @Failure 500 {object} response.Any "内部错误" +// @Router /api/v1/admin/auth-sources [get] func ListAuthSources(c *gin.Context) { views, err := service.ListAuthSources(c.Request.Context()) if err != nil { @@ -25,7 +35,19 @@ func ListAuthSources(c *gin.Context) { c.JSON(http.StatusOK, response.OK(views)) } -// CreateAuthSource creates a new authentication source. +// CreateAuthSource 创建认证源 +// @Summary 创建认证源 +// @Description 创建一个新的 OAuth/OIDC 认证源配置,认证源名称必须唯一且符合命名规范,需要管理员权限 +// @Tags admin +// @Accept json +// @Produce json +// @Security SessionCookie +// @Param request body contracts.AuthSourceDTO true "创建认证源参数" +// @Success 200 {object} response.Any "创建成功,返回认证源信息" +// @Failure 400 {object} response.Any "参数错误或验证失败" +// @Failure 401 {object} response.Any "未登录" +// @Failure 403 {object} response.Any "无管理员权限" +// @Router /api/v1/admin/auth-sources [post] func CreateAuthSource(c *gin.Context) { var source contracts.AuthSourceDTO if err := c.ShouldBindJSON(&source); err != nil { @@ -42,7 +64,21 @@ func CreateAuthSource(c *gin.Context) { c.JSON(http.StatusOK, response.OK(created)) } -// UpdateAuthSource updates an authentication source. +// UpdateAuthSource 更新认证源 +// @Summary 更新认证源 +// @Description 更新指定 ID 的认证源配置。若 client_secret 字段为空,则保留原有密钥不变,需要管理员权限 +// @Tags admin +// @Accept json +// @Produce json +// @Security SessionCookie +// @Param id path uint64 true "认证源 ID 或名称" +// @Param request body contracts.AuthSourceDTO true "更新认证源参数" +// @Success 200 {object} response.Any "更新成功,返回更新后的认证源信息" +// @Failure 400 {object} response.Any "参数错误或验证失败" +// @Failure 401 {object} response.Any "未登录" +// @Failure 403 {object} response.Any "无管理员权限" +// @Failure 500 {object} response.Any "内部错误" +// @Router /api/v1/admin/auth-sources/{id} [put] func UpdateAuthSource(c *gin.Context) { id, ok := parseAuthSourceID(c) if !ok { @@ -64,7 +100,19 @@ func UpdateAuthSource(c *gin.Context) { c.JSON(http.StatusOK, response.OK(updated)) } -// ToggleAuthSource toggles the active state of an auth source. +// ToggleAuthSource 切换认证源启用状态 +// @Summary 切换认证源启用状态 +// @Description 启用或禁用指定认证源。尝试启用时将验证 Client ID 和 Client Secret 是否已配置,需要管理员权限 +// @Tags admin +// @Accept json +// @Produce json +// @Security SessionCookie +// @Param id path uint64 true "认证源 ID 或名称" +// @Success 200 {object} response.Any{data=string} "切换成功" +// @Failure 400 {object} response.Any "验证失败或认证源不存在" +// @Failure 401 {object} response.Any "未登录" +// @Failure 403 {object} response.Any "无管理员权限" +// @Router /api/v1/admin/auth-sources/{id}/toggle [put] func ToggleAuthSource(c *gin.Context) { id, ok := parseAuthSourceID(c) if !ok { @@ -80,7 +128,18 @@ func ToggleAuthSource(c *gin.Context) { c.JSON(http.StatusOK, response.OK(gin.H{"is_active": toggled.IsActive})) } -// DeleteAuthSource deletes an authentication source. +// DeleteAuthSource 删除认证源 +// @Summary 删除认证源 +// @Description 删除指定认证源及其关联的所有外部帐号绑定记录,警告:删除后相关用户将无法通过该源登录,需要管理员权限 +// @Tags admin +// @Produce json +// @Security SessionCookie +// @Param id path uint64 true "认证源 ID 或名称" +// @Success 200 {object} response.Any{data=string} "删除成功" +// @Failure 400 {object} response.Any "ID 无效或删除失败" +// @Failure 401 {object} response.Any "未登录" +// @Failure 403 {object} response.Any "无管理员权限" +// @Router /api/v1/admin/auth-sources/{id} [delete] func DeleteAuthSource(c *gin.Context) { id, ok := parseAuthSourceID(c) if !ok { diff --git a/backend/plugins/domain/auth/handlers.go b/backend/plugins/domain/auth/handlers.go index c7a8f2a4..d96fe321 100644 --- a/backend/plugins/domain/auth/handlers.go +++ b/backend/plugins/domain/auth/handlers.go @@ -25,11 +25,26 @@ import ( ) // GetLoginSources 获取可用登录源列表 +// @Summary 获取可用登录源 +// @Description 返回当前系统已启用的所有 OAuth 登录源,前端展示登录按钮列表时调用 +// @Tags oauth +// @Produce json +// @Success 200 {object} response.Any{data=[]auth.AuthSourceView} "登录源列表" +// @Router /api/v1/oauth/sources [get] func GetLoginSources(c *gin.Context) { c.JSON(http.StatusOK, response.OK(activeLoginSources(c.Request.Context()))) } // GetLoginURL 获取登录授权地址 +// @Summary 获取登录授权地址 +// @Description 根据指定认证源生成 OAuth 授权 URL,前端跳转到该 URL 完成 OAuth 登录授权。source 参数为空时使用第一个启用的认证源。 +// @Tags oauth +// @Produce json +// @Param source query string false "认证源名称,为空使用第一个启用的认证源" +// @Success 200 {object} response.Any{data=auth.OAuthAuthorizeResponse} "授权 URL" +// @Failure 400 {object} response.Any "认证源不存在或未配置" +// @Failure 500 {object} response.Any "构造 URL 失败" +// @Router /api/v1/oauth/login [get] func GetLoginURL(c *gin.Context) { ctx := c.Request.Context() if !isOIDCLoginEnabled(ctx) { @@ -126,6 +141,16 @@ func reserveOAuthStateSlot(ctx context.Context, sessionHash string) error { } // Authorize 发起指定认证源授权 +// @Summary 发起指定认证源授权 +// @Description 根据指定认证源名称发起 OAuth 授权,支持 purpose 参数用于区分登录和账号绑定场景。认证源必须已启用。 +// @Tags oauth +// @Produce json +// @Param source path string true "认证源名称" +// @Param purpose query string false "授权目的:login(登录)或 bind(绑定账号),默认 login" +// @Success 200 {object} response.Any{data=auth.OAuthAuthorizeResponse} "授权 URL" +// @Failure 400 {object} response.Any "认证源不存在或未启用" +// @Failure 500 {object} response.Any "构造 URL 失败" +// @Router /api/v1/oauth/{source}/authorize [get] func Authorize(c *gin.Context) { ctx := c.Request.Context() if !isOIDCLoginEnabled(ctx) { @@ -197,6 +222,17 @@ func Authorize(c *gin.Context) { } // Callback OAuth 回调处理 +// @Summary OAuth 回调处理 +// @Description 接收前端传回的 state 和 code,完成 OAuth/OIDC 认证并建立会话。支持登录(login)和账号绑定(bind)两种场景。 +// @Tags oauth +// @Accept json +// @Produce json +// @Param request body auth.CallbackRequest true "回调请求参数" +// @Success 200 {object} response.Any{data=auth.OAuthCallbackResult} "登录或绑定成功" +// @Failure 400 {object} response.Any "state 无效、参数错误或认证源错误" +// @Failure 401 {object} response.Any "绑定场景未登录" +// @Failure 500 {object} response.Any "OAuth 认证失败或内部错误" +// @Router /api/v1/oauth/callback [post] func Callback(c *gin.Context) { var req CallbackRequest if err := c.ShouldBindJSON(&req); err != nil { @@ -437,6 +473,15 @@ func handleCallbackRegister(ctx context.Context, c *gin.Context, source *AuthSou } // UserInfo 获取当前登录用户信息 +// @Summary 获取当前登录用户信息 +// @Description 返回当前登录用户的基本信息,需要登录。 +// @Tags oauth +// @Produce json +// @Security SessionCookie +// @Success 200 {object} response.Any{data=auth.BasicUserInfo} "用户信息" +// @Failure 401 {object} response.Any "未登录" +// @Router /api/v1/oauth/user-info [get] +// @Router /api/v1/user-info [get] func UserInfo(c *gin.Context) { user, _ := ginutil.GetFromContext[*contracts.UserDTO](c, contracts.AuthUserObjKey) session := sessions.Default(c) @@ -449,6 +494,14 @@ func UserInfo(c *gin.Context) { } // Logout 退出登录 +// @Summary 退出登录 +// @Description 清除当前用户的登录会话,完成退出。清除 Cookie 中的 Session 数据。 +// @Tags oauth +// @Produce json +// @Security SessionCookie +// @Success 200 {object} response.Any{data=string} "退出成功" +// @Failure 500 {object} response.Any "Session 清除失败" +// @Router /api/v1/oauth/logout [get] func Logout(c *gin.Context) { session := sessions.Default(c) userID := session.Get(UserIDKey) @@ -469,6 +522,15 @@ func Logout(c *gin.Context) { } // ListExternalAccounts 获取当前用户的外部帐号绑定列表 +// @Summary 获取外部帐号列表 +// @Description 返回当前登录用户已绑定的所有外部 OAuth 帐号信息,需要登录 +// @Tags oauth +// @Produce json +// @Security SessionCookie +// @Success 200 {object} response.Any "外部帐号列表" +// @Failure 401 {object} response.Any "未登录" +// @Failure 500 {object} response.Any "内部错误" +// @Router /api/v1/oauth/external-accounts [get] func ListExternalAccounts(c *gin.Context) { userID := GetUserIDFromContext(c) accounts, err := ListExternalAccountsByUserID(c.Request.Context(), userID) @@ -480,6 +542,16 @@ func ListExternalAccounts(c *gin.Context) { } // DeleteExternalAccount 解除外部帐号绑定 +// @Summary 解除外部帐号绑定 +// @Description 解除当前登录用户与指定外部帐号的绑定关系,需要登录 +// @Tags oauth +// @Produce json +// @Security SessionCookie +// @Param id path uint64 true "外部帐号绑定记录 ID" +// @Success 200 {object} response.Any{data=string} "解除绑定成功" +// @Failure 400 {object} response.Any "ID 无效或解除失败" +// @Failure 401 {object} response.Any "未登录" +// @Router /api/v1/oauth/external-accounts/{id}/delete [post] func DeleteExternalAccount(c *gin.Context) { userID := GetUserIDFromContext(c) if userID == 0 { diff --git a/backend/plugins/domain/message_gateway/handler/push_channel.go b/backend/plugins/domain/message_gateway/handler/push_channel.go index cdfe0c8f..c3c07a72 100644 --- a/backend/plugins/domain/message_gateway/handler/push_channel.go +++ b/backend/plugins/domain/message_gateway/handler/push_channel.go @@ -15,12 +15,26 @@ import ( "github.com/gin-gonic/gin" ) -// ListPushChannelDefinitions returns channel definitions. +// ListPushChannelDefinitions 获取各种消息通道的表单配置定义列表 +// @Summary 获取所有消息通道配置字段定义 +// @Description 返回系统支持的所有消息通道类型的动态表单定义,需要管理员权限 +// @Tags admin-push +// @Produce json +// @Security SessionCookie +// @Success 200 {object} response.Any "通道配置定义列表" +// @Router /api/v1/admin/push/channels/definitions [get] func ListPushChannelDefinitions(c *gin.Context) { c.JSON(http.StatusOK, response.OK(model.ListPushDefinitions())) } -// ListPushChannels lists configured push channels. +// ListPushChannels 获取消息通道列表 +// @Summary 获取所有消息通道 +// @Description 返回系统配置的所有消息通道列表,需要管理员权限 +// @Tags admin-push +// @Produce json +// @Security SessionCookie +// @Success 200 {object} response.Any{data=[]model.PushChannel} "消息通道列表" +// @Router /api/v1/admin/push/channels [get] func ListPushChannels(c *gin.Context) { channels, err := service.ListPushChannels(c.Request.Context()) if err != nil { @@ -49,19 +63,46 @@ func handlePushChannelNotFoundError(c *gin.Context, err error, fallback func(c * fallback(c, err.Error()) } -// CreatePushChannel creates a push channel. +// CreatePushChannel 创建消息通道 +// @Summary 创建消息通道 +// @Description 新建一个消息通道配置,需要管理员权限 +// @Tags admin-push +// @Accept json +// @Produce json +// @Security SessionCookie +// @Param request body model.CreatePushChannelRequest true "创建参数" +// @Success 200 {object} response.Any{data=model.PushChannel} "创建成功" +// @Router /api/v1/admin/push/channels [post] func CreatePushChannel(c *gin.Context) { handleJSONRequest(c, service.CreatePushChannel) } -// UpdatePushChannel updates a push channel. +// UpdatePushChannel 更新消息通道 +// @Summary 更新消息通道 +// @Description 修改消息通道配置,需要管理员权限 +// @Tags admin-push +// @Accept json +// @Produce json +// @Security SessionCookie +// @Param id path uint64 true "通道ID" +// @Param request body model.UpdatePushChannelRequest true "更新参数" +// @Success 200 {object} response.Any{data=model.PushChannel} "更新成功" +// @Router /api/v1/admin/push/channels/{id} [put] func UpdatePushChannel(c *gin.Context) { handleEntityUpdate(c, parsePushChannelID, service.UpdatePushChannel, func(c *gin.Context, err error) { handlePushChannelNotFoundError(c, err, response.AbortInternal) }) } -// DeletePushChannel deletes a push channel. +// DeletePushChannel 删除消息通道 +// @Summary 删除消息通道 +// @Description 根据ID删除消息通道,需要管理员权限 +// @Tags admin-push +// @Produce json +// @Security SessionCookie +// @Param id path uint64 true "通道ID" +// @Success 200 {object} response.Any "删除成功" +// @Router /api/v1/admin/push/channels/{id} [delete] func DeletePushChannel(c *gin.Context) { id, ok := parsePushChannelID(c) if !ok { @@ -75,7 +116,16 @@ func DeletePushChannel(c *gin.Context) { c.JSON(http.StatusOK, response.OKNil()) } -// TestPushChannel tests connectivity of a push channel. +// TestPushChannel 测试通道连通性 +// @Summary 测试通道连通性 +// @Description 触发一次临时的或现有的通道连通性推送测试,需要管理员权限 +// @Tags admin-push +// @Accept json +// @Produce json +// @Security SessionCookie +// @Param request body model.TestPushChannelRequest true "测试参数" +// @Success 200 {object} response.Any "测试触发成功" +// @Router /api/v1/admin/push/channels/test [post] func TestPushChannel(c *gin.Context) { var req model.TestPushChannelRequest if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/plugins/domain/message_gateway/handler/push_event.go b/backend/plugins/domain/message_gateway/handler/push_event.go index d7a6213b..04c6e717 100644 --- a/backend/plugins/domain/message_gateway/handler/push_event.go +++ b/backend/plugins/domain/message_gateway/handler/push_event.go @@ -15,7 +15,14 @@ import ( "github.com/gin-gonic/gin" ) -// ListPushEvents lists configured push events. +// ListPushEvents 获取通知事件列表 +// @Summary 获取所有通知事件 +// @Description 返回系统配置的通知事件列表,包括预置和自定义事件,需要管理员权限 +// @Tags admin-push +// @Produce json +// @Security SessionCookie +// @Success 200 {object} response.Any{data=[]model.PushEvent} "通知事件列表" +// @Router /api/v1/admin/push/events [get] func ListPushEvents(c *gin.Context) { ctx := c.Request.Context() events, err := service.ListPushEvents(ctx) @@ -26,7 +33,14 @@ func ListPushEvents(c *gin.Context) { c.JSON(http.StatusOK, response.OK(events)) } -// ListBuiltInPushEvents lists system built-in push event definitions. +// ListBuiltInPushEvents 获取内置通知事件列表 +// @Summary 获取所有内置通知事件 +// @Description 返回系统定义的所有内置通知事件元数据,供前端下拉框选择,需要管理员权限 +// @Tags admin-push +// @Produce json +// @Security SessionCookie +// @Success 200 {object} response.Any "内置通知事件列表" +// @Router /api/v1/admin/push/events/builtin [get] func ListBuiltInPushEvents(c *gin.Context) { c.JSON(http.StatusOK, response.OK(service.GetBuiltInEvents())) } @@ -50,12 +64,29 @@ func handlePushEventNotFoundError(c *gin.Context, err error, fallback func(c *gi fallback(c, err.Error()) } -// CreatePushEvent creates a new push event configuration. +// CreatePushEvent 创建通知事件 +// @Summary 创建通知事件 +// @Description 绑定系统内置事件或异步任务、推送渠道、接收目标并创建通知事件配置,需要管理员权限 +// @Tags admin-push +// @Accept json +// @Produce json +// @Security SessionCookie +// @Param request body model.CreatePushEventRequest true "创建参数" +// @Success 200 {object} response.Any{data=model.PushEvent} "创建成功" +// @Router /api/v1/admin/push/events [post] func CreatePushEvent(c *gin.Context) { handleJSONRequest(c, service.CreatePushEvent) } -// DeletePushEvent deletes a push event configuration by ID. +// DeletePushEvent 删除通知事件配置 +// @Summary 删除通知事件配置 +// @Description 删除数据库中的特定通知事件配置,需要管理员权限 +// @Tags admin-push +// @Produce json +// @Security SessionCookie +// @Param id path int true "事件 ID" +// @Success 200 {object} response.Any{data=string} "删除成功" +// @Router /api/v1/admin/push/events/{id} [delete] func DeletePushEvent(c *gin.Context) { id, ok := parsePushEventID(c) if !ok { @@ -69,7 +100,17 @@ func DeletePushEvent(c *gin.Context) { c.JSON(http.StatusOK, response.OKNil()) } -// UpdatePushEvent updates an existing push event. +// UpdatePushEvent 更新通知事件 +// @Summary 更新通知事件 +// @Description 更新已有通知事件的推送渠道、接收目标和内容模板,需要管理员权限 +// @Tags admin-push +// @Accept json +// @Produce json +// @Security SessionCookie +// @Param id path int true "事件 ID" +// @Param request body model.UpdatePushEventRequest true "更新参数" +// @Success 200 {object} response.Any{data=string} "修改成功" +// @Router /api/v1/admin/push/events/{id} [put] func UpdatePushEvent(c *gin.Context) { id, ok := parsePushEventID(c) if !ok { @@ -89,7 +130,15 @@ func UpdatePushEvent(c *gin.Context) { c.JSON(http.StatusOK, response.OKNil()) } -// TogglePushEvent toggles the enabled state of a push event. +// TogglePushEvent 快捷切换通知事件启用状态 +// @Summary 快捷切换通知事件启用状态 +// @Description 启用或禁用指定的通知事件 +// @Tags admin-push +// @Produce json +// @Security SessionCookie +// @Param id path int true "事件 ID" +// @Success 200 {object} response.Any{data=string} "切换成功" +// @Router /api/v1/admin/push/events/{id}/toggle [post] func TogglePushEvent(c *gin.Context) { id, ok := parsePushEventID(c) if !ok { @@ -104,7 +153,18 @@ func TogglePushEvent(c *gin.Context) { c.JSON(http.StatusOK, response.OK(enabled)) } -// ListPushHistories returns paginated push notification delivery histories. +// ListPushHistories 分页获取通知推送历史 +// @Summary 分页获取通知推送历史 +// @Description 返回分页的通知历史日志数据,需要管理员权限 +// @Tags admin-push +// @Produce json +// @Security SessionCookie +// @Param page query int false "当前页码" +// @Param page_size query int false "分页大小" +// @Param event_key query string false "过滤事件名称" +// @Param status query string false "过滤发送状态" +// @Success 200 {object} response.Any "推送历史列表" +// @Router /api/v1/admin/push/histories [get] func ListPushHistories(c *gin.Context) { page, _ := strconv.Atoi(c.DefaultQuery("page", "1")) pageSize, _ := strconv.Atoi(c.DefaultQuery("page_size", "20")) @@ -132,7 +192,16 @@ func ListPushHistories(c *gin.Context) { })) } -// TestPush executes a synchronous push test using the specified config. +// TestPush 测试推送通道发送 +// @Summary 测试推送通道发送 +// @Description 接收临时通知渠道配置并在本地同步调用 Pusher.Send 发送测试消息 +// @Tags admin-push +// @Accept json +// @Produce json +// @Security SessionCookie +// @Param request body model.TestPushRequest true "测试请求体" +// @Success 200 {object} response.Any{data=string} "测试成功" +// @Router /api/v1/admin/push/test [post] func TestPush(c *gin.Context) { var req model.TestPushRequest if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/plugins/domain/system/plugin.go b/backend/plugins/domain/system/plugin.go index 5e636967..71763b86 100644 --- a/backend/plugins/domain/system/plugin.go +++ b/backend/plugins/domain/system/plugin.go @@ -56,9 +56,7 @@ func (p *Plugin) Apply(ctx *core.Context) error { ctx.Router().GET("/api/healthz", func(c *gin.Context) { c.JSON(http.StatusOK, gin.H{"status": "ok"}) }) - ctx.Router().GET("/api/health", func(c *gin.Context) { - c.JSON(http.StatusOK, response.OKNil()) - }) + ctx.Router().GET("/api/health", Health) ctx.Router().RegisterWhitelist("/api/health") // 2. Public config @@ -92,3 +90,14 @@ func (p *Plugin) Apply(ctx *core.Context) error { return nil } + +// Health 健康检查 +// @Summary 健康检查 +// @Description 检查服务是否正常运行,可用于负载均衡存活探测 +// @Tags health +// @Produce json +// @Success 200 {object} response.Any{data=string} "服务正常" +// @Router /api/health [get] +func Health(c *gin.Context) { + c.JSON(http.StatusOK, response.OKNil()) +} diff --git a/backend/plugins/domain/upload/handler/file_management.go b/backend/plugins/domain/upload/handler/file_management.go index 69f9aecf..1666cb7d 100644 --- a/backend/plugins/domain/upload/handler/file_management.go +++ b/backend/plugins/domain/upload/handler/file_management.go @@ -50,6 +50,7 @@ type listFilesResponse struct { // @Security SessionCookie // @Success 200 {object} response.Any{data=listFilesResponse} "查询成功" // @Failure 400 {object} response.Any "参数错误" +// @Router /api/v1/admin/uploads [get] // @Router /api/v1/admin/uploads/files [get] func ListFiles(c *gin.Context) { ctx := c.Request.Context() @@ -96,6 +97,7 @@ func ListFiles(c *gin.Context) { // @Security SessionCookie // @Success 200 {object} response.Any "删除成功" // @Failure 404 {object} response.Any "文件不存在" +// @Router /api/v1/admin/uploads/{id} [delete] // @Router /api/v1/admin/uploads/files/{id} [delete] func DeleteFile(c *gin.Context) { ctx := c.Request.Context() diff --git a/backend/plugins/domain/user/handlers.go b/backend/plugins/domain/user/handlers.go index 198f9431..8ddea90b 100644 --- a/backend/plugins/domain/user/handlers.go +++ b/backend/plugins/domain/user/handlers.go @@ -77,7 +77,17 @@ func invalidateTokenCache(ctx context.Context, tokenHash string) { } } -// Login handles username and password authentication. +// Login 用户密码登录 +// @Summary 用户密码登录 +// @Description 使用用户名和密码登录,登录成功后建立 Session。若管理员已关闭密码登录功能则返回错误。 +// @Tags user +// @Accept json +// @Produce json +// @Param request body user.loginRequest true "登录请求参数" +// @Success 200 {object} response.Any "登录成功,返回用户信息" +// @Failure 400 {object} response.Any "用户名或密码错误" +// @Failure 500 {object} response.Any "服务内部错误" +// @Router /api/v1/user/login [post] func Login(c *gin.Context) { var req loginRequest if err := c.ShouldBindJSON(&req); err != nil { @@ -109,7 +119,17 @@ func Login(c *gin.Context) { c.JSON(http.StatusOK, response.OK(user)) } -// Register registers a new user. +// Register 用户注册 +// @Summary 用户注册 +// @Description 使用用户名和密码注册新账号,注册成功后自动登录并建立 Session。 +// @Tags user +// @Accept json +// @Produce json +// @Param request body user.registerRequest true "注册请求参数" +// @Success 200 {object} response.Any "注册并登录成功,返回用户信息" +// @Failure 400 {object} response.Any "参数错误、用户名已存在或注册已关闭" +// @Failure 500 {object} response.Any "服务内部错误" +// @Router /api/v1/user/register [post] func Register(c *gin.Context) { var req registerRequest if err := c.ShouldBindJSON(&req); err != nil { @@ -142,7 +162,15 @@ func Register(c *gin.Context) { c.JSON(http.StatusOK, response.OK(newUser)) } -// Logout logs out the current session. +// Logout 用户退出登录 +// @Summary 用户退出登录 +// @Description 清除用户登录 Session,完成退出 +// @Tags user +// @Produce json +// @Security SessionCookie +// @Success 200 {object} response.Any{data=string} "退出成功" +// @Failure 500 {object} response.Any "Session 清除失败" +// @Router /api/v1/user/logout [get] func Logout(c *gin.Context) { sess := sessions.Default(c) sess.Options(sessions.Options{ @@ -156,12 +184,30 @@ func Logout(c *gin.Context) { c.JSON(http.StatusOK, response.OKNil()) } -// SendEmailCode sends an email verification code. +// SendEmailCode 发送邮箱验证码 +// @Summary 发送邮箱验证码 +// @Description 向指定邮箱发送验证码(用于注册场景) +// @Tags user +// @Accept json +// @Produce json +// @Success 200 {object} response.Any "发送成功" +// @Failure 400 {object} response.Any "参数错误" +// @Router /api/v1/user/send-email-code [post] func SendEmailCode(c *gin.Context) { c.JSON(http.StatusOK, response.OK(gin.H{"sent": true})) } -// ChangePassword changes the current user password. +// ChangePassword 修改用户密码 +// @Summary 修改用户密码 +// @Description 修改当前登录用户的密码。 +// @Tags user +// @Accept json +// @Produce json +// @Param request body user.changePasswordRequest true "修改密码请求参数" +// @Success 200 {object} response.Any{data=string} "修改密码成功" +// @Failure 400 {object} response.Any "原密码错误或新密码不符合要求" +// @Failure 401 {object} response.Any "请先登录" +// @Router /api/v1/user/change-password [post] func ChangePassword(c *gin.Context) { var req changePasswordRequest if err := c.ShouldBindJSON(&req); err != nil { @@ -200,7 +246,15 @@ func ChangePassword(c *gin.Context) { c.JSON(http.StatusOK, response.OKNil()) } -// Self returns the current authenticated user. +// Self 获取当前登录用户信息 +// @Summary 获取当前登录用户信息 +// @Description 返回当前登录用户的基本信息,需要登录。 +// @Tags user +// @Produce json +// @Security SessionCookie +// @Success 200 {object} response.Any "用户信息" +// @Failure 401 {object} response.Any "未登录" +// @Router /api/v1/user/self [get] func Self(c *gin.Context) { svc := getAuthService() if svc == nil { @@ -216,7 +270,17 @@ func Self(c *gin.Context) { c.JSON(http.StatusOK, response.OK(user)) } -// UpdateProfile updates profile info. +// UpdateProfile 修改当前登录用户的个人资料 +// @Summary 修改当前登录用户的个人资料 +// @Description 修改当前登录用户的昵称、头像、简介、电话、性别、个人网站和所在地。 +// @Tags user +// @Accept json +// @Produce json +// @Param request body user.updateProfileRequest true "更新请求参数" +// @Success 200 {object} response.Any "修改成功,返回更新后的用户信息" +// @Failure 400 {object} response.Any "参数错误" +// @Failure 401 {object} response.Any "未登录" +// @Router /api/v1/user/profile [put] func UpdateProfile(c *gin.Context) { var req updateProfileRequest if err := c.ShouldBindJSON(&req); err != nil { @@ -247,7 +311,15 @@ func UpdateProfile(c *gin.Context) { c.JSON(http.StatusOK, response.OK(user)) } -// ListAccessTokens lists access tokens for the current user. +// ListAccessTokens 获取当前用户的 AccessToken 列表 +// @Summary 获取当前用户的 AccessToken 列表 +// @Description 返回当前登录用户的所有 active access tokens(脱敏后) +// @Tags user +// @Produce json +// @Security SessionCookie +// @Success 200 {object} response.Any{data=[]user.AccessToken} "令牌列表" +// @Failure 401 {object} response.Any "未登录" +// @Router /api/v1/user/access-tokens [get] func ListAccessTokens(c *gin.Context) { userID := getUserIDFromSession(c) tokens, err := listAccessTokensByUser(c.Request.Context(), userID) @@ -262,7 +334,17 @@ const ( tokenMaskMinLength = 8 ) -// CreateAccessToken generates a new access token. +// CreateAccessToken 创建一个新的 AccessToken +// @Summary 创建一个新的 AccessToken +// @Description 为当前用户新建一个 API 访问令牌,仅在此接口返回一次明文令牌值,请妥善保存。 +// @Tags user +// @Accept json +// @Produce json +// @Param request body user.createAccessTokenRequest true "令牌名称" +// @Security SessionCookie +// @Success 200 {object} response.Any "新建令牌成功" +// @Failure 400 {object} response.Any "参数错误或超限" +// @Router /api/v1/user/access-tokens [post] func CreateAccessToken(c *gin.Context) { var req createAccessTokenRequest if err := c.ShouldBindJSON(&req); err != nil { @@ -301,7 +383,16 @@ func CreateAccessToken(c *gin.Context) { })) } -// DeleteAccessToken deletes a specific access token. +// DeleteAccessToken 删除一个 AccessToken +// @Summary 删除一个 AccessToken +// @Description 撤销并删除一个属于当前用户的 API 访问令牌 +// @Tags user +// @Produce json +// @Param id path string true "令牌ID" +// @Security SessionCookie +// @Success 200 {object} response.Any{data=string} "删除成功" +// @Failure 400 {object} response.Any "参数错误" +// @Router /api/v1/user/access-tokens/{id} [delete] func DeleteAccessToken(c *gin.Context) { idStr := c.Param("id") id, err := strconv.ParseUint(idStr, 10, 64) @@ -324,7 +415,16 @@ func DeleteAccessToken(c *gin.Context) { c.JSON(http.StatusOK, response.OKNil()) } -// RotateAccessToken rotates an access token value. +// RotateAccessToken 轮换一个 AccessToken +// @Summary 轮换一个 AccessToken +// @Description 轮换(重新生成)一个属于当前用户的 API 访问令牌的密钥,旧令牌将立即失效 +// @Tags user +// @Produce json +// @Param id path string true "令牌ID" +// @Security SessionCookie +// @Success 200 {object} response.Any "令牌轮换成功" +// @Failure 400 {object} response.Any "参数错误" +// @Router /api/v1/user/access-tokens/{id}/rotate [post] func RotateAccessToken(c *gin.Context) { idStr := c.Param("id") id, err := strconv.ParseUint(idStr, 10, 64) diff --git a/docs/changelog/index.md b/docs/changelog/index.md index d0ad344c..55e0f1ba 100644 --- a/docs/changelog/index.md +++ b/docs/changelog/index.md @@ -22,6 +22,7 @@ sidebar: false - 删除 OpenFlare 内与 Wavelet 重复的 oauth/cap/user/upload/config/health/admin 平台副本,业务改走契约(登录中间件、公共配置、推送注册、异步任务);用户/文件/系统配置由上游插件提供,控制台接口形状保持金标准子集。 - 控制面读写系统配置改为走上游管理仓储并同步失效缓存,避免选项/节点/日志库切换写入后 `/api/v1/config/public` 仍返回旧值。 - 已部署库启动时把历史 `goose_db_version` 一次性写入 `w_schema_versions`(`openflare/legacy` 与 `server`),不再重跑 76 条混合迁移;全新安装只创建当前的 `of_*` 业务表。ClickHouse 继续只升级节点访问/可观测相关表,用户访问日志表改由上游负责。 +- `make swagger` 重新扫描上游平台插件,对外文档覆盖金标准全部 232 条 path+method(允许超集);`GET /api/v1/config/public` 仍返回扁平键值。 ## [v3.5.4] - 2026-08-29 ### ✨ 新功能 diff --git a/docs/swagger.json b/docs/swagger.json index 00149de2..87fa6049 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -50,7 +50,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/Wavelet_OpenFlare_plugins_server_cap.ChallengeResponse" + "$ref": "#/definitions/cap.ChallengeResponse" } } } @@ -102,7 +102,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/Wavelet_OpenFlare_plugins_server_cap.RedeemResponse" + "$ref": "#/definitions/cap.RedeemResponse" } } } @@ -175,22 +175,7 @@ "200": { "description": "认证源列表", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.AuthSource" - } - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "401": { @@ -237,7 +222,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/auth_source.AuthSourceRequest" + "$ref": "#/definitions/contracts.AuthSourceDTO" } } ], @@ -245,19 +230,7 @@ "200": { "description": "创建成功,返回认证源信息", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.AuthSource" - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "400": { @@ -314,7 +287,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/auth_source.AuthSourceRequest" + "$ref": "#/definitions/contracts.AuthSourceDTO" } } ], @@ -322,19 +295,7 @@ "200": { "description": "更新成功,返回更新后的认证源信息", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.AuthSource" - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "400": { @@ -453,15 +414,6 @@ "name": "id", "in": "path", "required": true - }, - { - "description": "启用状态", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/auth_source.ToggleAuthSourceRequest" - } } ], "responses": { @@ -572,7 +524,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/cache.updateCacheConfigRequest" + "$ref": "#/definitions/model.UpdateCacheConfigRequest" } } ], @@ -637,7 +589,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/diskcache.Status" + "$ref": "#/definitions/disk.Status" } } } @@ -735,7 +687,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/status.DatabaseInfoResponse" + "$ref": "#/definitions/model.DatabaseInfoResponse" } } } @@ -784,7 +736,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/db_manage.DBOverviewResponse" + "$ref": "#/definitions/model.DBOverviewResponse" } } } @@ -837,7 +789,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/db_manage.ExecuteSQLRequest" + "$ref": "#/definitions/model.ExecuteSQLRequest" } } ], @@ -853,7 +805,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/db_manage.ExecuteSQLResponse" + "$ref": "#/definitions/model.ExecuteSQLResponse" } } } @@ -988,7 +940,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/logs.logsResponse" + "$ref": "#/definitions/model.LogsResponse" } } } @@ -1017,7 +969,7 @@ "SessionCookie": [] } ], - "description": "分页并按照用户、接口路径、时间范围等维度检索用户访问日志列表(需要管理员权限,日志存储未启用时报错)", + "description": "分页并按照用户、接口路径、时间范围等维度检索用户访问日志列表(需要管理员权限)", "produces": [ "application/json" ], @@ -1077,7 +1029,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/logs.accessLogsResponse" + "$ref": "#/definitions/model.AccessLogsResponse" } } } @@ -1085,7 +1037,7 @@ } }, "400": { - "description": "日志存储未启用或参数错误", + "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } @@ -1101,6 +1053,12 @@ "schema": { "$ref": "#/definitions/response.Any" } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } } } } @@ -1112,7 +1070,7 @@ "SessionCookie": [] } ], - "description": "聚合统计最近 7 天的每日访问趋势、浏览器分布以及前 10 名最活跃用户排行(需要管理员权限,日志存储未启用时报错)", + "description": "聚合统计最近 7 天的每日访问趋势、浏览器分布以及前 10 名最活跃用户排行(需要管理员权限)", "produces": [ "application/json" ], @@ -1132,19 +1090,13 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/logs.logsAnalyticsResponse" + "$ref": "#/definitions/model.LogsAnalyticsResponse" } } } ] } }, - "400": { - "description": "日志存储未启用", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, "401": { "description": "未登录", "schema": { @@ -1156,6 +1108,12 @@ "schema": { "$ref": "#/definitions/response.Any" } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } } } } @@ -1170,6 +1128,295 @@ "responses": {} } }, + "/api/v1/admin/message-gateway/channels": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Returns all messaging channels; secrets are masked", + "produces": [ + "application/json" + ], + "tags": [ + "admin-message-gateway" + ], + "summary": "List message gateway channels", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.ChannelDTO" + } + } + } + } + ] + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Creates a Telegram or QQ channel with encrypted credentials", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "admin-message-gateway" + ], + "summary": "Create message gateway channel", + "parameters": [ + { + "description": "create body", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreateChannelRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ChannelDTO" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/admin/message-gateway/channels/definitions": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Returns form field definitions for Telegram and QQ channels", + "produces": [ + "application/json" + ], + "tags": [ + "admin-message-gateway" + ], + "summary": "List message gateway channel definitions", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.Definition" + } + } + } + } + ] + } + } + } + } + }, + "/api/v1/admin/message-gateway/channels/{id}": { + "delete": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Deletes a channel and cascaded bindings and pairing codes", + "produces": [ + "application/json" + ], + "tags": [ + "admin-message-gateway" + ], + "summary": "Delete message gateway channel", + "parameters": [ + { + "type": "integer", + "description": "channel id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "patch": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Updates a channel; empty secrets keep the current ciphertext", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "admin-message-gateway" + ], + "summary": "Update message gateway channel", + "parameters": [ + { + "type": "integer", + "description": "channel id", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "update body", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateChannelRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ChannelDTO" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/admin/message-gateway/channels/{id}/test": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Probes stored credentials without returning secrets", + "produces": [ + "application/json" + ], + "tags": [ + "admin-message-gateway" + ], + "summary": "Test message gateway channel", + "parameters": [ + { + "type": "integer", + "description": "channel id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, "/api/v1/admin/push/channels": { "get": { "security": [ @@ -1233,7 +1480,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/push.CreateChannelRequest" + "$ref": "#/definitions/model.CreatePushChannelRequest" } } ], @@ -1266,7 +1513,7 @@ "SessionCookie": [] } ], - "description": "返回系统支持的所有消息通道类型(如飞书、邮件、自定义、Telegram)的动态表单定义,需要管理员权限", + "description": "返回系统支持的所有消息通道类型的动态表单定义,需要管理员权限", "produces": [ "application/json" ], @@ -1278,22 +1525,7 @@ "200": { "description": "通道配置定义列表", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/push.Definition" - } - } - } - } - ] + "$ref": "#/definitions/response.Any" } } } @@ -1324,7 +1556,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/push.TestChannelRequest" + "$ref": "#/definitions/model.TestPushChannelRequest" } } ], @@ -1371,7 +1603,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/push.UpdateChannelRequest" + "$ref": "#/definitions/model.UpdatePushChannelRequest" } } ], @@ -1493,7 +1725,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/push.CreateEventRequest" + "$ref": "#/definitions/model.CreatePushEventRequest" } } ], @@ -1538,22 +1770,7 @@ "200": { "description": "内置通知事件列表", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/push.EventMetadata" - } - } - } - } - ] + "$ref": "#/definitions/response.Any" } } } @@ -1591,7 +1808,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/push.UpdateEventRequest" + "$ref": "#/definitions/model.UpdatePushEventRequest" } } ], @@ -1752,19 +1969,7 @@ "200": { "description": "推送历史列表", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/push.pushHistoriesResponse" - } - } - } - ] + "$ref": "#/definitions/response.Any" } } } @@ -1795,7 +2000,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/push.TestPushRequest" + "$ref": "#/definitions/model.TestPushRequest" } } ], @@ -1848,7 +2053,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/status.SystemStatusResponse" + "$ref": "#/definitions/model.SystemStatusResponse" } } } @@ -1897,7 +2102,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/status.LogDatabaseStatus" + "$ref": "#/definitions/model.LogDatabaseStatus" } } } @@ -1962,7 +2167,7 @@ "data": { "type": "array", "items": { - "$ref": "#/definitions/model.SystemConfig" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.SystemConfig" } } } @@ -2014,7 +2219,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/system_config.CreateSystemConfigRequest" + "$ref": "#/definitions/model.CreateSystemConfigRequest" } } ], @@ -2089,7 +2294,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/system_config.TestSMTPRequest" + "$ref": "#/definitions/model.TestSMTPRequest" } } ], @@ -2105,7 +2310,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/system_config.TestSMTPResponse" + "$ref": "#/definitions/model.TestSMTPResponse" } } } @@ -2157,7 +2362,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/model.SystemConfig" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.SystemConfig" } } } @@ -2221,7 +2426,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/system_config.UpdateSystemConfigRequest" + "$ref": "#/definitions/model.UpdateSystemConfigRequest" } } ], @@ -2302,7 +2507,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/task.DispatchTaskRequest" + "$ref": "#/definitions/model.DispatchTaskRequest" } } ], @@ -2380,18 +2585,6 @@ "name": "task_type", "in": "query" }, - { - "type": "string", - "description": "任务类型前缀筛选(与 task_type / task_types 互斥,精确类型优先)", - "name": "task_type_prefix", - "in": "query" - }, - { - "type": "string", - "description": "逗号分隔的精确任务类型列表(IN 筛选,优先于前缀)", - "name": "task_types", - "in": "query" - }, { "type": "integer", "default": 1, @@ -2477,7 +2670,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/model.TaskExecution" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.TaskExecution" } } } @@ -2594,7 +2787,7 @@ "SessionCookie": [] } ], - "description": "返回管理员可管理的定时任务配置列表,包括名称、关联的异步任务类型、Cron 表达式和启用状态;系统内部排程不会暴露,需要管理员权限", + "description": "返回系统所有的定时任务配置列表,包括名称、关联的异步任务类型、Cron 表达式和启用状态,需要管理员权限", "produces": [ "application/json" ], @@ -2616,7 +2809,7 @@ "data": { "type": "array", "items": { - "$ref": "#/definitions/model.Schedule" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.Schedule" } } } @@ -2662,7 +2855,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/task.CreateScheduleRequest" + "$ref": "#/definitions/model.CreateScheduleRequest" } } ], @@ -2678,7 +2871,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/model.Schedule" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.Schedule" } } } @@ -2744,7 +2937,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/task.UpdateScheduleRequest" + "$ref": "#/definitions/model.UpdateScheduleRequest" } } ], @@ -2760,7 +2953,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/model.Schedule" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.Schedule" } } } @@ -2859,12 +3052,6 @@ "$ref": "#/definitions/response.Any" } }, - "404": { - "description": "定时任务不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, "500": { "description": "删除定时任务失败", "schema": { @@ -2903,7 +3090,7 @@ "data": { "type": "array", "items": { - "$ref": "#/definitions/task.TaskMeta" + "$ref": "#/definitions/contracts.TaskMetaDTO" } } } @@ -2955,7 +3142,7 @@ "data": { "type": "array", "items": { - "$ref": "#/definitions/model.Template" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.Template" } } } @@ -3007,7 +3194,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/template.CreateTemplateRequest" + "$ref": "#/definitions/model.CreateTemplateRequest" } } ], @@ -3093,7 +3280,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/model.Template" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.Template" } } } @@ -3157,7 +3344,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/template.UpdateTemplateRequest" + "$ref": "#/definitions/model.UpdateTemplateRequest" } } ], @@ -3173,7 +3360,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/model.Template" + "$ref": "#/definitions/Wavelet_plugins_domain_admin_model.Template" } } } @@ -3314,7 +3501,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/updater.Status" + "$ref": "#/definitions/model.UpdaterStatus" } } } @@ -3439,8 +3626,7 @@ }, { "type": "integer", - "format": "int64", - "description": "上传用户 ID", + "description": "上传用户 ID 过滤", "name": "user_id", "in": "query" } @@ -3464,14 +3650,8 @@ ] } }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", + "400": { + "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } @@ -3588,6 +3768,127 @@ } } }, + "/api/v1/admin/uploads/files": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "分页获取系统上传的文件列表,支持文件名关键词、业务类型、扩展名、上传用户ID过滤", + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "获取文件列表", + "parameters": [ + { + "type": "integer", + "description": "页码(默认 1)", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页数量(默认 20,最大 100)", + "name": "page_size", + "in": "query" + }, + { + "type": "string", + "description": "文件名关键词(模糊匹配)", + "name": "keyword", + "in": "query" + }, + { + "type": "string", + "description": "业务分类过滤", + "name": "type", + "in": "query" + }, + { + "type": "string", + "description": "扩展名过滤", + "name": "extension", + "in": "query" + }, + { + "type": "integer", + "description": "上传用户 ID 过滤", + "name": "user_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "查询成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/handler.listFilesResponse" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/admin/uploads/files/{id}": { + "delete": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "将指定 ID 的文件状态置为 deleted(软删除)", + "produces": [ + "application/json" + ], + "tags": [ + "admin" + ], + "summary": "删除文件", + "parameters": [ + { + "type": "string", + "description": "文件 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "文件不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, "/api/v1/admin/uploads/stats": { "get": { "security": [ @@ -3650,17 +3951,17 @@ "SessionCookie": [] } ], - "description": "返回数据库中所有已上传文件实际拥有的业务类型列表", + "description": "查询系统内所有不重复的上传业务分类标识(如 avatar, doc 等)", "produces": [ "application/json" ], "tags": [ "admin" ], - "summary": "获取文件业务类型列表", + "summary": "获取业务分类列表", "responses": { "200": { - "description": "业务类型列表", + "description": "查询成功", "schema": { "allOf": [ { @@ -3679,24 +3980,6 @@ } ] } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } } } } @@ -3708,7 +3991,7 @@ "SessionCookie": [] } ], - "description": "将文件状态置为 deleted(软删除),不会立即清理底层存储对象", + "description": "将指定 ID 的文件状态置为 deleted(软删除)", "produces": [ "application/json" ], @@ -3732,23 +4015,11 @@ "$ref": "#/definitions/response.Any" } }, - "403": { - "description": "无权操作", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, "404": { "description": "文件不存在", "schema": { "$ref": "#/definitions/response.Any" } - }, - "409": { - "description": "系统保留类型或存储只读", - "schema": { - "$ref": "#/definitions/response.Any" - } } } } @@ -3810,7 +4081,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/user.listUsersResponse" + "$ref": "#/definitions/model.ListUsersResponse" } } } @@ -3867,7 +4138,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/user.createUserRequest" + "$ref": "#/definitions/model.CreateUserRequest" } } ], @@ -3883,7 +4154,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/user.user" + "$ref": "#/definitions/model.UserResponse" } } } @@ -3953,7 +4224,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/user.user" + "$ref": "#/definitions/model.UserResponse" } } } @@ -4023,7 +4294,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/user.updateUserRequest" + "$ref": "#/definitions/model.UpdateUserRequest" } } ], @@ -4185,7 +4456,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/user.updateUserStatusRequest" + "$ref": "#/definitions/model.UpdateUserStatusRequest" } } ], @@ -12898,6 +13169,205 @@ } } }, + "/api/v1/message-gateway/bindings": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Returns the current user's bound messaging channels", + "produces": [ + "application/json" + ], + "tags": [ + "message-gateway" + ], + "summary": "List message gateway bindings", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.BindingDTO" + } + } + } + } + ] + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Binds the current user to a platform identity using a one-time pairing code", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "message-gateway" + ], + "summary": "Bind a messaging channel", + "parameters": [ + { + "description": "bind body", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.BindRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.BindingDTO" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "409": { + "description": "Conflict", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/message-gateway/bindings/{id}": { + "delete": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Removes a binding owned by the current user", + "produces": [ + "application/json" + ], + "tags": [ + "message-gateway" + ], + "summary": "Unbind a messaging channel", + "parameters": [ + { + "type": "integer", + "description": "binding id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/message-gateway/channels": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "Returns enabled system bots the current user can pair with", + "produces": [ + "application/json" + ], + "tags": [ + "message-gateway" + ], + "summary": "List enabled messaging channels", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.PublicChannelDTO" + } + } + } + } + ] + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, "/api/v1/oauth/callback": { "post": { "description": "接收前端传回的 state 和 code,完成 OAuth/OIDC 认证并建立会话。支持登录(login)和账号绑定(bind)两种场景。", @@ -12918,7 +13388,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/oauth.CallbackRequest" + "$ref": "#/definitions/auth.CallbackRequest" } } ], @@ -12934,7 +13404,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/oauth.OAuthCallbackResult" + "$ref": "#/definitions/auth.OAuthCallbackResult" } } } @@ -12981,22 +13451,7 @@ "200": { "description": "外部帐号列表", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.ExternalAccountView" - } - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "401": { @@ -13103,7 +13558,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/oauth.OAuthAuthorizeResponse" + "$ref": "#/definitions/auth.OAuthAuthorizeResponse" } } } @@ -13117,7 +13572,7 @@ } }, "500": { - "description": "Redis 异常 or 构造 URL 失败", + "description": "构造 URL 失败", "schema": { "$ref": "#/definitions/response.Any" } @@ -13192,7 +13647,7 @@ "data": { "type": "array", "items": { - "$ref": "#/definitions/oauth.AuthSourceView" + "$ref": "#/definitions/auth.AuthSourceView" } } } @@ -13210,7 +13665,7 @@ "SessionCookie": [] } ], - "description": "返回当前登录用户的基本信息及余额数据,需要登录。包括用户 ID、用户名、信任等级、各类余额信息等。", + "description": "返回当前登录用户的基本信息,需要登录。", "produces": [ "application/json" ], @@ -13230,7 +13685,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/oauth.BasicUserInfo" + "$ref": "#/definitions/auth.BasicUserInfo" } } } @@ -13283,7 +13738,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/oauth.OAuthAuthorizeResponse" + "$ref": "#/definitions/auth.OAuthAuthorizeResponse" } } } @@ -13297,7 +13752,7 @@ } }, "500": { - "description": "Redis 异常或构造 URL 失败", + "description": "构造 URL 失败", "schema": { "$ref": "#/definitions/response.Any" } @@ -13674,7 +14129,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/model.Upload" + "$ref": "#/definitions/models.Upload" } } } @@ -13693,12 +14148,6 @@ "$ref": "#/definitions/response.Any" } }, - "409": { - "description": "系统保留类型或存储只读", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, "500": { "description": "内部错误", "schema": { @@ -13831,7 +14280,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/model.Upload" + "$ref": "#/definitions/models.Upload" } } } @@ -13893,12 +14342,6 @@ "schema": { "$ref": "#/definitions/response.Any" } - }, - "409": { - "description": "系统保留类型或存储只读", - "schema": { - "$ref": "#/definitions/response.Any" - } } } } @@ -13910,7 +14353,7 @@ "SessionCookie": [] } ], - "description": "返回当前登录用户的基本信息及余额数据,需要登录。包括用户 ID、用户名、信任等级、各类余额信息等。", + "description": "返回当前登录用户的基本信息,需要登录。", "produces": [ "application/json" ], @@ -13930,7 +14373,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/oauth.BasicUserInfo" + "$ref": "#/definitions/auth.BasicUserInfo" } } } @@ -13975,7 +14418,7 @@ "data": { "type": "array", "items": { - "$ref": "#/definitions/model.AccessToken" + "$ref": "#/definitions/user.AccessToken" } } } @@ -13997,7 +14440,7 @@ "SessionCookie": [] } ], - "description": "为当前用户新建一个 API 访问令牌,仅在此接口返回一次明文令牌值,请妥善保存。可通过 is_admin 字段赋予令牌管理员权限(仅管理员用户可设置)。", + "description": "为当前用户新建一个 API 访问令牌,仅在此接口返回一次明文令牌值,请妥善保存。", "consumes": [ "application/json" ], @@ -14015,7 +14458,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/user.createTokenRequest" + "$ref": "#/definitions/user.createAccessTokenRequest" } } ], @@ -14023,19 +14466,7 @@ "200": { "description": "新建令牌成功", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/user.tokenResponse" - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "400": { @@ -14127,19 +14558,7 @@ "200": { "description": "令牌轮换成功", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/user.tokenResponse" - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "400": { @@ -14153,7 +14572,7 @@ }, "/api/v1/user/change-password": { "post": { - "description": "修改当前登录用户的密码。修改成功后,如果是首次明文登录的升级提示,则清除修改密码的提示状态。", + "description": "修改当前登录用户的密码。", "consumes": [ "application/json" ], @@ -14237,19 +14656,7 @@ "200": { "description": "登录成功,返回用户信息", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/oauth.BasicUserInfo" - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "400": { @@ -14312,7 +14719,7 @@ }, "/api/v1/user/profile": { "put": { - "description": "修改当前登录用户的昵称、邮箱、头像、简介、电话、性别、个人网站和所在地。", + "description": "修改当前登录用户的昵称、头像、简介、电话、性别、个人网站和所在地。", "consumes": [ "application/json" ], @@ -14338,23 +14745,11 @@ "200": { "description": "修改成功,返回更新后的用户信息", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/oauth.BasicUserInfo" - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "400": { - "description": "邮箱已被占用或参数错误", + "description": "参数错误", "schema": { "$ref": "#/definitions/response.Any" } @@ -14370,7 +14765,7 @@ }, "/api/v1/user/register": { "post": { - "description": "使用用户名和密码注册新账号,注册成功后自动登录并建立 Session。密码长度不能少于 8 位。", + "description": "使用用户名和密码注册新账号,注册成功后自动登录并建立 Session。", "consumes": [ "application/json" ], @@ -14396,19 +14791,7 @@ "200": { "description": "注册并登录成功,返回用户信息", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/oauth.BasicUserInfo" - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "400": { @@ -14433,31 +14816,19 @@ "SessionCookie": [] } ], - "description": "返回当前登录用户的基本信息及余额数据,需要登录。包括用户 ID、用户名、信任等级、各类余额信息等。", + "description": "返回当前登录用户的基本信息,需要登录。", "produces": [ "application/json" ], "tags": [ - "oauth" + "user" ], "summary": "获取当前登录用户信息", "responses": { "200": { "description": "用户信息", "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/oauth.BasicUserInfo" - } - } - } - ] + "$ref": "#/definitions/response.Any" } }, "401": { @@ -14482,17 +14853,6 @@ "user" ], "summary": "发送邮箱验证码", - "parameters": [ - { - "description": "发送验证码请求参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/user.sendEmailCodeRequest" - } - } - ], "responses": { "200": { "description": "发送成功", @@ -14590,79 +14950,6 @@ } }, "definitions": { - "Wavelet_OpenFlare_plugins_server_cap.ChallengeResponse": { - "type": "object", - "properties": { - "challenge": { - "type": "object", - "properties": { - "c": { - "type": "integer" - }, - "d": { - "type": "integer" - }, - "s": { - "type": "integer" - } - } - }, - "expires": { - "description": "ms timestamp", - "type": "integer" - }, - "token": { - "type": "string" - } - } - }, - "Wavelet_OpenFlare_plugins_server_cap.RedeemResponse": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "expires": { - "type": "integer" - }, - "success": { - "type": "boolean" - }, - "token": { - "type": "string" - } - } - }, - "Wavelet_OpenFlare_plugins_server_model_analytics.ClickHouseOperationalStats": { - "type": "object", - "properties": { - "active_parts": { - "type": "integer" - }, - "async_insert_bytes": { - "type": "integer" - }, - "async_insert_queue": { - "type": "integer" - }, - "batch_writers": { - "description": "BatchWriters reports in-process queue depth/drops/flush errors for CH writers.", - "type": "array", - "items": { - "$ref": "#/definitions/analytics.BatchWriterStats" - } - }, - "database": { - "type": "string" - }, - "pending_mutations": { - "type": "integer" - }, - "total_rows": { - "type": "integer" - } - } - }, "Wavelet_OpenFlare_share_protocol.ActiveConfigMeta": { "type": "object", "properties": { @@ -14900,6 +15187,157 @@ } } }, + "Wavelet_plugins_domain_admin_model.Schedule": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "cron": { + "type": "string" + }, + "id": { + "type": "string", + "example": "0" + }, + "is_active": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "payload": { + "type": "string" + }, + "task_type": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "Wavelet_plugins_domain_admin_model.SystemConfig": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "description": { + "type": "string" + }, + "key": { + "type": "string" + }, + "type": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "value": { + "type": "string" + }, + "visibility": { + "type": "integer" + } + } + }, + "Wavelet_plugins_domain_admin_model.TaskExecution": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "duration": { + "type": "integer" + }, + "error_message": { + "type": "string" + }, + "finished_at": { + "type": "string" + }, + "id": { + "type": "string", + "example": "0" + }, + "log": { + "type": "string" + }, + "max_retry": { + "type": "integer" + }, + "payload": { + "type": "string" + }, + "result": { + "type": "string" + }, + "retry_count": { + "type": "integer" + }, + "retryable": { + "type": "boolean" + }, + "started_at": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/model.TaskExecutionStatus" + }, + "task_id": { + "type": "string" + }, + "task_name": { + "type": "string" + }, + "task_type": { + "type": "string" + }, + "triggered_by": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "Wavelet_plugins_domain_admin_model.Template": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "description": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "is_system": { + "type": "boolean" + }, + "key": { + "type": "string" + }, + "name": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "type": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, "agent.ActiveConfigMeta": { "type": "object", "properties": { @@ -15159,29 +15597,6 @@ } } }, - "analytics.BatchWriterStats": { - "type": "object", - "properties": { - "cap": { - "type": "integer" - }, - "depth": { - "type": "integer" - }, - "drops": { - "type": "integer" - }, - "flush_errors": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "running": { - "type": "boolean" - } - } - }, "apply_log.CleanupInput": { "type": "object", "properties": { @@ -15230,14 +15645,11 @@ } } }, - "auth_source.AuthSourceRequest": { + "auth.AuthSourceView": { "type": "object", "properties": { - "client_id": { - "type": "string" - }, - "client_secret": { - "type": "string" + "client_secret_configured": { + "type": "boolean" }, "display_name": { "type": "string" @@ -15245,48 +15657,135 @@ "icon_url": { "type": "string" }, + "id": { + "type": "integer" + }, "is_active": { "type": "boolean" }, "name": { "type": "string" }, - "openid_discovery_url": { - "type": "string" - }, - "scopes": { - "type": "string" - }, "type": { "type": "string" } } }, - "auth_source.ToggleAuthSourceRequest": { + "auth.BasicUserInfo": { "type": "object", "properties": { - "is_active": { + "avatar_url": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "email": { + "type": "string" + }, + "gender": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "is_admin": { "type": "boolean" + }, + "location": { + "type": "string" + }, + "need_change_password": { + "type": "boolean" + }, + "nickname": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "username": { + "type": "string" + }, + "website": { + "type": "string" } } }, - "cache.updateCacheConfigRequest": { + "auth.CallbackRequest": { "type": "object", "required": [ - "max_size_mb", - "ttl_minutes" + "code", + "state" ], "properties": { - "lru_enabled": { + "code": { + "type": "string" + }, + "state": { + "type": "string" + } + } + }, + "auth.OAuthAuthorizeResponse": { + "type": "object", + "properties": { + "authorize_url": { + "type": "string" + } + } + }, + "auth.OAuthCallbackResult": { + "type": "object", + "properties": { + "status": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/auth.BasicUserInfo" + } + } + }, + "cap.ChallengeResponse": { + "type": "object", + "properties": { + "challenge": { + "type": "object", + "properties": { + "c": { + "type": "integer" + }, + "d": { + "type": "integer" + }, + "s": { + "type": "integer" + } + } + }, + "expires": { + "description": "ms timestamp", + "type": "integer" + }, + "token": { + "type": "string" + } + } + }, + "cap.RedeemResponse": { + "type": "object", + "properties": { + "error": { + "type": "string" + }, + "expires": { + "type": "integer" + }, + "success": { "type": "boolean" }, - "max_size_mb": { - "type": "integer", - "minimum": 1 - }, - "ttl_minutes": { - "type": "integer", - "minimum": 0 + "token": { + "type": "string" } } }, @@ -15685,6 +16184,119 @@ } } }, + "contracts.AuthSourceDTO": { + "type": "object", + "properties": { + "client_id": { + "type": "string" + }, + "client_secret": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "display_name": { + "type": "string" + }, + "icon_url": { + "type": "string" + }, + "id": { + "type": "string", + "example": "0" + }, + "is_active": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "openid_discovery_url": { + "type": "string" + }, + "scopes": { + "type": "string" + }, + "type": { + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "contracts.TaskMetaDTO": { + "type": "object", + "properties": { + "asynq_task": { + "type": "string" + }, + "category": { + "type": "string" + }, + "description": { + "type": "string" + }, + "display_name": { + "type": "string" + }, + "max_retry": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/contracts.TaskParamDTO" + } + }, + "queue": { + "type": "string" + }, + "retryable": { + "type": "boolean" + }, + "schedule": { + "type": "string" + }, + "supports_time": { + "type": "boolean" + }, + "timeout": { + "$ref": "#/definitions/time.Duration" + }, + "type": { + "type": "string" + } + } + }, + "contracts.TaskParamDTO": { + "type": "object", + "properties": { + "default": {}, + "description": { + "type": "string" + }, + "label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "placeholder": { + "type": "string" + }, + "required": { + "type": "boolean" + }, + "type": { + "type": "string" + } + } + }, "dashboard.Capacity": { "type": "object", "properties": { @@ -15832,69 +16444,7 @@ } } }, - "db_manage.DBOverviewResponse": { - "type": "object", - "properties": { - "connections": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "size": { - "type": "string" - }, - "table_count": { - "type": "integer" - }, - "type": { - "type": "string" - }, - "version": { - "type": "string" - } - } - }, - "db_manage.ExecuteSQLRequest": { - "type": "object", - "required": [ - "sql" - ], - "properties": { - "sql": { - "type": "string" - } - } - }, - "db_manage.ExecuteSQLResponse": { - "type": "object", - "properties": { - "affected_rows": { - "type": "integer" - }, - "columns": { - "type": "array", - "items": { - "type": "string" - } - }, - "execution_time_ms": { - "type": "integer" - }, - "results": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": {} - } - }, - "type": { - "description": "\"select\" 或 \"exec\"", - "type": "string" - } - } - }, - "diskcache.Status": { + "disk.Status": { "type": "object", "properties": { "base_path": { @@ -16073,7 +16623,7 @@ "items": { "type": "array", "items": { - "$ref": "#/definitions/model.Upload" + "$ref": "#/definitions/models.Upload" } }, "page": { @@ -16093,7 +16643,7 @@ "items": { "type": "array", "items": { - "$ref": "#/definitions/model.Upload" + "$ref": "#/definitions/models.Upload" } }, "page": { @@ -16150,7 +16700,7 @@ } } }, - "logs.accessLogItem": { + "model.AccessLogItem": { "type": "object", "properties": { "created_at": { @@ -16181,6 +16731,9 @@ "status": { "type": "integer" }, + "trace_id": { + "type": "string" + }, "user_agent": { "type": "string" }, @@ -16193,13 +16746,13 @@ } } }, - "logs.accessLogsResponse": { + "model.AccessLogsResponse": { "type": "object", "properties": { "list": { "type": "array", "items": { - "$ref": "#/definitions/logs.accessLogItem" + "$ref": "#/definitions/model.AccessLogItem" } }, "total": { @@ -16207,113 +16760,6 @@ } } }, - "logs.browserItem": { - "type": "object", - "properties": { - "browser": { - "type": "string" - }, - "count": { - "type": "integer" - } - } - }, - "logs.logsAnalyticsResponse": { - "type": "object", - "properties": { - "browsers": { - "type": "array", - "items": { - "$ref": "#/definitions/logs.browserItem" - } - }, - "top_users": { - "type": "array", - "items": { - "$ref": "#/definitions/logs.topUserItem" - } - }, - "trend": { - "type": "array", - "items": { - "$ref": "#/definitions/logs.trendItem" - } - } - } - }, - "logs.logsResponse": { - "type": "object", - "properties": { - "has_more": { - "type": "boolean" - }, - "lines": { - "type": "array", - "items": { - "$ref": "#/definitions/logger.LogEntry" - } - }, - "next_cursor": { - "description": "用于加载更早日志的 cursor", - "type": "integer" - } - } - }, - "logs.topUserItem": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "nickname": { - "type": "string" - }, - "user_id": { - "type": "string", - "example": "0" - }, - "username": { - "type": "string" - } - } - }, - "logs.trendItem": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "date": { - "type": "string" - } - } - }, - "model.AccessToken": { - "type": "object", - "properties": { - "created_at": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "is_admin": { - "type": "boolean" - }, - "masked_token": { - "type": "string" - }, - "name": { - "type": "string" - }, - "updated_at": { - "type": "string" - }, - "user_id": { - "type": "integer" - } - } - }, "model.AcmeAccount": { "type": "object", "properties": { @@ -16334,44 +16780,91 @@ } } }, - "model.AuthSource": { + "model.BindRequest": { "type": "object", "properties": { - "client_id": { + "channel_id": { "type": "string" }, - "client_secret_configured": { - "type": "boolean" + "code": { + "type": "string" + } + } + }, + "model.BindingDTO": { + "type": "object", + "properties": { + "channel_id": { + "type": "string", + "example": "0" + }, + "channel_name": { + "type": "string" + }, + "channel_type": { + "type": "string" }, "created_at": { "type": "string" }, - "display_name": { + "id": { + "type": "string", + "example": "0" + }, + "platform_user_id": { "type": "string" }, - "icon_url": { + "user_id": { + "type": "string", + "example": "0" + } + } + }, + "model.BrowserItem": { + "type": "object", + "properties": { + "browser": { "type": "string" }, + "count": { + "type": "integer" + } + } + }, + "model.ChannelDTO": { + "type": "object", + "properties": { + "credentials": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "enabled": { + "type": "boolean" + }, + "extra": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, "id": { - "type": "integer" - }, - "is_active": { - "type": "boolean" + "type": "string", + "example": "0" }, "name": { "type": "string" }, - "openid_discovery_url": { - "type": "string" + "owner_id": { + "type": "string", + "example": "0" }, - "scopes": { + "owner_scope": { "type": "string" }, "type": { "type": "string" - }, - "updated_at": { - "type": "string" } } }, @@ -16433,6 +16926,243 @@ } } }, + "model.CreateChannelRequest": { + "type": "object", + "properties": { + "credentials": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "enabled": { + "type": "boolean" + }, + "extra": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "model.CreatePushChannelRequest": { + "type": "object", + "required": [ + "name", + "type" + ], + "properties": { + "description": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "other": { + "type": "string" + }, + "token": { + "type": "string" + }, + "type": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, + "model.CreatePushEventRequest": { + "type": "object", + "properties": { + "channels": { + "type": "array", + "items": { + "type": "string" + } + }, + "enabled": { + "type": "boolean" + }, + "event_key": { + "type": "string" + }, + "targets": { + "type": "array", + "items": { + "type": "string" + } + }, + "task_type": { + "type": "string" + }, + "template": { + "type": "string" + } + } + }, + "model.CreateScheduleRequest": { + "type": "object", + "required": [ + "cron", + "is_active", + "name", + "task_type" + ], + "properties": { + "cron": { + "type": "string" + }, + "is_active": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "payload": { + "type": "string" + }, + "task_type": { + "type": "string" + } + } + }, + "model.CreateSystemConfigRequest": { + "type": "object", + "required": [ + "key", + "type", + "value" + ], + "properties": { + "description": { + "type": "string", + "maxLength": 255 + }, + "key": { + "type": "string", + "maxLength": 64 + }, + "type": { + "type": "string", + "enum": [ + "system", + "business" + ] + }, + "value": { + "type": "string" + }, + "visibility": { + "type": "integer", + "enum": [ + 0, + 1 + ] + } + } + }, + "model.CreateTemplateRequest": { + "type": "object", + "required": [ + "content", + "key", + "name", + "type" + ], + "properties": { + "content": { + "type": "string" + }, + "description": { + "type": "string", + "maxLength": 255 + }, + "key": { + "type": "string", + "maxLength": 80 + }, + "name": { + "type": "string", + "maxLength": 100 + }, + "subject": { + "type": "string", + "maxLength": 255 + }, + "type": { + "type": "string", + "maxLength": 20 + } + } + }, + "model.CreateUserRequest": { + "type": "object", + "required": [ + "email", + "password", + "username" + ], + "properties": { + "email": { + "type": "string", + "maxLength": 255 + }, + "is_active": { + "type": "boolean" + }, + "is_admin": { + "type": "boolean" + }, + "nickname": { + "type": "string", + "maxLength": 64 + }, + "password": { + "type": "string", + "maxLength": 64, + "minLength": 8 + }, + "username": { + "type": "string", + "maxLength": 64, + "minLength": 3 + } + } + }, + "model.DBOverviewResponse": { + "type": "object", + "properties": { + "connections": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "size": { + "type": "string" + }, + "table_count": { + "type": "integer" + }, + "type": { + "type": "string" + }, + "version": { + "type": "string" + } + } + }, "model.DNSAccount": { "type": "object", "properties": { @@ -16453,31 +17183,184 @@ } } }, - "model.ExternalAccountView": { + "model.DatabaseInfoResponse": { "type": "object", "properties": { - "auth_source_id": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "version": { + "type": "string" + } + } + }, + "model.Definition": { + "type": "object", + "properties": { + "fields": { + "type": "array", + "items": { + "$ref": "#/definitions/model.Field" + } + }, + "type": { + "type": "string" + } + } + }, + "model.DispatchTaskRequest": { + "type": "object", + "required": [ + "task_type" + ], + "properties": { + "end_time": { + "type": "string" + }, + "payload": { + "type": "string" + }, + "start_time": { + "type": "string" + }, + "task_type": { + "type": "string" + }, + "user_id": { + "type": "integer" + } + } + }, + "model.ExecuteSQLRequest": { + "type": "object", + "required": [ + "sql" + ], + "properties": { + "sql": { + "type": "string" + } + } + }, + "model.ExecuteSQLResponse": { + "type": "object", + "properties": { + "affected_rows": { "type": "integer" }, - "auth_source_label": { + "columns": { + "type": "array", + "items": { + "type": "string" + } + }, + "execution_time_ms": { + "type": "integer" + }, + "results": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "type": { + "description": "\"select\" 或 \"exec\"", + "type": "string" + } + } + }, + "model.Field": { + "type": "object", + "properties": { + "key": { "type": "string" }, - "auth_source_name": { + "required": { + "type": "boolean" + }, + "type": { + "type": "string" + } + } + }, + "model.ListUsersResponse": { + "type": "object", + "properties": { + "total": { + "type": "integer" + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/model.UserResponse" + } + } + } + }, + "model.LogDatabaseStatus": { + "type": "object", + "properties": { + "active_database": { "type": "string" }, - "auth_source_type": { + "available_targets": { + "type": "array", + "items": { + "type": "string" + } + }, + "migration": { "type": "string" }, - "created_at": { - "type": "string" + "retention_days": { + "type": "object", + "additionalProperties": { + "type": "integer" + } + } + } + }, + "model.LogsAnalyticsResponse": { + "type": "object", + "properties": { + "browsers": { + "type": "array", + "items": { + "$ref": "#/definitions/model.BrowserItem" + } }, - "email": { - "type": "string" + "top_users": { + "type": "array", + "items": { + "$ref": "#/definitions/model.TopUserItem" + } }, - "external_username": { - "type": "string" + "trend": { + "type": "array", + "items": { + "$ref": "#/definitions/model.TrendItem" + } + } + } + }, + "model.LogsResponse": { + "type": "object", + "properties": { + "has_more": { + "type": "boolean" }, - "id": { + "lines": { + "type": "array", + "items": { + "$ref": "#/definitions/logger.LogEntry" + } + }, + "next_cursor": { + "description": "用于加载更早日志的 cursor", "type": "integer" } } @@ -16726,6 +17609,21 @@ } } }, + "model.PublicChannelDTO": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "0" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, "model.PushChannel": { "type": "object", "properties": { @@ -16733,37 +17631,30 @@ "type": "string" }, "description": { - "description": "备注", "type": "string" }, "enabled": { - "description": "通道是否启用", "type": "boolean" }, "id": { "type": "integer" }, "name": { - "description": "通道名称,仅英文字母和下划线,唯一", "type": "string" }, "other": { - "description": "请求体/SMTP 密码等", "type": "string" }, "token": { - "description": "鉴权令牌或发信用户名等", "type": "string" }, "type": { - "description": "通道类型:custom, lark, email", "type": "string" }, "updated_at": { "type": "string" }, "url": { - "description": "请求地址,HTTPS 协议或 SMTP 地址", "type": "string" } } @@ -16772,7 +17663,6 @@ "type": "object", "properties": { "channels": { - "description": "推送渠道列表,如 [\"lark\"]", "type": "array", "items": { "type": "string" @@ -16782,33 +17672,27 @@ "type": "string" }, "enabled": { - "description": "是否启用", "type": "boolean" }, "event_key": { - "description": "如 admin_login", "type": "string" }, "id": { "type": "integer" }, "name": { - "description": "如 管理员登录", "type": "string" }, "targets": { - "description": "推送目标用户/邮箱列表", "type": "array", "items": { "type": "string" } }, "task_type": { - "description": "关联的异步任务类型", "type": "string" }, "template": { - "description": "消息模板 JSON", "type": "string" }, "updated_at": { @@ -16816,95 +17700,92 @@ } } }, - "model.PushHistory": { + "model.SystemStatusResponse": { "type": "object", "properties": { - "channel": { + "alloc": { "type": "string" }, - "content": { + "buck_hash_sys": { "type": "string" }, - "created_at": { - "type": "string" - }, - "error_msg": { - "type": "string" - }, - "event_key": { - "type": "string" - }, - "id": { + "frees": { "type": "integer" }, - "level": { + "gc_sys": { "type": "string" }, - "status": { - "description": "success / failed", + "heap_alloc": { "type": "string" }, - "target": { + "heap_idle": { "type": "string" }, - "title": { - "type": "string" - } - } - }, - "model.Schedule": { - "type": "object", - "properties": { - "created_at": { + "heap_inuse": { "type": "string" }, - "cron": { - "type": "string" - }, - "id": { - "type": "string", - "example": "0" - }, - "is_active": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "payload": { - "type": "string" - }, - "task_type": { - "type": "string" - }, - "updated_at": { - "type": "string" - } - } - }, - "model.SystemConfig": { - "type": "object", - "properties": { - "created_at": { - "type": "string" - }, - "description": { - "type": "string" - }, - "key": { - "type": "string" - }, - "type": { - "type": "string" - }, - "updated_at": { - "type": "string" - }, - "value": { - "type": "string" - }, - "visibility": { + "heap_objects": { "type": "integer" + }, + "heap_released": { + "type": "string" + }, + "heap_sys": { + "type": "string" + }, + "last_gc_time": { + "type": "string" + }, + "last_pause": { + "type": "string" + }, + "lookups": { + "type": "integer" + }, + "mallocs": { + "type": "integer" + }, + "mcache_inuse": { + "type": "string" + }, + "mcache_sys": { + "type": "string" + }, + "mspan_inuse": { + "type": "string" + }, + "mspan_sys": { + "type": "string" + }, + "next_gc": { + "type": "string" + }, + "num_gc": { + "type": "integer" + }, + "num_goroutine": { + "type": "integer" + }, + "other_sys": { + "type": "string" + }, + "pause_total_ns": { + "type": "string" + }, + "stack_inuse": { + "type": "string" + }, + "stack_sys": { + "type": "string" + }, + "sys": { + "type": "string" + }, + "total_alloc": { + "type": "string" + }, + "uptime": { + "type": "string" } } }, @@ -16973,66 +17854,6 @@ } } }, - "model.TaskExecution": { - "type": "object", - "properties": { - "created_at": { - "type": "string" - }, - "duration": { - "type": "integer" - }, - "error_message": { - "type": "string" - }, - "finished_at": { - "type": "string" - }, - "id": { - "type": "string", - "example": "0" - }, - "log": { - "type": "string" - }, - "max_retry": { - "type": "integer" - }, - "payload": { - "type": "string" - }, - "result": { - "type": "string" - }, - "retry_count": { - "type": "integer" - }, - "retryable": { - "type": "boolean" - }, - "started_at": { - "type": "string" - }, - "status": { - "$ref": "#/definitions/model.TaskExecutionStatus" - }, - "task_id": { - "type": "string" - }, - "task_name": { - "type": "string" - }, - "task_type": { - "type": "string" - }, - "triggered_by": { - "type": "string" - }, - "updated_at": { - "type": "string" - } - } - }, "model.TaskExecutionStatus": { "type": "string", "enum": [ @@ -17048,167 +17869,414 @@ "TaskExecutionStatusFailed" ] }, - "model.Template": { + "model.TestPushChannelRequest": { "type": "object", "properties": { - "content": { - "type": "string" - }, - "created_at": { - "type": "string" - }, - "description": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "is_system": { - "type": "boolean" - }, - "key": { - "type": "string" - }, "name": { "type": "string" }, - "subject": { + "other": { + "type": "string" + }, + "target": { + "type": "string" + }, + "token": { "type": "string" }, "type": { "type": "string" }, - "updated_at": { + "url": { "type": "string" } } }, - "model.Upload": { + "model.TestPushRequest": { + "type": "object", + "required": [ + "config" + ], + "properties": { + "config": { + "$ref": "#/definitions/push.Config" + }, + "target": { + "type": "string" + } + } + }, + "model.TestSMTPRequest": { + "type": "object", + "required": [ + "smtp_host", + "smtp_password", + "smtp_port", + "smtp_username", + "to" + ], + "properties": { + "smtp_host": { + "type": "string", + "maxLength": 255 + }, + "smtp_password": { + "type": "string", + "maxLength": 255 + }, + "smtp_port": { + "type": "integer" + }, + "smtp_username": { + "type": "string", + "maxLength": 255 + }, + "to": { + "type": "string" + } + } + }, + "model.TestSMTPResponse": { "type": "object", "properties": { - "access_mode": { + "error": { + "type": "string" + }, + "log": { + "type": "string" + }, + "success": { + "type": "boolean" + } + } + }, + "model.TopUserItem": { + "type": "object", + "properties": { + "count": { "type": "integer" }, - "created_at": { - "type": "string" - }, - "extension": { - "description": "文件后缀名 (不含点,如 png, pdf)", - "type": "string" - }, - "file_name": { - "description": "原始文件名 (例如: image.png)", - "type": "string" - }, - "file_path": { - "description": "文件相对路径 / S3 Key", - "type": "string" - }, - "file_size": { - "description": "文件大小(字节)", - "type": "integer" - }, - "hash": { - "description": "文件哈希 (SHA-256/MD5,可用于排重)", - "type": "string" - }, - "id": { - "type": "string", - "example": "0" - }, - "metadata": { - "description": "业务扩展元数据", - "allOf": [ - { - "$ref": "#/definitions/model.UploadMetadata" - } - ] - }, - "mime_type": { - "description": "媒体类型 (MIME, 如 image/png)", - "type": "string" - }, - "status": { - "description": "状态", - "allOf": [ - { - "$ref": "#/definitions/model.UploadStatus" - } - ] - }, - "type": { - "description": "业务标识类型 (如 avatar, doc, attachment)", - "type": "string" - }, - "updated_at": { + "nickname": { "type": "string" }, "user_id": { "type": "string", "example": "0" + }, + "username": { + "type": "string" } } }, - "model.UploadMetadata": { + "model.TrendItem": { "type": "object", "properties": { - "bucket": { - "description": "存储桶名称 (适用于 S3 等)", - "type": "string" - }, - "client_ip": { - "description": "上传者 IP", - "type": "string" - }, - "duration": { - "description": "音视频时长 (s)", - "type": "number" - }, - "extra": { - "description": "其它任意业务自定义元数据", - "type": "object", - "additionalProperties": {} - }, - "height": { - "description": "图像/视频高度 (px)", + "count": { "type": "integer" }, - "original_mime": { - "description": "原始 MIME 类型", + "date": { "type": "string" - }, - "user_agent": { - "description": "上传者的 UA", - "type": "string" - }, - "width": { - "description": "图像/视频宽度 (px)", - "type": "integer" } } }, - "model.UploadStatus": { - "type": "string", - "enum": [ - "pending", - "used", - "deleted" + "model.UpdateCacheConfigRequest": { + "type": "object", + "required": [ + "max_size_mb", + "ttl_minutes" ], - "x-enum-comments": { - "UploadStatusDeleted": "已删除", - "UploadStatusPending": "待使用", - "UploadStatusUsed": "已使用" - }, - "x-enum-descriptions": [ - "待使用", - "已使用", - "已删除" + "properties": { + "lru_enabled": { + "type": "boolean" + }, + "max_size_mb": { + "type": "integer", + "minimum": 1 + }, + "ttl_minutes": { + "type": "integer", + "minimum": 0 + } + } + }, + "model.UpdateChannelRequest": { + "type": "object", + "properties": { + "credentials": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "enabled": { + "type": "boolean" + }, + "extra": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "type": "string" + } + } + }, + "model.UpdatePushChannelRequest": { + "type": "object", + "required": [ + "type" ], - "x-enum-varnames": [ - "UploadStatusPending", - "UploadStatusUsed", - "UploadStatusDeleted" - ] + "properties": { + "description": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "other": { + "type": "string" + }, + "token": { + "type": "string" + }, + "type": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, + "model.UpdatePushEventRequest": { + "type": "object", + "required": [ + "template" + ], + "properties": { + "channels": { + "type": "array", + "items": { + "type": "string" + } + }, + "enabled": { + "type": "boolean" + }, + "targets": { + "type": "array", + "items": { + "type": "string" + } + }, + "template": { + "type": "string" + } + } + }, + "model.UpdateScheduleRequest": { + "type": "object", + "required": [ + "cron", + "is_active", + "name", + "task_type" + ], + "properties": { + "cron": { + "type": "string" + }, + "is_active": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "payload": { + "type": "string" + }, + "task_type": { + "type": "string" + } + } + }, + "model.UpdateSystemConfigRequest": { + "type": "object", + "required": [ + "value" + ], + "properties": { + "description": { + "type": "string", + "maxLength": 255 + }, + "value": { + "type": "string" + }, + "visibility": { + "type": "integer", + "enum": [ + 0, + 1 + ] + } + } + }, + "model.UpdateTemplateRequest": { + "type": "object", + "required": [ + "content", + "name", + "type" + ], + "properties": { + "content": { + "type": "string" + }, + "description": { + "type": "string", + "maxLength": 255 + }, + "name": { + "type": "string", + "maxLength": 100 + }, + "subject": { + "type": "string", + "maxLength": 255 + }, + "type": { + "type": "string", + "maxLength": 20 + } + } + }, + "model.UpdateUserRequest": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "email": { + "type": "string", + "maxLength": 255 + }, + "is_admin": { + "type": "boolean" + }, + "nickname": { + "type": "string", + "maxLength": 64 + }, + "password": { + "type": "string", + "maxLength": 64, + "minLength": 8 + } + } + }, + "model.UpdateUserStatusRequest": { + "type": "object", + "properties": { + "is_active": { + "type": "boolean" + } + } + }, + "model.UpdaterStatus": { + "type": "object", + "properties": { + "asset_name": { + "type": "string" + }, + "build_time": { + "type": "string" + }, + "can_upgrade": { + "type": "boolean" + }, + "current_version": { + "type": "string" + }, + "latest_version": { + "type": "string" + }, + "platform": { + "type": "string" + }, + "prerelease": { + "type": "boolean" + }, + "published_at": { + "type": "string" + }, + "release_name": { + "type": "string" + }, + "release_notes": { + "type": "string" + }, + "release_url": { + "type": "string" + }, + "update_available": { + "type": "boolean" + }, + "upstream_repository": { + "type": "string" + } + } + }, + "model.UserResponse": { + "type": "object", + "properties": { + "avatar_url": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "email": { + "type": "string" + }, + "gender": { + "type": "string" + }, + "id": { + "type": "string", + "example": "0" + }, + "is_active": { + "type": "boolean" + }, + "is_admin": { + "type": "boolean" + }, + "last_login_at": { + "type": "string" + }, + "location": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "username": { + "type": "string" + }, + "website": { + "type": "string" + } + } }, "model.Zone": { "type": "object", @@ -17253,6 +18321,108 @@ } } }, + "models.Upload": { + "type": "object", + "properties": { + "access_mode": { + "type": "integer" + }, + "created_at": { + "type": "string" + }, + "extension": { + "type": "string" + }, + "file_name": { + "type": "string" + }, + "file_path": { + "type": "string" + }, + "file_size": { + "type": "integer" + }, + "hash": { + "type": "string" + }, + "id": { + "type": "string", + "example": "0" + }, + "metadata": { + "$ref": "#/definitions/models.UploadMetadata" + }, + "mime_type": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/models.UploadStatus" + }, + "type": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "user_id": { + "type": "string", + "example": "0" + } + } + }, + "models.UploadMetadata": { + "type": "object", + "properties": { + "bucket": { + "type": "string" + }, + "client_ip": { + "type": "string" + }, + "duration": { + "type": "number" + }, + "extra": { + "type": "object", + "additionalProperties": {} + }, + "height": { + "type": "integer" + }, + "original_mime": { + "type": "string" + }, + "user_agent": { + "type": "string" + }, + "width": { + "type": "integer" + } + } + }, + "models.UploadStatus": { + "type": "string", + "enum": [ + "pending", + "used", + "deleted" + ], + "x-enum-comments": { + "UploadStatusDeleted": "已删除", + "UploadStatusPending": "待使用", + "UploadStatusUsed": "已使用" + }, + "x-enum-descriptions": [ + "待使用", + "已使用", + "已删除" + ], + "x-enum-varnames": [ + "UploadStatusPending", + "UploadStatusUsed", + "UploadStatusDeleted" + ] + }, "node.AgentReleaseInfo": { "type": "object", "properties": { @@ -17526,107 +18696,6 @@ } } }, - "oauth.AuthSourceView": { - "type": "object", - "properties": { - "client_secret_configured": { - "type": "boolean" - }, - "display_name": { - "type": "string" - }, - "icon_url": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "is_active": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, - "oauth.BasicUserInfo": { - "type": "object", - "properties": { - "avatar_url": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "email": { - "type": "string" - }, - "gender": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "is_admin": { - "type": "boolean" - }, - "location": { - "type": "string" - }, - "need_change_password": { - "type": "boolean" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "username": { - "type": "string" - }, - "website": { - "type": "string" - } - } - }, - "oauth.CallbackRequest": { - "type": "object", - "required": [ - "code", - "state" - ], - "properties": { - "code": { - "type": "string" - }, - "state": { - "type": "string" - } - } - }, - "oauth.OAuthAuthorizeResponse": { - "type": "object", - "properties": { - "authorize_url": { - "type": "string" - } - } - }, - "oauth.OAuthCallbackResult": { - "type": "object", - "properties": { - "status": { - "type": "string" - }, - "user": { - "$ref": "#/definitions/oauth.BasicUserInfo" - } - } - }, "observability.AccessLogCleanupInput": { "type": "object", "properties": { @@ -19441,257 +20510,6 @@ } } }, - "push.CreateChannelRequest": { - "type": "object", - "required": [ - "name", - "type" - ], - "properties": { - "description": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "other": { - "type": "string" - }, - "token": { - "type": "string" - }, - "type": { - "type": "string" - }, - "url": { - "type": "string" - } - } - }, - "push.CreateEventRequest": { - "type": "object", - "properties": { - "channels": { - "type": "array", - "items": { - "type": "string" - } - }, - "enabled": { - "type": "boolean" - }, - "event_key": { - "type": "string" - }, - "targets": { - "type": "array", - "items": { - "type": "string" - } - }, - "task_type": { - "description": "关联的异步任务类型", - "type": "string" - }, - "template": { - "type": "string" - } - } - }, - "push.Definition": { - "type": "object", - "properties": { - "description": { - "description": "short description", - "type": "string" - }, - "fields": { - "description": "form fields", - "type": "array", - "items": { - "$ref": "#/definitions/push.Field" - } - }, - "name": { - "description": "display name", - "type": "string" - }, - "type": { - "description": "channel type (e.g., custom, lark, email)", - "type": "string" - } - } - }, - "push.EventMetadata": { - "type": "object", - "properties": { - "default_template": { - "$ref": "#/definitions/push.NotificationMessage" - }, - "description": { - "type": "string" - }, - "key": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "push.Field": { - "type": "object", - "properties": { - "description": { - "description": "field explanation/help text", - "type": "string" - }, - "key": { - "description": "unique key for the field (e.g. url, token, other)", - "type": "string" - }, - "label": { - "description": "human readable label (e.g. \"Webhook 地址\")", - "type": "string" - }, - "placeholder": { - "description": "input placeholder", - "type": "string" - }, - "required": { - "description": "whether this field is required", - "type": "boolean" - }, - "type": { - "description": "input type: \"text\" | \"password\" | \"textarea\"", - "type": "string" - } - } - }, - "push.NotificationMessage": { - "type": "object", - "properties": { - "content": { - "type": "string" - }, - "ext": { - "type": "object", - "additionalProperties": {} - }, - "level": { - "type": "string" - }, - "title": { - "type": "string" - } - } - }, - "push.TestChannelRequest": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "other": { - "type": "string" - }, - "target": { - "type": "string" - }, - "token": { - "type": "string" - }, - "type": { - "type": "string" - }, - "url": { - "type": "string" - } - } - }, - "push.TestPushRequest": { - "type": "object", - "required": [ - "config" - ], - "properties": { - "config": { - "$ref": "#/definitions/push.Config" - }, - "target": { - "type": "string" - } - } - }, - "push.UpdateChannelRequest": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "description": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "other": { - "type": "string" - }, - "token": { - "type": "string" - }, - "type": { - "type": "string" - }, - "url": { - "type": "string" - } - } - }, - "push.UpdateEventRequest": { - "type": "object", - "required": [ - "template" - ], - "properties": { - "channels": { - "type": "array", - "items": { - "type": "string" - } - }, - "enabled": { - "type": "boolean" - }, - "targets": { - "type": "array", - "items": { - "type": "string" - } - }, - "template": { - "type": "string" - } - } - }, - "push.pushHistoriesResponse": { - "type": "object", - "properties": { - "results": { - "type": "array", - "items": { - "$ref": "#/definitions/model.PushHistory" - } - }, - "total": { - "type": "integer" - } - } - }, "relay.HeartbeatPayload": { "type": "object", "properties": { @@ -19760,439 +20578,29 @@ } } }, - "status.DatabaseInfoResponse": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "version": { - "type": "string" - } - } - }, - "status.LogDatabaseStatus": { - "type": "object", - "properties": { - "active_database": { - "type": "string" - }, - "available_targets": { - "type": "array", - "items": { - "type": "string" - } - }, - "clickhouse": { - "$ref": "#/definitions/Wavelet_OpenFlare_plugins_server_model_analytics.ClickHouseOperationalStats" - }, - "migration": { - "description": "idle | migrating", - "type": "string" - }, - "retention_days": { - "type": "object", - "additionalProperties": { - "type": "integer" - } - } - } - }, - "status.SystemStatusResponse": { - "type": "object", - "properties": { - "alloc": { - "type": "string" - }, - "buck_hash_sys": { - "type": "string" - }, - "frees": { - "type": "integer" - }, - "gc_sys": { - "type": "string" - }, - "heap_alloc": { - "type": "string" - }, - "heap_idle": { - "type": "string" - }, - "heap_inuse": { - "type": "string" - }, - "heap_objects": { - "type": "integer" - }, - "heap_released": { - "type": "string" - }, - "heap_sys": { - "type": "string" - }, - "last_gc_time": { - "type": "string" - }, - "last_pause": { - "type": "string" - }, - "lookups": { - "type": "integer" - }, - "mallocs": { - "type": "integer" - }, - "mcache_inuse": { - "type": "string" - }, - "mcache_sys": { - "type": "string" - }, - "mspan_inuse": { - "type": "string" - }, - "mspan_sys": { - "type": "string" - }, - "next_gc": { - "type": "string" - }, - "num_gc": { - "type": "integer" - }, - "num_goroutine": { - "type": "integer" - }, - "other_sys": { - "type": "string" - }, - "pause_total_ns": { - "type": "string" - }, - "stack_inuse": { - "type": "string" - }, - "stack_sys": { - "type": "string" - }, - "sys": { - "type": "string" - }, - "total_alloc": { - "type": "string" - }, - "uptime": { - "type": "string" - } - } - }, - "system_config.CreateSystemConfigRequest": { - "type": "object", - "required": [ - "key", - "type", - "value" + "time.Duration": { + "type": "integer", + "format": "int64", + "enum": [ + -9223372036854775808, + 9223372036854775807, + 1, + 1000, + 1000000, + 1000000000, + 60000000000, + 3600000000000 ], - "properties": { - "description": { - "type": "string", - "maxLength": 255 - }, - "key": { - "type": "string", - "maxLength": 64 - }, - "type": { - "type": "string", - "enum": [ - "system", - "business" - ] - }, - "value": { - "type": "string" - }, - "visibility": { - "type": "integer", - "enum": [ - 0, - 1 - ] - } - } - }, - "system_config.TestSMTPRequest": { - "type": "object", - "required": [ - "smtp_host", - "smtp_password", - "smtp_port", - "smtp_username", - "to" - ], - "properties": { - "smtp_host": { - "type": "string", - "maxLength": 255 - }, - "smtp_password": { - "type": "string", - "maxLength": 255 - }, - "smtp_port": { - "type": "integer" - }, - "smtp_username": { - "type": "string", - "maxLength": 255 - }, - "to": { - "type": "string" - } - } - }, - "system_config.TestSMTPResponse": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "log": { - "type": "string" - }, - "success": { - "type": "boolean" - } - } - }, - "system_config.UpdateSystemConfigRequest": { - "type": "object", - "required": [ - "value" - ], - "properties": { - "description": { - "type": "string", - "maxLength": 255 - }, - "value": { - "type": "string" - }, - "visibility": { - "type": "integer", - "enum": [ - 0, - 1 - ] - } - } - }, - "task.CreateScheduleRequest": { - "type": "object", - "required": [ - "cron", - "is_active", - "name", - "task_type" - ], - "properties": { - "cron": { - "type": "string" - }, - "is_active": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "payload": { - "type": "string" - }, - "task_type": { - "type": "string" - } - } - }, - "task.DispatchTaskRequest": { - "type": "object", - "required": [ - "task_type" - ], - "properties": { - "end_time": { - "type": "string" - }, - "payload": { - "type": "string" - }, - "start_time": { - "type": "string" - }, - "task_type": { - "type": "string" - }, - "user_id": { - "type": "integer" - } - } - }, - "task.TaskMeta": { - "type": "object", - "properties": { - "asynq_task": { - "type": "string" - }, - "description": { - "type": "string" - }, - "max_retry": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "params": { - "type": "array", - "items": { - "$ref": "#/definitions/task.TaskParam" - } - }, - "queue": { - "type": "string" - }, - "retryable": { - "description": "是否支持手动重试", - "type": "boolean" - }, - "supports_time": { - "type": "boolean" - }, - "type": { - "type": "string" - } - } - }, - "task.TaskParam": { - "type": "object", - "properties": { - "description": { - "description": "描述", - "type": "string" - }, - "label": { - "description": "显示名称", - "type": "string" - }, - "name": { - "description": "参数键名", - "type": "string" - }, - "placeholder": { - "description": "占位符", - "type": "string" - }, - "required": { - "description": "是否必填", - "type": "boolean" - }, - "type": { - "description": "类型:string, text, number, boolean", - "type": "string" - } - } - }, - "task.UpdateScheduleRequest": { - "type": "object", - "required": [ - "cron", - "is_active", - "name", - "task_type" - ], - "properties": { - "cron": { - "type": "string" - }, - "is_active": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "payload": { - "type": "string" - }, - "task_type": { - "type": "string" - } - } - }, - "template.CreateTemplateRequest": { - "type": "object", - "required": [ - "content", - "key", - "name", - "type" - ], - "properties": { - "content": { - "type": "string" - }, - "description": { - "type": "string", - "maxLength": 255 - }, - "key": { - "type": "string", - "maxLength": 80 - }, - "name": { - "type": "string", - "maxLength": 100 - }, - "subject": { - "type": "string", - "maxLength": 255 - }, - "type": { - "type": "string", - "maxLength": 20 - } - } - }, - "template.UpdateTemplateRequest": { - "type": "object", - "required": [ - "content", - "name", - "type" - ], - "properties": { - "content": { - "type": "string" - }, - "description": { - "type": "string", - "maxLength": 255 - }, - "name": { - "type": "string", - "maxLength": 100 - }, - "subject": { - "type": "string", - "maxLength": 255 - }, - "type": { - "type": "string", - "maxLength": 20 - } - } + "x-enum-varnames": [ + "minDuration", + "maxDuration", + "Nanosecond", + "Microsecond", + "Millisecond", + "Second", + "Minute", + "Hour" + ] }, "tls.ApplyInput": { "type": "object", @@ -20369,8 +20777,38 @@ } } }, + "user.AccessToken": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "is_admin": { + "type": "boolean" + }, + "masked_token": { + "type": "string" + }, + "name": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "user_id": { + "type": "integer" + } + } + }, "user.changePasswordRequest": { "type": "object", + "required": [ + "new_password", + "old_password" + ], "properties": { "new_password": { "type": "string" @@ -20380,9 +20818,15 @@ } } }, - "user.createTokenRequest": { + "user.createAccessTokenRequest": { "type": "object", + "required": [ + "name" + ], "properties": { + "expires_at": { + "type": "string" + }, "is_admin": { "type": "boolean" }, @@ -20391,60 +20835,13 @@ } } }, - "user.createUserRequest": { + "user.loginRequest": { "type": "object", "required": [ - "email", "password", "username" ], "properties": { - "email": { - "type": "string", - "maxLength": 255 - }, - "is_active": { - "type": "boolean" - }, - "is_admin": { - "type": "boolean" - }, - "nickname": { - "type": "string", - "maxLength": 64 - }, - "password": { - "type": "string", - "maxLength": 64, - "minLength": 8 - }, - "username": { - "type": "string", - "maxLength": 64, - "minLength": 3 - } - } - }, - "user.listUsersResponse": { - "type": "object", - "properties": { - "total": { - "type": "integer" - }, - "users": { - "type": "array", - "items": { - "$ref": "#/definitions/user.user" - } - } - } - }, - "user.loginRequest": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, "password": { "type": "string" }, @@ -20455,19 +20852,14 @@ }, "user.registerRequest": { "type": "object", + "required": [ + "password", + "username" + ], "properties": { - "code": { - "type": "string" - }, - "display_name": { - "type": "string" - }, "email": { "type": "string" }, - "nickname": { - "type": "string" - }, "password": { "type": "string" }, @@ -20476,32 +20868,6 @@ } } }, - "user.sendEmailCodeRequest": { - "type": "object", - "required": [ - "email", - "scene" - ], - "properties": { - "email": { - "type": "string" - }, - "scene": { - "type": "string" - } - } - }, - "user.tokenResponse": { - "type": "object", - "properties": { - "record": { - "$ref": "#/definitions/model.AccessToken" - }, - "token": { - "type": "string" - } - } - }, "user.updateProfileRequest": { "type": "object", "properties": { @@ -20511,9 +20877,6 @@ "bio": { "type": "string" }, - "email": { - "type": "string" - }, "gender": { "type": "string" }, @@ -20531,89 +20894,6 @@ } } }, - "user.updateUserRequest": { - "type": "object", - "required": [ - "email" - ], - "properties": { - "email": { - "type": "string", - "maxLength": 255 - }, - "is_admin": { - "type": "boolean" - }, - "nickname": { - "type": "string", - "maxLength": 64 - }, - "password": { - "type": "string", - "maxLength": 64, - "minLength": 8 - } - } - }, - "user.updateUserStatusRequest": { - "type": "object", - "properties": { - "is_active": { - "type": "boolean" - } - } - }, - "user.user": { - "type": "object", - "properties": { - "avatar_url": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "created_at": { - "type": "string" - }, - "email": { - "type": "string" - }, - "gender": { - "type": "string" - }, - "id": { - "type": "string", - "example": "0" - }, - "is_active": { - "type": "boolean" - }, - "is_admin": { - "type": "boolean" - }, - "last_login_at": { - "type": "string" - }, - "location": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "updated_at": { - "type": "string" - }, - "username": { - "type": "string" - }, - "website": { - "type": "string" - } - } - }, "waf.CreateRuleInput": { "type": "object", "properties": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 47fc0e58..649361ae 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1,54 +1,5 @@ basePath: / definitions: - Wavelet_OpenFlare_plugins_server_cap.ChallengeResponse: - properties: - challenge: - properties: - c: - type: integer - d: - type: integer - s: - type: integer - type: object - expires: - description: ms timestamp - type: integer - token: - type: string - type: object - Wavelet_OpenFlare_plugins_server_cap.RedeemResponse: - properties: - error: - type: string - expires: - type: integer - success: - type: boolean - token: - type: string - type: object - Wavelet_OpenFlare_plugins_server_model_analytics.ClickHouseOperationalStats: - properties: - active_parts: - type: integer - async_insert_bytes: - type: integer - async_insert_queue: - type: integer - batch_writers: - description: BatchWriters reports in-process queue depth/drops/flush errors - for CH writers. - items: - $ref: '#/definitions/analytics.BatchWriterStats' - type: array - database: - type: string - pending_mutations: - type: integer - total_rows: - type: integer - type: object Wavelet_OpenFlare_share_protocol.ActiveConfigMeta: properties: checksum: @@ -205,6 +156,106 @@ definitions: type: type: string type: object + Wavelet_plugins_domain_admin_model.Schedule: + properties: + created_at: + type: string + cron: + type: string + id: + example: "0" + type: string + is_active: + type: boolean + name: + type: string + payload: + type: string + task_type: + type: string + updated_at: + type: string + type: object + Wavelet_plugins_domain_admin_model.SystemConfig: + properties: + created_at: + type: string + description: + type: string + key: + type: string + type: + type: string + updated_at: + type: string + value: + type: string + visibility: + type: integer + type: object + Wavelet_plugins_domain_admin_model.TaskExecution: + properties: + created_at: + type: string + duration: + type: integer + error_message: + type: string + finished_at: + type: string + id: + example: "0" + type: string + log: + type: string + max_retry: + type: integer + payload: + type: string + result: + type: string + retry_count: + type: integer + retryable: + type: boolean + started_at: + type: string + status: + $ref: '#/definitions/model.TaskExecutionStatus' + task_id: + type: string + task_name: + type: string + task_type: + type: string + triggered_by: + type: string + updated_at: + type: string + type: object + Wavelet_plugins_domain_admin_model.Template: + properties: + content: + type: string + created_at: + type: string + description: + type: string + id: + type: integer + is_system: + type: boolean + key: + type: string + name: + type: string + subject: + type: string + type: + type: string + updated_at: + type: string + type: object agent.ActiveConfigMeta: properties: checksum: @@ -374,21 +425,6 @@ definitions: $ref: '#/definitions/Wavelet_OpenFlare_share_protocol.WAFIPGroup' type: array type: object - analytics.BatchWriterStats: - properties: - cap: - type: integer - depth: - type: integer - drops: - type: integer - flush_errors: - type: integer - name: - type: string - running: - type: boolean - type: object apply_log.CleanupInput: properties: delete_all: @@ -420,45 +456,99 @@ definitions: totalPage: type: integer type: object - auth_source.AuthSourceRequest: + auth.AuthSourceView: properties: - client_id: - type: string - client_secret: - type: string + client_secret_configured: + type: boolean display_name: type: string icon_url: type: string + id: + type: integer is_active: type: boolean name: type: string - openid_discovery_url: - type: string - scopes: - type: string type: type: string type: object - auth_source.ToggleAuthSourceRequest: + auth.BasicUserInfo: properties: - is_active: + avatar_url: + type: string + bio: + type: string + email: + type: string + gender: + type: string + id: + type: integer + is_admin: type: boolean + location: + type: string + need_change_password: + type: boolean + nickname: + type: string + phone: + type: string + username: + type: string + website: + type: string type: object - cache.updateCacheConfigRequest: + auth.CallbackRequest: properties: - lru_enabled: - type: boolean - max_size_mb: - minimum: 1 - type: integer - ttl_minutes: - minimum: 0 - type: integer + code: + type: string + state: + type: string required: - - max_size_mb - - ttl_minutes + - code + - state + type: object + auth.OAuthAuthorizeResponse: + properties: + authorize_url: + type: string + type: object + auth.OAuthCallbackResult: + properties: + status: + type: string + user: + $ref: '#/definitions/auth.BasicUserInfo' + type: object + cap.ChallengeResponse: + properties: + challenge: + properties: + c: + type: integer + d: + type: integer + s: + type: integer + type: object + expires: + description: ms timestamp + type: integer + token: + type: string + type: object + cap.RedeemResponse: + properties: + error: + type: string + expires: + type: integer + success: + type: boolean + token: + type: string type: object cap.challengeRequest: properties: @@ -717,6 +807,81 @@ definitions: path: type: string type: object + contracts.AuthSourceDTO: + properties: + client_id: + type: string + client_secret: + type: string + created_at: + type: string + display_name: + type: string + icon_url: + type: string + id: + example: "0" + type: string + is_active: + type: boolean + name: + type: string + openid_discovery_url: + type: string + scopes: + type: string + type: + type: string + updated_at: + type: string + type: object + contracts.TaskMetaDTO: + properties: + asynq_task: + type: string + category: + type: string + description: + type: string + display_name: + type: string + max_retry: + type: integer + name: + type: string + params: + items: + $ref: '#/definitions/contracts.TaskParamDTO' + type: array + queue: + type: string + retryable: + type: boolean + schedule: + type: string + supports_time: + type: boolean + timeout: + $ref: '#/definitions/time.Duration' + type: + type: string + type: object + contracts.TaskParamDTO: + properties: + default: {} + description: + type: string + label: + type: string + name: + type: string + placeholder: + type: string + required: + type: boolean + type: + type: string + type: object dashboard.Capacity: properties: average_cpu_usage_percent: @@ -816,48 +981,7 @@ definitions: type: array type: array type: object - db_manage.DBOverviewResponse: - properties: - connections: - type: integer - name: - type: string - size: - type: string - table_count: - type: integer - type: - type: string - version: - type: string - type: object - db_manage.ExecuteSQLRequest: - properties: - sql: - type: string - required: - - sql - type: object - db_manage.ExecuteSQLResponse: - properties: - affected_rows: - type: integer - columns: - items: - type: string - type: array - execution_time_ms: - type: integer - results: - items: - additionalProperties: {} - type: object - type: array - type: - description: '"select" 或 "exec"' - type: string - type: object - diskcache.Status: + disk.Status: properties: base_path: type: string @@ -974,7 +1098,7 @@ definitions: properties: items: items: - $ref: '#/definitions/model.Upload' + $ref: '#/definitions/models.Upload' type: array page: type: integer @@ -987,7 +1111,7 @@ definitions: properties: items: items: - $ref: '#/definitions/model.Upload' + $ref: '#/definitions/models.Upload' type: array page: type: integer @@ -1025,7 +1149,7 @@ definitions: description: 全局递增序号 type: integer type: object - logs.accessLogItem: + model.AccessLogItem: properties: created_at: type: string @@ -1046,6 +1170,8 @@ definitions: type: string status: type: integer + trace_id: + type: string user_agent: type: string user_id: @@ -1054,85 +1180,15 @@ definitions: username: type: string type: object - logs.accessLogsResponse: + model.AccessLogsResponse: properties: list: items: - $ref: '#/definitions/logs.accessLogItem' + $ref: '#/definitions/model.AccessLogItem' type: array total: type: integer type: object - logs.browserItem: - properties: - browser: - type: string - count: - type: integer - type: object - logs.logsAnalyticsResponse: - properties: - browsers: - items: - $ref: '#/definitions/logs.browserItem' - type: array - top_users: - items: - $ref: '#/definitions/logs.topUserItem' - type: array - trend: - items: - $ref: '#/definitions/logs.trendItem' - type: array - type: object - logs.logsResponse: - properties: - has_more: - type: boolean - lines: - items: - $ref: '#/definitions/logger.LogEntry' - type: array - next_cursor: - description: 用于加载更早日志的 cursor - type: integer - type: object - logs.topUserItem: - properties: - count: - type: integer - nickname: - type: string - user_id: - example: "0" - type: string - username: - type: string - type: object - logs.trendItem: - properties: - count: - type: integer - date: - type: string - type: object - model.AccessToken: - properties: - created_at: - type: string - id: - type: integer - is_admin: - type: boolean - masked_token: - type: string - name: - type: string - updated_at: - type: string - user_id: - type: integer - type: object model.AcmeAccount: properties: created_at: @@ -1146,32 +1202,64 @@ definitions: url: type: string type: object - model.AuthSource: + model.BindRequest: properties: - client_id: + channel_id: + type: string + code: + type: string + type: object + model.BindingDTO: + properties: + channel_id: + example: "0" + type: string + channel_name: + type: string + channel_type: type: string - client_secret_configured: - type: boolean created_at: type: string - display_name: - type: string - icon_url: - type: string id: + example: "0" + type: string + platform_user_id: + type: string + user_id: + example: "0" + type: string + type: object + model.BrowserItem: + properties: + browser: + type: string + count: type: integer - is_active: + type: object + model.ChannelDTO: + properties: + credentials: + additionalProperties: + type: string + type: object + enabled: type: boolean + extra: + additionalProperties: + type: string + type: object + id: + example: "0" + type: string name: type: string - openid_discovery_url: + owner_id: + example: "0" type: string - scopes: + owner_scope: type: string type: type: string - updated_at: - type: string type: object model.ConfigVersion: properties: @@ -1211,6 +1299,170 @@ definitions: version: type: string type: object + model.CreateChannelRequest: + properties: + credentials: + additionalProperties: + type: string + type: object + enabled: + type: boolean + extra: + additionalProperties: + type: string + type: object + name: + type: string + type: + type: string + type: object + model.CreatePushChannelRequest: + properties: + description: + type: string + enabled: + type: boolean + name: + type: string + other: + type: string + token: + type: string + type: + type: string + url: + type: string + required: + - name + - type + type: object + model.CreatePushEventRequest: + properties: + channels: + items: + type: string + type: array + enabled: + type: boolean + event_key: + type: string + targets: + items: + type: string + type: array + task_type: + type: string + template: + type: string + type: object + model.CreateScheduleRequest: + properties: + cron: + type: string + is_active: + type: boolean + name: + type: string + payload: + type: string + task_type: + type: string + required: + - cron + - is_active + - name + - task_type + type: object + model.CreateSystemConfigRequest: + properties: + description: + maxLength: 255 + type: string + key: + maxLength: 64 + type: string + type: + enum: + - system + - business + type: string + value: + type: string + visibility: + enum: + - 0 + - 1 + type: integer + required: + - key + - type + - value + type: object + model.CreateTemplateRequest: + properties: + content: + type: string + description: + maxLength: 255 + type: string + key: + maxLength: 80 + type: string + name: + maxLength: 100 + type: string + subject: + maxLength: 255 + type: string + type: + maxLength: 20 + type: string + required: + - content + - key + - name + - type + type: object + model.CreateUserRequest: + properties: + email: + maxLength: 255 + type: string + is_active: + type: boolean + is_admin: + type: boolean + nickname: + maxLength: 64 + type: string + password: + maxLength: 64 + minLength: 8 + type: string + username: + maxLength: 64 + minLength: 3 + type: string + required: + - email + - password + - username + type: object + model.DBOverviewResponse: + properties: + connections: + type: integer + name: + type: string + size: + type: string + table_count: + type: integer + type: + type: string + version: + type: string + type: object model.DNSAccount: properties: created_at: @@ -1224,23 +1476,123 @@ definitions: updated_at: type: string type: object - model.ExternalAccountView: + model.DatabaseInfoResponse: properties: - auth_source_id: + name: + type: string + type: + type: string + version: + type: string + type: object + model.Definition: + properties: + fields: + items: + $ref: '#/definitions/model.Field' + type: array + type: + type: string + type: object + model.DispatchTaskRequest: + properties: + end_time: + type: string + payload: + type: string + start_time: + type: string + task_type: + type: string + user_id: type: integer - auth_source_label: + required: + - task_type + type: object + model.ExecuteSQLRequest: + properties: + sql: type: string - auth_source_name: + required: + - sql + type: object + model.ExecuteSQLResponse: + properties: + affected_rows: + type: integer + columns: + items: + type: string + type: array + execution_time_ms: + type: integer + results: + items: + additionalProperties: true + type: object + type: array + type: + description: '"select" 或 "exec"' type: string - auth_source_type: + type: object + model.Field: + properties: + key: type: string - created_at: + required: + type: boolean + type: type: string - email: + type: object + model.ListUsersResponse: + properties: + total: + type: integer + users: + items: + $ref: '#/definitions/model.UserResponse' + type: array + type: object + model.LogDatabaseStatus: + properties: + active_database: type: string - external_username: + available_targets: + items: + type: string + type: array + migration: type: string - id: + retention_days: + additionalProperties: + type: integer + type: object + type: object + model.LogsAnalyticsResponse: + properties: + browsers: + items: + $ref: '#/definitions/model.BrowserItem' + type: array + top_users: + items: + $ref: '#/definitions/model.TopUserItem' + type: array + trend: + items: + $ref: '#/definitions/model.TrendItem' + type: array + type: object + model.LogsResponse: + properties: + has_more: + type: boolean + lines: + items: + $ref: '#/definitions/logger.LogEntry' + type: array + next_cursor: + description: 用于加载更早日志的 cursor type: integer type: object model.OpenFlareApplyLog: @@ -1404,130 +1756,124 @@ definitions: value: type: string type: object + model.PublicChannelDTO: + properties: + id: + example: "0" + type: string + name: + type: string + type: + type: string + type: object model.PushChannel: properties: created_at: type: string description: - description: 备注 type: string enabled: - description: 通道是否启用 type: boolean id: type: integer name: - description: 通道名称,仅英文字母和下划线,唯一 type: string other: - description: 请求体/SMTP 密码等 type: string token: - description: 鉴权令牌或发信用户名等 type: string type: - description: 通道类型:custom, lark, email type: string updated_at: type: string url: - description: 请求地址,HTTPS 协议或 SMTP 地址 type: string type: object model.PushEvent: properties: channels: - description: 推送渠道列表,如 ["lark"] items: type: string type: array created_at: type: string enabled: - description: 是否启用 type: boolean event_key: - description: 如 admin_login type: string id: type: integer name: - description: 如 管理员登录 type: string targets: - description: 推送目标用户/邮箱列表 items: type: string type: array task_type: - description: 关联的异步任务类型 type: string template: - description: 消息模板 JSON type: string updated_at: type: string type: object - model.PushHistory: + model.SystemStatusResponse: properties: - channel: + alloc: type: string - content: + buck_hash_sys: type: string - created_at: - type: string - error_msg: - type: string - event_key: - type: string - id: + frees: type: integer - level: + gc_sys: type: string - status: - description: success / failed + heap_alloc: type: string - target: + heap_idle: type: string - title: + heap_inuse: type: string - type: object - model.Schedule: - properties: - created_at: - type: string - cron: - type: string - id: - example: "0" - type: string - is_active: - type: boolean - name: - type: string - payload: - type: string - task_type: - type: string - updated_at: - type: string - type: object - model.SystemConfig: - properties: - created_at: - type: string - description: - type: string - key: - type: string - type: - type: string - updated_at: - type: string - value: - type: string - visibility: + heap_objects: type: integer + heap_released: + type: string + heap_sys: + type: string + last_gc_time: + type: string + last_pause: + type: string + lookups: + type: integer + mallocs: + type: integer + mcache_inuse: + type: string + mcache_sys: + type: string + mspan_inuse: + type: string + mspan_sys: + type: string + next_gc: + type: string + num_gc: + type: integer + num_goroutine: + type: integer + other_sys: + type: string + pause_total_ns: + type: string + stack_inuse: + type: string + stack_sys: + type: string + sys: + type: string + total_alloc: + type: string + uptime: + type: string type: object model.TLSCertificate: properties: @@ -1572,46 +1918,6 @@ definitions: updated_at: type: string type: object - model.TaskExecution: - properties: - created_at: - type: string - duration: - type: integer - error_message: - type: string - finished_at: - type: string - id: - example: "0" - type: string - log: - type: string - max_retry: - type: integer - payload: - type: string - result: - type: string - retry_count: - type: integer - retryable: - type: boolean - started_at: - type: string - status: - $ref: '#/definitions/model.TaskExecutionStatus' - task_id: - type: string - task_name: - type: string - task_type: - type: string - triggered_by: - type: string - updated_at: - type: string - type: object model.TaskExecutionStatus: enum: - pending @@ -1624,119 +1930,282 @@ definitions: - TaskExecutionStatusRunning - TaskExecutionStatusSucceeded - TaskExecutionStatusFailed - model.Template: + model.TestPushChannelRequest: properties: - content: - type: string - created_at: - type: string - description: - type: string - id: - type: integer - is_system: - type: boolean - key: - type: string name: type: string - subject: + other: + type: string + target: + type: string + token: type: string type: type: string - updated_at: + url: type: string type: object - model.Upload: + model.TestPushRequest: properties: - access_mode: + config: + $ref: '#/definitions/push.Config' + target: + type: string + required: + - config + type: object + model.TestSMTPRequest: + properties: + smtp_host: + maxLength: 255 + type: string + smtp_password: + maxLength: 255 + type: string + smtp_port: type: integer - created_at: + smtp_username: + maxLength: 255 type: string - extension: - description: 文件后缀名 (不含点,如 png, pdf) + to: type: string - file_name: - description: '原始文件名 (例如: image.png)' + required: + - smtp_host + - smtp_password + - smtp_port + - smtp_username + - to + type: object + model.TestSMTPResponse: + properties: + error: type: string - file_path: - description: 文件相对路径 / S3 Key + log: type: string - file_size: - description: 文件大小(字节) + success: + type: boolean + type: object + model.TopUserItem: + properties: + count: type: integer - hash: - description: 文件哈希 (SHA-256/MD5,可用于排重) - type: string - id: - example: "0" - type: string - metadata: - allOf: - - $ref: '#/definitions/model.UploadMetadata' - description: 业务扩展元数据 - mime_type: - description: 媒体类型 (MIME, 如 image/png) - type: string - status: - allOf: - - $ref: '#/definitions/model.UploadStatus' - description: 状态 - type: - description: 业务标识类型 (如 avatar, doc, attachment) - type: string - updated_at: + nickname: type: string user_id: example: "0" type: string + username: + type: string type: object - model.UploadMetadata: + model.TrendItem: properties: - bucket: - description: 存储桶名称 (适用于 S3 等) - type: string - client_ip: - description: 上传者 IP - type: string - duration: - description: 音视频时长 (s) - type: number - extra: - additionalProperties: {} - description: 其它任意业务自定义元数据 - type: object - height: - description: 图像/视频高度 (px) + count: type: integer - original_mime: - description: 原始 MIME 类型 + date: + type: string + type: object + model.UpdateCacheConfigRequest: + properties: + lru_enabled: + type: boolean + max_size_mb: + minimum: 1 + type: integer + ttl_minutes: + minimum: 0 + type: integer + required: + - max_size_mb + - ttl_minutes + type: object + model.UpdateChannelRequest: + properties: + credentials: + additionalProperties: + type: string + type: object + enabled: + type: boolean + extra: + additionalProperties: + type: string + type: object + name: + type: string + type: object + model.UpdatePushChannelRequest: + properties: + description: + type: string + enabled: + type: boolean + other: + type: string + token: + type: string + type: + type: string + url: + type: string + required: + - type + type: object + model.UpdatePushEventRequest: + properties: + channels: + items: + type: string + type: array + enabled: + type: boolean + targets: + items: + type: string + type: array + template: + type: string + required: + - template + type: object + model.UpdateScheduleRequest: + properties: + cron: + type: string + is_active: + type: boolean + name: + type: string + payload: + type: string + task_type: + type: string + required: + - cron + - is_active + - name + - task_type + type: object + model.UpdateSystemConfigRequest: + properties: + description: + maxLength: 255 + type: string + value: + type: string + visibility: + enum: + - 0 + - 1 + type: integer + required: + - value + type: object + model.UpdateTemplateRequest: + properties: + content: + type: string + description: + maxLength: 255 + type: string + name: + maxLength: 100 + type: string + subject: + maxLength: 255 + type: string + type: + maxLength: 20 + type: string + required: + - content + - name + - type + type: object + model.UpdateUserRequest: + properties: + email: + maxLength: 255 + type: string + is_admin: + type: boolean + nickname: + maxLength: 64 + type: string + password: + maxLength: 64 + minLength: 8 + type: string + required: + - email + type: object + model.UpdateUserStatusRequest: + properties: + is_active: + type: boolean + type: object + model.UpdaterStatus: + properties: + asset_name: + type: string + build_time: + type: string + can_upgrade: + type: boolean + current_version: + type: string + latest_version: + type: string + platform: + type: string + prerelease: + type: boolean + published_at: + type: string + release_name: + type: string + release_notes: + type: string + release_url: + type: string + update_available: + type: boolean + upstream_repository: + type: string + type: object + model.UserResponse: + properties: + avatar_url: + type: string + bio: + type: string + created_at: + type: string + email: + type: string + gender: + type: string + id: + example: "0" + type: string + is_active: + type: boolean + is_admin: + type: boolean + last_login_at: + type: string + location: + type: string + nickname: + type: string + phone: + type: string + updated_at: + type: string + username: + type: string + website: type: string - user_agent: - description: 上传者的 UA - type: string - width: - description: 图像/视频宽度 (px) - type: integer type: object - model.UploadStatus: - enum: - - pending - - used - - deleted - type: string - x-enum-comments: - UploadStatusDeleted: 已删除 - UploadStatusPending: 待使用 - UploadStatusUsed: 已使用 - x-enum-descriptions: - - 待使用 - - 已使用 - - 已删除 - x-enum-varnames: - - UploadStatusPending - - UploadStatusUsed - - UploadStatusDeleted model.Zone: properties: created_at: @@ -1765,6 +2234,77 @@ definitions: zone_id: type: integer type: object + models.Upload: + properties: + access_mode: + type: integer + created_at: + type: string + extension: + type: string + file_name: + type: string + file_path: + type: string + file_size: + type: integer + hash: + type: string + id: + example: "0" + type: string + metadata: + $ref: '#/definitions/models.UploadMetadata' + mime_type: + type: string + status: + $ref: '#/definitions/models.UploadStatus' + type: + type: string + updated_at: + type: string + user_id: + example: "0" + type: string + type: object + models.UploadMetadata: + properties: + bucket: + type: string + client_ip: + type: string + duration: + type: number + extra: + additionalProperties: {} + type: object + height: + type: integer + original_mime: + type: string + user_agent: + type: string + width: + type: integer + type: object + models.UploadStatus: + enum: + - pending + - used + - deleted + type: string + x-enum-comments: + UploadStatusDeleted: 已删除 + UploadStatusPending: 待使用 + UploadStatusUsed: 已使用 + x-enum-descriptions: + - 待使用 + - 已使用 + - 已删除 + x-enum-varnames: + - UploadStatusPending + - UploadStatusUsed + - UploadStatusDeleted node.AgentReleaseInfo: properties: body: @@ -1945,72 +2485,6 @@ definitions: version: type: string type: object - oauth.AuthSourceView: - properties: - client_secret_configured: - type: boolean - display_name: - type: string - icon_url: - type: string - id: - type: integer - is_active: - type: boolean - name: - type: string - type: - type: string - type: object - oauth.BasicUserInfo: - properties: - avatar_url: - type: string - bio: - type: string - email: - type: string - gender: - type: string - id: - type: integer - is_admin: - type: boolean - location: - type: string - need_change_password: - type: boolean - nickname: - type: string - phone: - type: string - username: - type: string - website: - type: string - type: object - oauth.CallbackRequest: - properties: - code: - type: string - state: - type: string - required: - - code - - state - type: object - oauth.OAuthAuthorizeResponse: - properties: - authorize_url: - type: string - type: object - oauth.OAuthCallbackResult: - properties: - status: - type: string - user: - $ref: '#/definitions/oauth.BasicUserInfo' - type: object observability.AccessLogCleanupInput: properties: retention_days: @@ -3202,174 +3676,6 @@ definitions: description: Webhook 地址或 SMTP 地址 type: string type: object - push.CreateChannelRequest: - properties: - description: - type: string - enabled: - type: boolean - name: - type: string - other: - type: string - token: - type: string - type: - type: string - url: - type: string - required: - - name - - type - type: object - push.CreateEventRequest: - properties: - channels: - items: - type: string - type: array - enabled: - type: boolean - event_key: - type: string - targets: - items: - type: string - type: array - task_type: - description: 关联的异步任务类型 - type: string - template: - type: string - type: object - push.Definition: - properties: - description: - description: short description - type: string - fields: - description: form fields - items: - $ref: '#/definitions/push.Field' - type: array - name: - description: display name - type: string - type: - description: channel type (e.g., custom, lark, email) - type: string - type: object - push.EventMetadata: - properties: - default_template: - $ref: '#/definitions/push.NotificationMessage' - description: - type: string - key: - type: string - name: - type: string - type: object - push.Field: - properties: - description: - description: field explanation/help text - type: string - key: - description: unique key for the field (e.g. url, token, other) - type: string - label: - description: human readable label (e.g. "Webhook 地址") - type: string - placeholder: - description: input placeholder - type: string - required: - description: whether this field is required - type: boolean - type: - description: 'input type: "text" | "password" | "textarea"' - type: string - type: object - push.NotificationMessage: - properties: - content: - type: string - ext: - additionalProperties: {} - type: object - level: - type: string - title: - type: string - type: object - push.TestChannelRequest: - properties: - name: - type: string - other: - type: string - target: - type: string - token: - type: string - type: - type: string - url: - type: string - type: object - push.TestPushRequest: - properties: - config: - $ref: '#/definitions/push.Config' - target: - type: string - required: - - config - type: object - push.UpdateChannelRequest: - properties: - description: - type: string - enabled: - type: boolean - other: - type: string - token: - type: string - type: - type: string - url: - type: string - required: - - type - type: object - push.UpdateEventRequest: - properties: - channels: - items: - type: string - type: array - enabled: - type: boolean - targets: - items: - type: string - type: array - template: - type: string - required: - - template - type: object - push.pushHistoriesResponse: - properties: - results: - items: - $ref: '#/definitions/model.PushHistory' - type: array - total: - type: integer - type: object relay.HeartbeatPayload: properties: frp_version: @@ -3415,305 +3721,27 @@ definitions: example: "" type: string type: object - status.DatabaseInfoResponse: - properties: - name: - type: string - type: - type: string - version: - type: string - type: object - status.LogDatabaseStatus: - properties: - active_database: - type: string - available_targets: - items: - type: string - type: array - clickhouse: - $ref: '#/definitions/Wavelet_OpenFlare_plugins_server_model_analytics.ClickHouseOperationalStats' - migration: - description: idle | migrating - type: string - retention_days: - additionalProperties: - type: integer - type: object - type: object - status.SystemStatusResponse: - properties: - alloc: - type: string - buck_hash_sys: - type: string - frees: - type: integer - gc_sys: - type: string - heap_alloc: - type: string - heap_idle: - type: string - heap_inuse: - type: string - heap_objects: - type: integer - heap_released: - type: string - heap_sys: - type: string - last_gc_time: - type: string - last_pause: - type: string - lookups: - type: integer - mallocs: - type: integer - mcache_inuse: - type: string - mcache_sys: - type: string - mspan_inuse: - type: string - mspan_sys: - type: string - next_gc: - type: string - num_gc: - type: integer - num_goroutine: - type: integer - other_sys: - type: string - pause_total_ns: - type: string - stack_inuse: - type: string - stack_sys: - type: string - sys: - type: string - total_alloc: - type: string - uptime: - type: string - type: object - system_config.CreateSystemConfigRequest: - properties: - description: - maxLength: 255 - type: string - key: - maxLength: 64 - type: string - type: - enum: - - system - - business - type: string - value: - type: string - visibility: - enum: - - 0 - - 1 - type: integer - required: - - key - - type - - value - type: object - system_config.TestSMTPRequest: - properties: - smtp_host: - maxLength: 255 - type: string - smtp_password: - maxLength: 255 - type: string - smtp_port: - type: integer - smtp_username: - maxLength: 255 - type: string - to: - type: string - required: - - smtp_host - - smtp_password - - smtp_port - - smtp_username - - to - type: object - system_config.TestSMTPResponse: - properties: - error: - type: string - log: - type: string - success: - type: boolean - type: object - system_config.UpdateSystemConfigRequest: - properties: - description: - maxLength: 255 - type: string - value: - type: string - visibility: - enum: - - 0 - - 1 - type: integer - required: - - value - type: object - task.CreateScheduleRequest: - properties: - cron: - type: string - is_active: - type: boolean - name: - type: string - payload: - type: string - task_type: - type: string - required: - - cron - - is_active - - name - - task_type - type: object - task.DispatchTaskRequest: - properties: - end_time: - type: string - payload: - type: string - start_time: - type: string - task_type: - type: string - user_id: - type: integer - required: - - task_type - type: object - task.TaskMeta: - properties: - asynq_task: - type: string - description: - type: string - max_retry: - type: integer - name: - type: string - params: - items: - $ref: '#/definitions/task.TaskParam' - type: array - queue: - type: string - retryable: - description: 是否支持手动重试 - type: boolean - supports_time: - type: boolean - type: - type: string - type: object - task.TaskParam: - properties: - description: - description: 描述 - type: string - label: - description: 显示名称 - type: string - name: - description: 参数键名 - type: string - placeholder: - description: 占位符 - type: string - required: - description: 是否必填 - type: boolean - type: - description: 类型:string, text, number, boolean - type: string - type: object - task.UpdateScheduleRequest: - properties: - cron: - type: string - is_active: - type: boolean - name: - type: string - payload: - type: string - task_type: - type: string - required: - - cron - - is_active - - name - - task_type - type: object - template.CreateTemplateRequest: - properties: - content: - type: string - description: - maxLength: 255 - type: string - key: - maxLength: 80 - type: string - name: - maxLength: 100 - type: string - subject: - maxLength: 255 - type: string - type: - maxLength: 20 - type: string - required: - - content - - key - - name - - type - type: object - template.UpdateTemplateRequest: - properties: - content: - type: string - description: - maxLength: 255 - type: string - name: - maxLength: 100 - type: string - subject: - maxLength: 255 - type: string - type: - maxLength: 20 - type: string - required: - - content - - name - - type - type: object + time.Duration: + enum: + - -9223372036854775808 + - 9223372036854775807 + - 1 + - 1000 + - 1000000 + - 1000000000 + - 60000000000 + - 3600000000000 + format: int64 + type: integer + x-enum-varnames: + - minDuration + - maxDuration + - Nanosecond + - Microsecond + - Millisecond + - Second + - Minute + - Hour tls.ApplyInput: properties: acme_account_id: @@ -3829,94 +3857,65 @@ definitions: upstream_repository: type: string type: object + user.AccessToken: + properties: + created_at: + type: string + id: + type: integer + is_admin: + type: boolean + masked_token: + type: string + name: + type: string + updated_at: + type: string + user_id: + type: integer + type: object user.changePasswordRequest: properties: new_password: type: string old_password: type: string + required: + - new_password + - old_password type: object - user.createTokenRequest: + user.createAccessTokenRequest: properties: + expires_at: + type: string is_admin: type: boolean name: type: string - type: object - user.createUserRequest: - properties: - email: - maxLength: 255 - type: string - is_active: - type: boolean - is_admin: - type: boolean - nickname: - maxLength: 64 - type: string - password: - maxLength: 64 - minLength: 8 - type: string - username: - maxLength: 64 - minLength: 3 - type: string required: - - email - - password - - username - type: object - user.listUsersResponse: - properties: - total: - type: integer - users: - items: - $ref: '#/definitions/user.user' - type: array + - name type: object user.loginRequest: properties: - code: - type: string password: type: string username: type: string + required: + - password + - username type: object user.registerRequest: properties: - code: - type: string - display_name: - type: string email: type: string - nickname: - type: string password: type: string username: type: string - type: object - user.sendEmailCodeRequest: - properties: - email: - type: string - scene: - type: string required: - - email - - scene - type: object - user.tokenResponse: - properties: - record: - $ref: '#/definitions/model.AccessToken' - token: - type: string + - password + - username type: object user.updateProfileRequest: properties: @@ -3924,8 +3923,6 @@ definitions: type: string bio: type: string - email: - type: string gender: type: string location: @@ -3937,62 +3934,6 @@ definitions: website: type: string type: object - user.updateUserRequest: - properties: - email: - maxLength: 255 - type: string - is_admin: - type: boolean - nickname: - maxLength: 64 - type: string - password: - maxLength: 64 - minLength: 8 - type: string - required: - - email - type: object - user.updateUserStatusRequest: - properties: - is_active: - type: boolean - type: object - user.user: - properties: - avatar_url: - type: string - bio: - type: string - created_at: - type: string - email: - type: string - gender: - type: string - id: - example: "0" - type: string - is_active: - type: boolean - is_admin: - type: boolean - last_login_at: - type: string - location: - type: string - nickname: - type: string - phone: - type: string - updated_at: - type: string - username: - type: string - website: - type: string - type: object waf.CreateRuleInput: properties: name: @@ -4357,7 +4298,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/Wavelet_OpenFlare_plugins_server_cap.ChallengeResponse' + $ref: '#/definitions/cap.ChallengeResponse' type: object "500": description: 内部服务错误 @@ -4388,7 +4329,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/Wavelet_OpenFlare_plugins_server_cap.RedeemResponse' + $ref: '#/definitions/cap.RedeemResponse' type: object "400": description: 参数错误或核销失败 @@ -4428,14 +4369,7 @@ paths: "200": description: 认证源列表 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - items: - $ref: '#/definitions/model.AuthSource' - type: array - type: object + $ref: '#/definitions/response.Any' "401": description: 未登录 schema: @@ -4463,19 +4397,14 @@ paths: name: request required: true schema: - $ref: '#/definitions/auth_source.AuthSourceRequest' + $ref: '#/definitions/contracts.AuthSourceDTO' produces: - application/json responses: "200": description: 创建成功,返回认证源信息 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/model.AuthSource' - type: object + $ref: '#/definitions/response.Any' "400": description: 参数错误或验证失败 schema: @@ -4548,19 +4477,14 @@ paths: name: request required: true schema: - $ref: '#/definitions/auth_source.AuthSourceRequest' + $ref: '#/definitions/contracts.AuthSourceDTO' produces: - application/json responses: "200": description: 更新成功,返回更新后的认证源信息 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/model.AuthSource' - type: object + $ref: '#/definitions/response.Any' "400": description: 参数错误或验证失败 schema: @@ -4594,12 +4518,6 @@ paths: name: id required: true type: integer - - description: 启用状态 - in: body - name: request - required: true - schema: - $ref: '#/definitions/auth_source.ToggleAuthSourceRequest' produces: - application/json responses: @@ -4667,7 +4585,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/cache.updateCacheConfigRequest' + $ref: '#/definitions/model.UpdateCacheConfigRequest' produces: - application/json responses: @@ -4709,7 +4627,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/diskcache.Status' + $ref: '#/definitions/disk.Status' type: object "401": description: 未登录 @@ -4768,7 +4686,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/status.DatabaseInfoResponse' + $ref: '#/definitions/model.DatabaseInfoResponse' type: object "401": description: 未登录 @@ -4796,7 +4714,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/db_manage.DBOverviewResponse' + $ref: '#/definitions/model.DBOverviewResponse' type: object "401": description: 未登录 @@ -4826,7 +4744,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/db_manage.ExecuteSQLRequest' + $ref: '#/definitions/model.ExecuteSQLRequest' produces: - application/json responses: @@ -4837,7 +4755,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/db_manage.ExecuteSQLResponse' + $ref: '#/definitions/model.ExecuteSQLResponse' type: object "400": description: SQL 语句错误 @@ -4918,7 +4836,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/logs.logsResponse' + $ref: '#/definitions/model.LogsResponse' type: object "401": description: 未登录 @@ -4935,7 +4853,7 @@ paths: - admin /api/v1/admin/logs/access: get: - description: 分页并按照用户、接口路径、时间范围等维度检索用户访问日志列表(需要管理员权限,日志存储未启用时报错) + description: 分页并按照用户、接口路径、时间范围等维度检索用户访问日志列表(需要管理员权限) parameters: - default: 1 description: 页码 @@ -4973,10 +4891,10 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/logs.accessLogsResponse' + $ref: '#/definitions/model.AccessLogsResponse' type: object "400": - description: 日志存储未启用或参数错误 + description: 参数错误 schema: $ref: '#/definitions/response.Any' "401": @@ -4987,6 +4905,10 @@ paths: description: 无管理员权限 schema: $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' security: - SessionCookie: [] summary: 获取用户访问日志 @@ -4994,7 +4916,7 @@ paths: - admin /api/v1/admin/logs/analytics: get: - description: 聚合统计最近 7 天的每日访问趋势、浏览器分布以及前 10 名最活跃用户排行(需要管理员权限,日志存储未启用时报错) + description: 聚合统计最近 7 天的每日访问趋势、浏览器分布以及前 10 名最活跃用户排行(需要管理员权限) produces: - application/json responses: @@ -5005,12 +4927,8 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/logs.logsAnalyticsResponse' + $ref: '#/definitions/model.LogsAnalyticsResponse' type: object - "400": - description: 日志存储未启用 - schema: - $ref: '#/definitions/response.Any' "401": description: 未登录 schema: @@ -5019,6 +4937,10 @@ paths: description: 无管理员权限 schema: $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' security: - SessionCookie: [] summary: 获取访问日志分析数据 @@ -5031,6 +4953,177 @@ paths: summary: 系统日志实时推送 tags: - admin + /api/v1/admin/message-gateway/channels: + get: + description: Returns all messaging channels; secrets are masked + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + items: + $ref: '#/definitions/model.ChannelDTO' + type: array + type: object + security: + - SessionCookie: [] + summary: List message gateway channels + tags: + - admin-message-gateway + post: + consumes: + - application/json + description: Creates a Telegram or QQ channel with encrypted credentials + parameters: + - description: create body + in: body + name: request + required: true + schema: + $ref: '#/definitions/model.CreateChannelRequest' + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/model.ChannelDTO' + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: Create message gateway channel + tags: + - admin-message-gateway + /api/v1/admin/message-gateway/channels/{id}: + delete: + description: Deletes a channel and cascaded bindings and pairing codes + parameters: + - description: channel id + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/response.Any' + "404": + description: Not Found + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: Delete message gateway channel + tags: + - admin-message-gateway + patch: + consumes: + - application/json + description: Updates a channel; empty secrets keep the current ciphertext + parameters: + - description: channel id + in: path + name: id + required: true + type: integer + - description: update body + in: body + name: request + required: true + schema: + $ref: '#/definitions/model.UpdateChannelRequest' + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/model.ChannelDTO' + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/response.Any' + "404": + description: Not Found + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: Update message gateway channel + tags: + - admin-message-gateway + /api/v1/admin/message-gateway/channels/{id}/test: + post: + description: Probes stored credentials without returning secrets + parameters: + - description: channel id + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/response.Any' + "400": + description: Bad Request + schema: + $ref: '#/definitions/response.Any' + "404": + description: Not Found + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: Test message gateway channel + tags: + - admin-message-gateway + /api/v1/admin/message-gateway/channels/definitions: + get: + description: Returns form field definitions for Telegram and QQ channels + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + items: + $ref: '#/definitions/model.Definition' + type: array + type: object + security: + - SessionCookie: [] + summary: List message gateway channel definitions + tags: + - admin-message-gateway /api/v1/admin/push/channels: get: description: 返回系统配置的所有消息通道列表,需要管理员权限 @@ -5063,7 +5156,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/push.CreateChannelRequest' + $ref: '#/definitions/model.CreatePushChannelRequest' produces: - application/json responses: @@ -5119,7 +5212,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/push.UpdateChannelRequest' + $ref: '#/definitions/model.UpdatePushChannelRequest' produces: - application/json responses: @@ -5139,21 +5232,14 @@ paths: - admin-push /api/v1/admin/push/channels/definitions: get: - description: 返回系统支持的所有消息通道类型(如飞书、邮件、自定义、Telegram)的动态表单定义,需要管理员权限 + description: 返回系统支持的所有消息通道类型的动态表单定义,需要管理员权限 produces: - application/json responses: "200": description: 通道配置定义列表 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - items: - $ref: '#/definitions/push.Definition' - type: array - type: object + $ref: '#/definitions/response.Any' security: - SessionCookie: [] summary: 获取所有消息通道配置字段定义 @@ -5170,7 +5256,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/push.TestChannelRequest' + $ref: '#/definitions/model.TestPushChannelRequest' produces: - application/json responses: @@ -5215,7 +5301,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/push.CreateEventRequest' + $ref: '#/definitions/model.CreatePushEventRequest' produces: - application/json responses: @@ -5274,7 +5360,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/push.UpdateEventRequest' + $ref: '#/definitions/model.UpdatePushEventRequest' produces: - application/json responses: @@ -5327,14 +5413,7 @@ paths: "200": description: 内置通知事件列表 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - items: - $ref: '#/definitions/push.EventMetadata' - type: array - type: object + $ref: '#/definitions/response.Any' security: - SessionCookie: [] summary: 获取所有内置通知事件 @@ -5366,12 +5445,7 @@ paths: "200": description: 推送历史列表 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/push.pushHistoriesResponse' - type: object + $ref: '#/definitions/response.Any' security: - SessionCookie: [] summary: 分页获取通知推送历史 @@ -5388,7 +5462,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/push.TestPushRequest' + $ref: '#/definitions/model.TestPushRequest' produces: - application/json responses: @@ -5419,7 +5493,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/status.SystemStatusResponse' + $ref: '#/definitions/model.SystemStatusResponse' type: object "401": description: 未登录 @@ -5447,7 +5521,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/status.LogDatabaseStatus' + $ref: '#/definitions/model.LogDatabaseStatus' type: object "401": description: 未登录 @@ -5485,7 +5559,7 @@ paths: - properties: data: items: - $ref: '#/definitions/model.SystemConfig' + $ref: '#/definitions/Wavelet_plugins_domain_admin_model.SystemConfig' type: array type: object "401": @@ -5515,7 +5589,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/system_config.CreateSystemConfigRequest' + $ref: '#/definitions/model.CreateSystemConfigRequest' produces: - application/json responses: @@ -5568,7 +5642,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/model.SystemConfig' + $ref: '#/definitions/Wavelet_plugins_domain_admin_model.SystemConfig' type: object "401": description: 未登录 @@ -5606,7 +5680,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/system_config.UpdateSystemConfigRequest' + $ref: '#/definitions/model.UpdateSystemConfigRequest' produces: - application/json responses: @@ -5655,7 +5729,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/system_config.TestSMTPRequest' + $ref: '#/definitions/model.TestSMTPRequest' produces: - application/json responses: @@ -5666,7 +5740,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/system_config.TestSMTPResponse' + $ref: '#/definitions/model.TestSMTPResponse' type: object "400": description: 参数错误 @@ -5688,7 +5762,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/task.DispatchTaskRequest' + $ref: '#/definitions/model.DispatchTaskRequest' produces: - application/json responses: @@ -5734,14 +5808,6 @@ paths: in: query name: task_type type: string - - description: 任务类型前缀筛选(与 task_type / task_types 互斥,精确类型优先) - in: query - name: task_type_prefix - type: string - - description: 逗号分隔的精确任务类型列表(IN 筛选,优先于前缀) - in: query - name: task_types - type: string - default: 1 description: 页码 in: query @@ -5796,7 +5862,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/model.TaskExecution' + $ref: '#/definitions/Wavelet_plugins_domain_admin_model.TaskExecution' type: object "400": description: 参数错误 @@ -5867,7 +5933,7 @@ paths: - admin /api/v1/admin/tasks/schedules: get: - description: 返回管理员可管理的定时任务配置列表,包括名称、关联的异步任务类型、Cron 表达式和启用状态;系统内部排程不会暴露,需要管理员权限 + description: 返回系统所有的定时任务配置列表,包括名称、关联的异步任务类型、Cron 表达式和启用状态,需要管理员权限 produces: - application/json responses: @@ -5879,7 +5945,7 @@ paths: - properties: data: items: - $ref: '#/definitions/model.Schedule' + $ref: '#/definitions/Wavelet_plugins_domain_admin_model.Schedule' type: array type: object "401": @@ -5905,7 +5971,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/task.CreateScheduleRequest' + $ref: '#/definitions/model.CreateScheduleRequest' produces: - application/json responses: @@ -5916,7 +5982,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/model.Schedule' + $ref: '#/definitions/Wavelet_plugins_domain_admin_model.Schedule' type: object "400": description: Cron 表达式无效、异步任务类型不存在或参数错误 @@ -5972,10 +6038,6 @@ paths: description: 无管理员权限 schema: $ref: '#/definitions/response.Any' - "404": - description: 定时任务不存在 - schema: - $ref: '#/definitions/response.Any' "500": description: 删除定时任务失败 schema: @@ -6000,7 +6062,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/task.UpdateScheduleRequest' + $ref: '#/definitions/model.UpdateScheduleRequest' produces: - application/json responses: @@ -6011,7 +6073,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/model.Schedule' + $ref: '#/definitions/Wavelet_plugins_domain_admin_model.Schedule' type: object "400": description: Cron 表达式无效、参数错误 @@ -6052,7 +6114,7 @@ paths: - properties: data: items: - $ref: '#/definitions/task.TaskMeta' + $ref: '#/definitions/contracts.TaskMetaDTO' type: array type: object "401": @@ -6082,7 +6144,7 @@ paths: - properties: data: items: - $ref: '#/definitions/model.Template' + $ref: '#/definitions/Wavelet_plugins_domain_admin_model.Template' type: array type: object "401": @@ -6112,7 +6174,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/template.CreateTemplateRequest' + $ref: '#/definitions/model.CreateTemplateRequest' produces: - application/json responses: @@ -6210,7 +6272,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/model.Template' + $ref: '#/definitions/Wavelet_plugins_domain_admin_model.Template' type: object "401": description: 未登录 @@ -6248,7 +6310,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/template.UpdateTemplateRequest' + $ref: '#/definitions/model.UpdateTemplateRequest' produces: - application/json responses: @@ -6259,7 +6321,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/model.Template' + $ref: '#/definitions/Wavelet_plugins_domain_admin_model.Template' type: object "400": description: 参数错误 @@ -6299,7 +6361,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/updater.Status' + $ref: '#/definitions/model.UpdaterStatus' type: object "401": description: 未登录 @@ -6373,8 +6435,7 @@ paths: in: query name: extension type: string - - description: 上传用户 ID - format: int64 + - description: 上传用户 ID 过滤 in: query name: user_id type: integer @@ -6390,12 +6451,8 @@ paths: data: $ref: '#/definitions/handler.listFilesResponse' type: object - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 + "400": + description: 参数错误 schema: $ref: '#/definitions/response.Any' security: @@ -6405,7 +6462,7 @@ paths: - admin /api/v1/admin/uploads/{id}: delete: - description: 将文件状态置为 deleted(软删除),不会立即清理底层存储对象 + description: 将指定 ID 的文件状态置为 deleted(软删除) parameters: - description: 文件 ID in: path @@ -6419,18 +6476,10 @@ paths: description: 删除成功 schema: $ref: '#/definitions/response.Any' - "403": - description: 无权操作 - schema: - $ref: '#/definitions/response.Any' "404": description: 文件不存在 schema: $ref: '#/definitions/response.Any' - "409": - description: 系统保留类型或存储只读 - schema: - $ref: '#/definitions/response.Any' security: - SessionCookie: [] summary: 删除文件 @@ -6505,6 +6554,80 @@ paths: summary: 批量打包下载 tags: - admin + /api/v1/admin/uploads/files: + get: + description: 分页获取系统上传的文件列表,支持文件名关键词、业务类型、扩展名、上传用户ID过滤 + parameters: + - description: 页码(默认 1) + in: query + name: page + type: integer + - description: 每页数量(默认 20,最大 100) + in: query + name: page_size + type: integer + - description: 文件名关键词(模糊匹配) + in: query + name: keyword + type: string + - description: 业务分类过滤 + in: query + name: type + type: string + - description: 扩展名过滤 + in: query + name: extension + type: string + - description: 上传用户 ID 过滤 + in: query + name: user_id + type: integer + produces: + - application/json + responses: + "200": + description: 查询成功 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/handler.listFilesResponse' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 获取文件列表 + tags: + - admin + /api/v1/admin/uploads/files/{id}: + delete: + description: 将指定 ID 的文件状态置为 deleted(软删除) + parameters: + - description: 文件 ID + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: 删除成功 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 文件不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 删除文件 + tags: + - admin /api/v1/admin/uploads/stats: get: description: 返回系统级的总文件数、占用大小、最近 7 天新增趋势、文件类型/格式分布等数据 @@ -6539,12 +6662,12 @@ paths: - admin /api/v1/admin/uploads/types: get: - description: 返回数据库中所有已上传文件实际拥有的业务类型列表 + description: 查询系统内所有不重复的上传业务分类标识(如 avatar, doc 等) produces: - application/json responses: "200": - description: 业务类型列表 + description: 查询成功 schema: allOf: - $ref: '#/definitions/response.Any' @@ -6554,21 +6677,9 @@ paths: type: string type: array type: object - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' security: - SessionCookie: [] - summary: 获取文件业务类型列表 + summary: 获取业务分类列表 tags: - admin /api/v1/admin/users: @@ -6603,7 +6714,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/user.listUsersResponse' + $ref: '#/definitions/model.ListUsersResponse' type: object "400": description: 参数错误 @@ -6636,7 +6747,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/user.createUserRequest' + $ref: '#/definitions/model.CreateUserRequest' produces: - application/json responses: @@ -6647,7 +6758,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/user.user' + $ref: '#/definitions/model.UserResponse' type: object "400": description: 参数错误或用户名已存在 @@ -6734,7 +6845,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/user.user' + $ref: '#/definitions/model.UserResponse' type: object "400": description: 参数错误 @@ -6776,7 +6887,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/user.updateUserRequest' + $ref: '#/definitions/model.UpdateUserRequest' produces: - application/json responses: @@ -6830,7 +6941,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/user.updateUserStatusRequest' + $ref: '#/definitions/model.UpdateUserStatusRequest' produces: - application/json responses: @@ -12068,6 +12179,124 @@ paths: summary: 更新 Zone tags: - openflare-zone + /api/v1/message-gateway/bindings: + get: + description: Returns the current user's bound messaging channels + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + items: + $ref: '#/definitions/model.BindingDTO' + type: array + type: object + "401": + description: Unauthorized + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: List message gateway bindings + tags: + - message-gateway + post: + consumes: + - application/json + description: Binds the current user to a platform identity using a one-time + pairing code + parameters: + - description: bind body + in: body + name: request + required: true + schema: + $ref: '#/definitions/model.BindRequest' + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/model.BindingDTO' + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/response.Any' + "409": + description: Conflict + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: Bind a messaging channel + tags: + - message-gateway + /api/v1/message-gateway/bindings/{id}: + delete: + description: Removes a binding owned by the current user + parameters: + - description: binding id + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/response.Any' + "403": + description: Forbidden + schema: + $ref: '#/definitions/response.Any' + "404": + description: Not Found + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: Unbind a messaging channel + tags: + - message-gateway + /api/v1/message-gateway/channels: + get: + description: Returns enabled system bots the current user can pair with + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + items: + $ref: '#/definitions/model.PublicChannelDTO' + type: array + type: object + "401": + description: Unauthorized + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: List enabled messaging channels + tags: + - message-gateway /api/v1/oauth/{source}/authorize: get: description: 根据指定认证源名称发起 OAuth 授权,支持 purpose 参数用于区分登录和账号绑定场景。认证源必须已启用。 @@ -12091,14 +12320,14 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/oauth.OAuthAuthorizeResponse' + $ref: '#/definitions/auth.OAuthAuthorizeResponse' type: object "400": description: 认证源不存在或未启用 schema: $ref: '#/definitions/response.Any' "500": - description: Redis 异常或构造 URL 失败 + description: 构造 URL 失败 schema: $ref: '#/definitions/response.Any' summary: 发起指定认证源授权 @@ -12115,7 +12344,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/oauth.CallbackRequest' + $ref: '#/definitions/auth.CallbackRequest' produces: - application/json responses: @@ -12126,7 +12355,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/oauth.OAuthCallbackResult' + $ref: '#/definitions/auth.OAuthCallbackResult' type: object "400": description: state 无效、参数错误或认证源错误 @@ -12152,14 +12381,7 @@ paths: "200": description: 外部帐号列表 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - items: - $ref: '#/definitions/model.ExternalAccountView' - type: array - type: object + $ref: '#/definitions/response.Any' "401": description: 未登录 schema: @@ -12226,14 +12448,14 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/oauth.OAuthAuthorizeResponse' + $ref: '#/definitions/auth.OAuthAuthorizeResponse' type: object "400": description: 认证源不存在或未配置 schema: $ref: '#/definitions/response.Any' "500": - description: Redis 异常 or 构造 URL 失败 + description: 构造 URL 失败 schema: $ref: '#/definitions/response.Any' summary: 获取登录授权地址 @@ -12277,7 +12499,7 @@ paths: - properties: data: items: - $ref: '#/definitions/oauth.AuthSourceView' + $ref: '#/definitions/auth.AuthSourceView' type: array type: object summary: 获取可用登录源 @@ -12285,7 +12507,7 @@ paths: - oauth /api/v1/oauth/user-info: get: - description: 返回当前登录用户的基本信息及余额数据,需要登录。包括用户 ID、用户名、信任等级、各类余额信息等。 + description: 返回当前登录用户的基本信息,需要登录。 produces: - application/json responses: @@ -12296,7 +12518,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/oauth.BasicUserInfo' + $ref: '#/definitions/auth.BasicUserInfo' type: object "401": description: 未登录 @@ -12525,7 +12747,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/model.Upload' + $ref: '#/definitions/models.Upload' type: object "400": description: 请求参数错误或文件受限 @@ -12535,10 +12757,6 @@ paths: description: 未登录 schema: $ref: '#/definitions/response.Any' - "409": - description: 系统保留类型或存储只读 - schema: - $ref: '#/definitions/response.Any' "500": description: 内部错误 schema: @@ -12572,10 +12790,6 @@ paths: description: 文件不存在 schema: $ref: '#/definitions/response.Any' - "409": - description: 系统保留类型或存储只读 - schema: - $ref: '#/definitions/response.Any' security: - SessionCookie: [] summary: 删除我的文件 @@ -12607,7 +12821,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/model.Upload' + $ref: '#/definitions/models.Upload' type: object "403": description: 无权操作 @@ -12669,7 +12883,7 @@ paths: - upload /api/v1/user-info: get: - description: 返回当前登录用户的基本信息及余额数据,需要登录。包括用户 ID、用户名、信任等级、各类余额信息等。 + description: 返回当前登录用户的基本信息,需要登录。 produces: - application/json responses: @@ -12680,7 +12894,7 @@ paths: - $ref: '#/definitions/response.Any' - properties: data: - $ref: '#/definitions/oauth.BasicUserInfo' + $ref: '#/definitions/auth.BasicUserInfo' type: object "401": description: 未登录 @@ -12705,7 +12919,7 @@ paths: - properties: data: items: - $ref: '#/definitions/model.AccessToken' + $ref: '#/definitions/user.AccessToken' type: array type: object "401": @@ -12720,26 +12934,21 @@ paths: post: consumes: - application/json - description: 为当前用户新建一个 API 访问令牌,仅在此接口返回一次明文令牌值,请妥善保存。可通过 is_admin 字段赋予令牌管理员权限(仅管理员用户可设置)。 + description: 为当前用户新建一个 API 访问令牌,仅在此接口返回一次明文令牌值,请妥善保存。 parameters: - description: 令牌名称 in: body name: request required: true schema: - $ref: '#/definitions/user.createTokenRequest' + $ref: '#/definitions/user.createAccessTokenRequest' produces: - application/json responses: "200": description: 新建令牌成功 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/user.tokenResponse' - type: object + $ref: '#/definitions/response.Any' "400": description: 参数错误或超限 schema: @@ -12794,12 +13003,7 @@ paths: "200": description: 令牌轮换成功 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/user.tokenResponse' - type: object + $ref: '#/definitions/response.Any' "400": description: 参数错误 schema: @@ -12813,7 +13017,7 @@ paths: post: consumes: - application/json - description: 修改当前登录用户的密码。修改成功后,如果是首次明文登录的升级提示,则清除修改密码的提示状态。 + description: 修改当前登录用户的密码。 parameters: - description: 修改密码请求参数 in: body @@ -12862,12 +13066,7 @@ paths: "200": description: 登录成功,返回用户信息 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/oauth.BasicUserInfo' - type: object + $ref: '#/definitions/response.Any' "400": description: 用户名或密码错误 schema: @@ -12907,7 +13106,7 @@ paths: put: consumes: - application/json - description: 修改当前登录用户的昵称、邮箱、头像、简介、电话、性别、个人网站和所在地。 + description: 修改当前登录用户的昵称、头像、简介、电话、性别、个人网站和所在地。 parameters: - description: 更新请求参数 in: body @@ -12921,14 +13120,9 @@ paths: "200": description: 修改成功,返回更新后的用户信息 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/oauth.BasicUserInfo' - type: object + $ref: '#/definitions/response.Any' "400": - description: 邮箱已被占用或参数错误 + description: 参数错误 schema: $ref: '#/definitions/response.Any' "401": @@ -12942,7 +13136,7 @@ paths: post: consumes: - application/json - description: 使用用户名和密码注册新账号,注册成功后自动登录并建立 Session。密码长度不能少于 8 位。 + description: 使用用户名和密码注册新账号,注册成功后自动登录并建立 Session。 parameters: - description: 注册请求参数 in: body @@ -12956,12 +13150,7 @@ paths: "200": description: 注册并登录成功,返回用户信息 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/oauth.BasicUserInfo' - type: object + $ref: '#/definitions/response.Any' "400": description: 参数错误、用户名已存在或注册已关闭 schema: @@ -12975,19 +13164,14 @@ paths: - user /api/v1/user/self: get: - description: 返回当前登录用户的基本信息及余额数据,需要登录。包括用户 ID、用户名、信任等级、各类余额信息等。 + description: 返回当前登录用户的基本信息,需要登录。 produces: - application/json responses: "200": description: 用户信息 schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/oauth.BasicUserInfo' - type: object + $ref: '#/definitions/response.Any' "401": description: 未登录 schema: @@ -12996,19 +13180,12 @@ paths: - SessionCookie: [] summary: 获取当前登录用户信息 tags: - - oauth + - user /api/v1/user/send-email-code: post: consumes: - application/json description: 向指定邮箱发送验证码(用于注册场景) - parameters: - - description: 发送验证码请求参数 - in: body - name: request - required: true - schema: - $ref: '#/definitions/user.sendEmailCodeRequest' produces: - application/json responses: diff --git a/scripts/swagger.sh b/scripts/swagger.sh index f59bf4c1..658398b0 100755 --- a/scripts/swagger.sh +++ b/scripts/swagger.sh @@ -4,10 +4,8 @@ set -eu # execute this first # go install github.com/swaggo/swag/cmd/swag@latest -# 仅扫描 OpenFlare 自身代码:上游 core/ 与 plugins/ 尚未挂载进装配根(P4 接入), -# 且其包名(如 model、disk)与下游注解里的裸名引用冲突,扫描会导致 ParseComment 失败。 ( cd backend - swag init -o docs --parseDependency --parseInternal --exclude plugins,core + swag init -o docs --parseDependency --parseInternal ) cp backend/docs/swagger.json backend/docs/swagger.yaml docs/