feat(monitor): 卡片概况与统一文件处理表
build / build (push) Successful in 1m17s

This commit is contained in:
姚章浩
2026-10-27 12:14:19 +08:00
parent d8d143eca0
commit 1b09f7d35b
13 changed files with 2238 additions and 559 deletions
+317
View File
@@ -3386,6 +3386,323 @@
"operationId": "cancelPublicationsBatch"
}
},
"/api/v1/monitor/tasks": {
"get": {
"operationId": "listMonitorTasks",
"summary": "统一文件处理表(来源文件×目标测试库)",
"description": "按最新未替代版本归并后在数据库内筛选、分页和计数。id筛选附带最近50条版本状态、失败和重试记录。只读,不触发处理。",
"parameters": [
{
"name": "q",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "source",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "scope",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "target",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "action",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "status",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "stage",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "since",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "until",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "id",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "limit",
"in": "query",
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 20
}
},
{
"name": "offset",
"in": "query",
"schema": {
"type": "integer",
"minimum": 0
}
}
],
"responses": {
"400": {
"description": "筛选参数错误"
},
"401": {
"description": "需要登录"
},
"403": {
"description": "权限不足"
},
"500": {
"description": "读取或提交失败"
},
"501": {
"description": "存储未配置"
},
"200": {
"description": "同一快照的筛选结果、总数、可重试数及全局筛选项",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "object",
"required": [
"items",
"total",
"limit",
"offset",
"retryable",
"sources",
"targets"
],
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"title",
"path",
"source_id",
"source_name",
"target_scope",
"target_kb",
"action",
"stage",
"status",
"detail",
"updated_at",
"retry_kind",
"failure_id",
"version_id",
"retry_count",
"history"
],
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"path": {
"type": "string"
},
"source_id": {
"type": "string"
},
"source_name": {
"type": "string"
},
"target_scope": {
"type": "string"
},
"target_kb": {
"type": "string"
},
"action": {
"type": "string"
},
"stage": {
"type": "string"
},
"status": {
"type": "string"
},
"detail": {
"type": "string"
},
"updated_at": {
"type": "string"
},
"retry_kind": {
"type": "string"
},
"failure_id": {
"type": "string"
},
"version_id": {
"type": "string"
},
"retry_count": {
"type": "integer",
"minimum": 0
},
"history": {
"type": "array",
"items": {
"type": "object",
"properties": {
"at": {
"type": "string"
},
"kind": {
"type": "string"
},
"detail": {
"type": "string"
}
}
}
}
}
}
},
"total": {
"type": "integer",
"minimum": 0
},
"limit": {
"type": "integer",
"minimum": 0
},
"offset": {
"type": "integer",
"minimum": 0
},
"retryable": {
"type": "integer",
"minimum": 0
},
"sources": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
},
"targets": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
}
}
}
},
"/api/v1/test-publications/{id}/removal-retry": {
"post": {
"operationId": "retryMonitorRemoval",
"summary": "重试失败的测试库移除任务",
"description": "仅工程师或管理员;事务内核验禁止导入规则、未被替代及无运行任务,恢复原移除任务并登记审计。重复调用冲突不重复入队,不上传知识、不操作来源及生产。",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"400": {
"description": "筛选参数错误"
},
"401": {
"description": "需要登录"
},
"403": {
"description": "权限不足"
},
"500": {
"description": "读取或提交失败"
},
"501": {
"description": "存储未配置"
},
"202": {
"description": "已受理,不代表移除已完成"
},
"409": {
"description": "规则或状态已变化,不能重试"
}
}
}
},
"/api/v1/monitor/metrics": {
"get": {
"operationId": "getMonitorMetrics",