2026-08-04 14:02:45 +08:00
|
|
|
|
{
|
|
|
|
|
|
"openapi": "3.0.3",
|
|
|
|
|
|
"info": {
|
|
|
|
|
|
"title": "Holy蟹业务任务接口",
|
|
|
|
|
|
"version": "1.1.0",
|
|
|
|
|
|
"description": "前端调用的业务后端任务接口。继续采集沿用原任务 ID;重新采集创建新任务。"
|
|
|
|
|
|
},
|
|
|
|
|
|
"servers": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"url": "http://127.0.0.1:8000",
|
|
|
|
|
|
"description": "本地业务后端,请在 Apifox 环境中改成实际地址"
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"paths": {
|
2026-08-28 13:43:53 +08:00
|
|
|
|
"/api/v1/acceptance-tasks": {
|
|
|
|
|
|
"post": {
|
|
|
|
|
|
"summary": "创建项目验收任务",
|
|
|
|
|
|
"description": "关键词截图取证必须填写 keywords,无需飞书链接;笔记收录必须填写 feishu_links,可选传入仅供本任务使用的 custom_cookie。",
|
|
|
|
|
|
"tags": ["项目验收"],
|
|
|
|
|
|
"requestBody": {
|
|
|
|
|
|
"required": true,
|
|
|
|
|
|
"content": {
|
|
|
|
|
|
"application/json": {
|
|
|
|
|
|
"schema": {"$ref": "#/components/schemas/CreateAcceptanceTask"}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"responses": {"201": {"description": "验收任务创建成功"}}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"/api/v1/acceptance-tasks/{task_id}/collect-now": {
|
|
|
|
|
|
"post": {
|
|
|
|
|
|
"summary": "立即采集并下发指令",
|
|
|
|
|
|
"description": "复用原任务配置创建独立的新一轮采集。截图取证会立即请求 Framework 下发设备指令。",
|
|
|
|
|
|
"tags": ["项目验收"],
|
|
|
|
|
|
"parameters": [{"$ref": "#/components/parameters/TaskId"}],
|
|
|
|
|
|
"responses": {"201": {"description": "新一轮验收任务已创建"}}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"/api/v1/acceptance-tasks/{task_id}/schedule": {
|
|
|
|
|
|
"put": {
|
|
|
|
|
|
"summary": "设置每周采集周期",
|
|
|
|
|
|
"description": "按 Asia/Shanghai 时区,在指定星期的 00:00 创建新一轮采集。",
|
|
|
|
|
|
"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=周日"}}}}}
|
|
|
|
|
|
},
|
|
|
|
|
|
"responses": {"200": {"description": "周期设置成功"}}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"/api/v1/acceptance-tasks/{task_id}/schedule/stop": {
|
|
|
|
|
|
"post": {
|
|
|
|
|
|
"summary": "停止周期采集",
|
|
|
|
|
|
"description": "关闭该任务后续的每周执行,不影响已经开始的采集任务。",
|
|
|
|
|
|
"tags": ["项目验收"],
|
|
|
|
|
|
"parameters": [{"$ref": "#/components/parameters/TaskId"}],
|
|
|
|
|
|
"responses": {"200": {"description": "周期采集已停止"}}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2026-08-04 14:02:45 +08:00
|
|
|
|
"/api/v1/tasks/{task_id}/cancel": {
|
|
|
|
|
|
"post": {
|
|
|
|
|
|
"summary": "停止任务",
|
|
|
|
|
|
"tags": ["问一问任务控制"],
|
|
|
|
|
|
"parameters": [{"$ref": "#/components/parameters/TaskId"}],
|
|
|
|
|
|
"requestBody": {
|
|
|
|
|
|
"required": false,
|
|
|
|
|
|
"content": {
|
|
|
|
|
|
"application/json": {
|
|
|
|
|
|
"schema": {"type": "object", "properties": {"reason": {"type": "string"}}},
|
|
|
|
|
|
"example": {"reason": "用户主动取消"}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"responses": {"200": {"description": "停止请求成功"}}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"/api/v1/tasks/{task_id}/retry": {
|
|
|
|
|
|
"post": {
|
|
|
|
|
|
"summary": "继续采集(兼容路径)",
|
|
|
|
|
|
"description": "沿用业务任务 ID 和爬虫任务 ID,从 framework 检查点继续。",
|
|
|
|
|
|
"tags": ["问一问任务控制"],
|
|
|
|
|
|
"parameters": [{"$ref": "#/components/parameters/TaskId"}],
|
|
|
|
|
|
"responses": {"200": {"description": "恢复成功"}}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"/api/v1/tasks/{task_id}/resume": {
|
|
|
|
|
|
"post": {
|
|
|
|
|
|
"summary": "继续采集",
|
|
|
|
|
|
"description": "沿用业务任务 ID 和爬虫任务 ID,从 framework 检查点继续。",
|
|
|
|
|
|
"tags": ["问一问任务控制"],
|
|
|
|
|
|
"parameters": [{"$ref": "#/components/parameters/TaskId"}],
|
|
|
|
|
|
"responses": {"200": {"description": "恢复成功"}}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"/api/v1/tasks/{task_id}/recollect": {
|
|
|
|
|
|
"post": {
|
|
|
|
|
|
"summary": "重新全量采集",
|
|
|
|
|
|
"description": "复制原任务配置,创建新的业务任务 ID 和爬虫任务 ID,从头执行。",
|
|
|
|
|
|
"tags": ["问一问任务控制"],
|
|
|
|
|
|
"parameters": [{"$ref": "#/components/parameters/TaskId"}],
|
|
|
|
|
|
"responses": {"201": {"description": "新任务创建成功"}}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"components": {
|
2026-08-28 13:43:53 +08:00
|
|
|
|
"schemas": {
|
|
|
|
|
|
"CreateAcceptanceTask": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"required": ["acceptance_method"],
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"name": {"type": "string"},
|
|
|
|
|
|
"acceptance_method": {"type": "string", "enum": ["screenshot", "data-analysis"]},
|
|
|
|
|
|
"feishu_links": {
|
|
|
|
|
|
"type": "array",
|
|
|
|
|
|
"items": {"type": "string", "format": "uri"},
|
|
|
|
|
|
"description": "笔记收录必填;关键词截图取证可为空。"
|
|
|
|
|
|
},
|
|
|
|
|
|
"keywords": {
|
|
|
|
|
|
"type": "array",
|
|
|
|
|
|
"maxItems": 20,
|
|
|
|
|
|
"items": {"type": "string"},
|
|
|
|
|
|
"description": "关键词截图取证至少填写 1 个;笔记收录选填。"
|
|
|
|
|
|
},
|
|
|
|
|
|
"device_count": {"type": "integer", "minimum": 1},
|
|
|
|
|
|
"custom_cookie": {
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"maxLength": 16384,
|
|
|
|
|
|
"writeOnly": true,
|
|
|
|
|
|
"description": "仅用于笔记收录。填写后仅使用该 Cookie;留空时使用 Cookie 池全部可用凭据。不会在任务详情中返回。"
|
|
|
|
|
|
},
|
|
|
|
|
|
"created_by_id": {"type": "string"},
|
|
|
|
|
|
"created_by_name": {"type": "string"}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2026-08-04 14:02:45 +08:00
|
|
|
|
"parameters": {
|
|
|
|
|
|
"TaskId": {
|
|
|
|
|
|
"name": "task_id",
|
|
|
|
|
|
"in": "path",
|
|
|
|
|
|
"required": true,
|
|
|
|
|
|
"description": "Holy蟹业务任务 ID,例如 HC-20260723-ABCDE",
|
|
|
|
|
|
"schema": {"type": "string"}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|