holy后端

This commit is contained in:
2026-08-04 14:02:45 +08:00
commit 175b38138e
25 changed files with 3752 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
{
"openapi": "3.0.3",
"info": {
"title": "Holy蟹业务任务接口",
"version": "1.1.0",
"description": "前端调用的业务后端任务接口。继续采集沿用原任务 ID重新采集创建新任务。"
},
"servers": [
{
"url": "http://127.0.0.1:8000",
"description": "本地业务后端,请在 Apifox 环境中改成实际地址"
}
],
"paths": {
"/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": {
"parameters": {
"TaskId": {
"name": "task_id",
"in": "path",
"required": true,
"description": "Holy蟹业务任务 ID例如 HC-20260723-ABCDE",
"schema": {"type": "string"}
}
}
}
}