From ae3f276f5695c5542fc83a8005f625f598ddc86e Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 21 May 2026 13:13:07 +0800 Subject: [PATCH] =?UTF-8?q?docs/README:=20=E6=9B=B4=E6=96=B0=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E8=AF=B4=E6=98=8E=E6=AE=B5=E5=8F=8D=E6=98=A0=E9=87=8D?= =?UTF-8?q?=E6=9E=84=E5=90=8E=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修订"代码结构 > 核心模块说明"段中的过期内容: - douyin/logging/:把已删的 douyin_logger.py 替换为现存的 unified_logger.py / internal_loggers.py / action_logger.py / log_formatter.py / performance_tracker.py - path_config.py:标题改为 douyin/core/path_config.py,补 get_high_value_rooms_path - operations/:删掉已不存在的 device_operations.py,明确这是向后兼容包装层 - Underlying_Operations.py:标题改为 douyin/core/underlying_operations.py - gui_app.py / web_gui.py:标题改为 gui/.py(实现) + bin/.py(启动器) - run_cli.py:标题改为 bin/run_cli.py - 补 bin/manage_logs.py 子段 - tools/:示例改成现实存在的 tools/diagnostics/ tools/coords/ 路径 - version.py:标题改为 douyin/core/version.py douyin/other/:补登 douyin_high_value_room / douyin_live_room / douyin_lottery 三个模块 Co-Authored-By: Claude Opus 4.7 --- README.md | 46 +++++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index faab086..e062142 100644 --- a/README.md +++ b/README.md @@ -1034,9 +1034,12 @@ python bin/run_cli.py \ - **`douyin_reservation_handler.py`**:预约处理逻辑 #### `douyin/logging/` - 日志模块 -- **`douyin_logging.py`**:统一日志系统 +- **`douyin_logging.py`**:统一日志系统(配置 / 轮转 / 监控) - **`douyin_logging_wrapper.py`**:日志包装器,支持行为日志(actions.log) -- **`douyin_logger.py`**:日志器实现 +- **`unified_logger.py`**:MDC + 装饰器 +- **`internal_loggers.py`**:ErrorLogger / DebugLogger(合并自旧 `error_logger.py` + `debug_logger.py`) +- **`action_logger.py`**:行为日志写入器 +- **`log_formatter.py`** / **`performance_tracker.py`**:格式化与性能追踪 #### `douyin/other/` - 其他功能模块 - **`douyin_yanghao.py`**:推荐页养号逻辑 @@ -1046,8 +1049,9 @@ python bin/run_cli.py \ - `check_have_robot_analyse()`:检测人机验证 - `deal_robot_analyse()`:处理人机验证 - **`douyin_popups.py`**:弹窗检测(兼容旧代码) +- **`douyin_high_value_room.py`** / **`douyin_live_room.py`** / **`douyin_lottery.py`**:高价值直播间 / 直播间工具 / 抽奖辅助 -#### `path_config.py` - 路径配置模块 +#### `douyin/core/path_config.py` - 路径配置模块 - **职责**:统一管理所有文件路径 - **主要函数**: - `get_project_root()`:项目根目录 @@ -1057,16 +1061,20 @@ python bin/run_cli.py \ - `get_logs_dir()`:日志目录 - `get_actions_log_path()`:行为日志路径 - `get_state_dir()`:状态文件目录 - - `get_reservations_path()`:预约状态文件路径 + - `get_reservations_path()`:预约状态文件路径(实际位置在 `douyin/core/state/reservations.json`) + - `get_high_value_rooms_path()`:高价值直播间状态文件路径 - **优势**:统一路径管理,便于维护和迁移 -#### `operations/` - 底层操作模块 -- **`device_operations.py`**:设备连接和操作 -- **`screenshot_operations.py`**:截图获取和处理 -- **`ocr_operations.py`**:OCR 识别操作 +#### `operations/` - 底层操作模块(向后兼容包装) +- **`ocr_operations.py`**:OCR 识别操作(PaddleOCR / EasyOCR 切换) +- **`screenshot_operations.py`**:截图获取和处理(exec-out / 回退 pull) +- **`screenshot_service.py`**:后台截图服务 +- 包 `__init__.py` 同时从 `douyin/core/underlying_operations.py` 再导出 + `_safe_replace_file` / `_ensure_parent_dir` / `_mirror_screenshot_to_external` / + `underlying_operations` 等符号,保持下游代码不破坏。 -#### `Underlying_Operations.py` -- **职责**:底层操作封装(兼容旧代码) +#### `douyin/core/underlying_operations.py` +- **职责**:底层设备 / 截图 / OCR / 文件操作总入口(旧位置:仓库根 `Underlying_Operations.py`) - **主要类**:`underlying_operations` - **主要方法**: - `get_screenshot()`:获取截图 @@ -1076,7 +1084,7 @@ python bin/run_cli.py \ ### 界面模块 -#### `gui_app.py` +#### `gui/gui_app.py`(实现) + `bin/gui_app.py`(启动器) - **职责**:桌面 GUI 应用 - **技术栈**:tkinter + ttkbootstrap - **主要功能**: @@ -1085,9 +1093,9 @@ python bin/run_cli.py \ - 实时日志显示 - 截图预览 -#### `web_gui.py` +#### `gui/web_gui.py`(实现) + `bin/webgui_launcher.py`(启动器) - **职责**:Web GUI 服务 -- **技术栈**:Python HTTP Server +- **技术栈**:Python `http.server`(ThreadingHTTPServer) - **主要功能**: - RESTful API - 实时日志推送 @@ -1103,18 +1111,22 @@ python bin/run_cli.py \ ### 工具模块 -#### `run_cli.py` +#### `bin/run_cli.py` - **职责**:命令行入口 - **主要功能**: - 参数解析 - 配置覆盖 - 进程管理 +#### `bin/manage_logs.py` +- **职责**:日志管理 CLI(统计 / 清理 / 压缩 / 监控) + #### `tools/` - **职责**:开发和测试工具 - **主要脚本**: - - `test_web_gui.py`:Web GUI 自动化测试 - - `pick_coords.py`:坐标选择工具 + - `tools/diagnostics/check_web_gui_config_sync.py`:GUI / WebUI 配置项同步检查 + - `tools/coords/pick_coords.py`:坐标选择工具 + - 还按 `cleanup/` `coords/` `dev/` `diagnostics/` `logs/` `windows/` 分组归类 ### 配置文件 @@ -1123,7 +1135,7 @@ python bin/run_cli.py \ - **格式**:JSON - **说明**:详见"详细配置说明"章节 -#### `version.py` +#### `douyin/core/version.py` - **职责**:版本信息管理 - **内容**:版本号、发布日期等