完善验收采集调度与截图管理

This commit is contained in:
2026-09-01 16:18:00 +08:00
parent af340206a5
commit 292bd3a126
7 changed files with 401 additions and 44 deletions

View File

@@ -2,7 +2,7 @@
"openapi": "3.0.3",
"info": {
"title": "Holy蟹业务任务接口",
"version": "1.1.0",
"version": "1.2.0",
"description": "前端调用的业务后端任务接口。继续采集沿用原任务 ID;重新采集创建新任务。"
},
"servers": [
@@ -37,15 +37,69 @@
"responses": {"201": {"description": "新一轮验收任务已创建"}}
}
},
"/api/v1/acceptance-tasks/{task_id}/cancel": {
"post": {
"summary": "停止项目验收采集",
"description": "仅停止当前等待中或运行中的采集批次,并阻止后台解析与截图轮询继续反写任务状态;不会修改该项目已设置的周期计划。已经下发到设备的外部指令可能仍会执行。",
"tags": ["项目验收"],
"parameters": [{"$ref": "#/components/parameters/TaskId"}],
"requestBody": {
"required": false,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {"reason": {"type": "string"}}
}
}
}
},
"responses": {
"200": {"description": "验收任务已停止"},
"409": {"description": "任务已经进入不可停止的终态"}
}
}
},
"/api/v1/acceptance-tasks/{task_id}/retry-failed-devices": {
"post": {
"summary": "重新采集全部失败截图设备",
"description": "按每个关键词读取最新 XAPI 结果,仅将失败、取消、异常或已完成但无截图的设备精确重新下发。成功设备不会重复执行,新批次继续归入原验收任务。",
"tags": ["项目验收"],
"parameters": [{"$ref": "#/components/parameters/TaskId"}],
"responses": {
"200": {"description": "失败设备重新下发成功"},
"409": {"description": "没有失败设备或任务不支持截图重采"}
}
}
},
"/api/v1/acceptance-tasks/{task_id}/schedule": {
"put": {
"summary": "设置每周采集周期",
"description": "按 Asia/Shanghai 时区,在指定星期的 00:00 创建新一轮采集。",
"summary": "设置多日周期采集",
"description": "按服务所在时区,在选中的每个星期于开始时间创建新一轮采集;结束时间用于限制过期任务,超过区间后自动顺延到下一次。兼容旧版 weekday 单值。",
"tags": ["项目验收"],
"parameters": [{"$ref": "#/components/parameters/TaskId"}],
"requestBody": {
"required": true,
"content": {"application/json": {"schema": {"type": "object", "required": ["weekday"], "properties": {"weekday": {"type": "integer", "minimum": 1, "maximum": 7, "description": "1=周一,7=周日"}}}}}
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["weekdays", "start_time", "end_time"],
"properties": {
"weekdays": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {"type": "integer", "minimum": 1, "maximum": 7},
"description": "可多选;1=周一,7=周日"
},
"start_time": {"type": "string", "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$", "example": "01:00"},
"end_time": {"type": "string", "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$", "example": "04:30"}
}
},
"example": {"weekdays": [1, 3, 5], "start_time": "01:00", "end_time": "04:30"}
}
}
},
"responses": {"200": {"description": "周期设置成功"}}
}