chore: 删除抖音养号任务类型,平台只保留 generic_steps

tasks/douyin/(task_type=douyin_nurture)整体删除,唯一任务类型是 generic_steps。
所有默认值/文档/接口示例同步改成 generic_steps:

- tasks/:删 douyin 包;__init__ 只注册 generic;base.py/generic 注释改为照 generic 抄
- 默认值:core/models.py(列默认 + 旧 JSON 迁移默认)、core/task_manager.py TaskJob、
  web/tasks_api.py 建任务默认、static/admin/tasks.js 新建任务默认
- core/task_manager.py:去掉 douyin 专属的"清理废弃 comment 参数"迁移块,改为**启动时告警**
  仍残留已删类型的任务(只告警不改数据);run_job_now 对已删类型直接返回明确错误,
  不再"报已触发、线程里静默失败"
- 清理残留:douyin_running 状态位(无任何读取方)、core/__init__、core/actions/*、
  core/logger.py 注释里的抖音示例
- 文档:README(特性/目录树/类型表/参数表/示例)、TASK_DEV(目录树/注册说明/模板引用)、
  ARCHITECTURE(注册示例/action 注册表示例)、API.md(task_types 与任务 JSON 示例)、
  AI_TASK_GEN(P1 去掉 douyin 预设)、DEVELOPMENT
- 注:示例里"抖音"作为**App 名**(MCP 列应用、AI 建任务的需求举例)保留,与任务类型无关

自测(全部通过):类型列表只剩 generic_steps;建任务不传类型默认 generic_steps;传
douyin_nurture 被 400 拒;库里塞残留旧类型任务 → 启动日志告警 + 执行返回明确错误 +
不自动删用户数据;前端新建任务下拉 1 项且默认选中、界面建任务成功;监控页卡片两个按钮 +
覆盖设备正常。临时任务/数据验完已清理,任务集合复原。
This commit is contained in:
2026-09-10 21:43:08 +08:00
parent 86c65236a2
commit 98cdc39224
23 changed files with 75 additions and 555 deletions
+7 -13
View File
@@ -141,7 +141,7 @@
"counts": {"total": 8, "running": 1, "done": 5, "error": 1, "failed": 1, "idle": 0},
"errors": [
{"serial": "192.168.1.100:5555", "model": "Pixel 6", "status": "failed",
"last_error": "重试3次失败", "task": "抖音养号", "attempt": 3, "updated": 1700000000.0}
"last_error": "重试3次失败", "task": "刷视频-上午", "attempt": 3, "updated": 1700000000.0}
]
}
```
@@ -218,12 +218,6 @@
{
"ok": true,
"task_types": [
{
"task_type": "douyin_nurture",
"name": "抖音养号",
"description": "自动观看抖音视频...",
"default_params": {"watch_count": 80, "...": "..."}
},
{
"task_type": "generic_steps",
"name": "通用步骤",
@@ -265,7 +259,7 @@
```json
{
"ok": true,
"jobs": [{"id": "abc123", "name": "抖音养号", "task_type": "douyin_nurture",
"jobs": [{"id": "abc123", "name": "刷视频-上午", "task_type": "generic_steps",
"next_run": "2026-08-12 09:00",
"coverage": {"mode": "all", "total": 3,
"serials": ["192.168.20.206:5555", "..."]},
@@ -296,10 +290,10 @@
**请求**(JSON):
```json
{
"name": "抖音养号",
"task_type": "douyin_nurture",
"name": "刷视频-上午",
"task_type": "generic_steps",
"target": {"mode": "all"},
"params": {"watch_count": 50, "actions": {"like": {"params": {"rate": 0.5}}}},
"params": {"max_duration": 0, "steps": [{"type": "open_app", "params": {"package": "com.ss.android.ugc.aweme"}}]},
"schedule": {"mode": "cron", "cron": "0 */2 * * *"},
"retry": {"max_attempts": 3, "delay": 60},
"enabled": true
@@ -327,7 +321,7 @@
**请求**(JSON):
```json
{"params": {"watch_count": 100}}
{"params": {"max_duration": 1800}}
```
**响应**:
@@ -354,7 +348,7 @@
**响应**:
```json
{"ok": true, "msg": "任务 抖音养号 已触发"}
{"ok": true, "msg": "任务 刷视频-上午 已触发"}
```
### POST /api/jobs/<job_id>/toggle