docs/README: 更新"添加新功能"指引段
- 把"在项目根目录创建 douyin_xxx.py" 改为按职责放到对应子包 (douyin/core / douyin/fudai/core / douyin/detection 等) - 把 douyin_fudai.py 标题改为 douyin/core/douyin_fudai.py - 把 gui_app.py 标题改为 gui/gui_app.py - 集成 GUI 后建议跑 tools/diagnostics/check_web_gui_config_sync.py 校验 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
1 parent
20aefbb3a1
commit
e5c5ce06ee
1 file changed
+5
-3
@@ -1321,19 +1321,21 @@ python bin/run_cli.py \
|
||||
### 添加新功能
|
||||
|
||||
1. **创建新模块**
|
||||
- 在项目根目录创建 `douyin_xxx.py`
|
||||
- 按职责放到对应包:核心调度 → `douyin/core/`,福袋核心 → `douyin/fudai/core/`,
|
||||
检测 → `douyin/detection/`,处理器 → `douyin/handlers/`,工具 → `douyin/utils/` 等
|
||||
- 实现核心功能
|
||||
- 添加类型提示和文档字符串
|
||||
|
||||
2. **集成到主流程**
|
||||
- 在 `douyin_fudai.py` 中导入新模块
|
||||
- 在 `douyin/core/douyin_fudai.py` 中导入新模块
|
||||
- 在适当位置调用新功能
|
||||
- 添加配置参数(如需要)
|
||||
|
||||
3. **添加 GUI 支持**
|
||||
- 在 `gui_app.py` 中添加 UI 控件
|
||||
- 在 `gui/gui_app.py` 中添加 UI 控件
|
||||
- 在 `webui/index.html` 中添加配置项
|
||||
- 在 `webui/app.js` 中添加默认值
|
||||
- 用 `python tools/diagnostics/check_web_gui_config_sync.py` 校验 GUI ⇄ WebUI key 同步
|
||||
|
||||
4. **测试**
|
||||
- 编写单元测试(如需要)
|
||||
|
||||
Reference in new issue
Block a user