1
1
mirror of https://github.com/KenanZhu/AutoLibrary.git synced 2026-06-18 15:33:03 +08:00

refactor(pages): 抽取时间选择策略为 TimeSelectMaker,将 Overlay 基类更名为 Dialog

将 findBestTimeOption 中的预约/续约双分支逻辑抽象为策略模式:
- TimeOptionReader 负责从 WebElement 提取时间数据(ReserveTimeReader / RenewTimeReader)
- TimeDecisionMaker 执行纯决策算法,零 Selenium 依赖
- TimeSelectMaker 作为工厂统一创建配置好的决策器
- 共享常量 LIBRARY_CLOSE_MINS 统一收敛至 TimeSelectMaker

同时将 Overlay 基类重命名为 Dialog,SeatMapOverlay 同步更名为 SeatMapDialog,保持命名一致性。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-27 13:13:43 +08:00
parent caa563e770
commit 345cb95b98
14 changed files with 244 additions and 114 deletions
+3 -3
View File
@@ -18,7 +18,7 @@ from selenium.common.exceptions import (
TimeoutException,
)
from pages.components.SeatMapOverlay import SeatMapOverlay
from pages.components.SeatMapDialog import SeatMapDialog
from pages.components.ReserveResultDialog import ReserveResultDialog
@@ -124,9 +124,9 @@ class ReserveView:
def openSeatMap(
self,
) -> SeatMapOverlay:
) -> SeatMapDialog:
return SeatMapOverlay(self._driver)
return SeatMapDialog(self._driver)
def submitReserve(
self,