
CodexandClaude Opus 4.7
74209035f7
拆分 douyin_reservation_logic (2702 → 7 个子模块 + 53 行 shim)
把 douyin/reservation/douyin_reservation_logic.py 按职责拆成
douyin/reservation/reservation_logic/ 子包:
- _common (57) 共享错误处理工具占位 + ReservationItem 类型
- helpers (130) 内部工具:标题归一化 / 相似度 / 排序 / 时间戳
- add (447) add_reservation_core_logic 主入口(添加新预约)
- cleanup_validate (136) validate_back_to_reservation / cleanup_expired_reservations
- queue_full (305) handle_queue_full_wait_at_earliest 队列满时等待策略
- attend_window (1437) process_reservation_attend_window 进入预约窗口(最大头)
- record (328) record_high_value_reservation 高价值预约登记入口
原文件改为 53 行 re-export shim,17 个公共符号全部保留。
- process_reservation_attend_window 7 处外部引用
- handle_queue_full_wait_at_earliest 5 处外部引用
- _now_ts 5 处 / cleanup_expired_reservations 4 处 / _sort_reservations_inplace 4 处
- 其他 5 处以下
全部不需修改。
回归:
- 8 个新文件 + shim compileall 通过
- pytest 353 passed / 1 skipped
- 旧 import 路径与新子包路径返回同一函数对象
- _now_ts / _normalize_room_title / _calculate_string_similarity 等纯函数
调用结果与拆分前一致
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 17:03:55 +08:00
..
2026-05-21 12:13:31 +08:00
2026-05-21 17:03:55 +08:00
2026-01-02 23:57:03 +08:00
2026-05-21 00:23:14 +08:00
2026-05-21 17:03:55 +08:00
2026-01-16 16:16:22 +08:00
2026-05-21 11:52:28 +08:00