1
1
mirror of https://github.com/KenanZhu/AutoLibrary.git synced 2026-06-17 23:13:03 +08:00
Commit Graph

276 Commits

Author SHA1 Message Date
KenanZhu 72dce83c55 ci(workflows): 新增 macOS .app 与 .dmg 打包流程 2026-06-09 16:24:37 +08:00
Kenan Zhu c337904010 refactor(*): Page Object 架构迁移、AutoScript 引擎沙箱化与全项目代码规范化 (#9)
Page Object 架构迁移、AutoScript 引擎沙箱化与全项目代码规范化
2026-05-29 14:33:41 +08:00
KenanZhu 779aad13b8 refactor(gui): 简化关于对话框标签文字
SYSTEM INFORMATION → SYSTEM,
PROJECT INFORMATION → PROJECT

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 14:17:53 +08:00
KenanZhu f3360423e5 fix(build): 重命名 requirement.txt 并统一所有引用
- 重命名 requirement.txt → requirements.txt
- 更新 build.yml 和 build-test.yml 中的 pip cache 和
  install 路径引用
- README.md 恢复 pip install -r requirements.txt 构建步骤

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 14:16:35 +08:00
KenanZhu bea12d5f0c fix(docs): 更新手册域名并移除不存在的 requirements.txt 引用
- 手册 URL 已从 www.autolibrary.kenanzhu.com/manuals 迁移至
  manuals.autolibrary.kenanzhu.com
- 构建步骤中不再引用已不存在的 requirements.txt

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 14:12:06 +08:00
KenanZhu b24f39456e fix: 修复 Git 文件名大小写与文件系统不一致的问题
Windows 下 git core.ignorecase=true 导致文件重命名时 Git 无法
检测到大小写变化,推送后服务器上仍为旧命名。通过两步 git mv
强制更新索引,统一所有文件名为规范大小写。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 14:05:20 +08:00
KenanZhu bb63ee6f03 refactor(gui): 统一 Qt 控件变量命名风格为 PascalCase
将所有 self.xxx 形式的 Qt 控件属性名以及 Qt 对象局部变量由 snake_case
重命名为 PascalCase,提升代码可读性和一致性。涉及 14 个文件,涵盖:
- AutoScript 编排/编辑对话框子模块
- 配置/主窗口/用户树/座位图等核心界面组件
- 定时任务管理相关界面
- 状态标签/浏览器驱动下载对话框

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 19:35:03 +08:00
KenanZhu 3ebebe015f refactor(gui): 重构关于对话框,改用 QTabWidget 分页展示信息与许可证
将原本的单页文本浏览器替换为 TabWidget,分"关于"和"许可证"两个标签页。
同时优化了信息排版和样式,新增 Selenium 版本展示,移除了 UI 文件中的旧控件。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 19:34:36 +08:00
KenanZhu 02b3a62868 chore(autoscript): 添加模块版本号 v1.0.0
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 16:54:14 +08:00
KenanZhu d7e19dcd52 refactor(pages): 调整预约检查流程顺序,数据校验前置以避免无效浏览器操作
将 ReserveChecker.check(纯数据校验)移至 RecordChecker.canReserve(浏览器查询)之前,
解决 canReserve 在校验前使用未规范化日期的隐式缺陷,并避免无效配置触发昂贵的页面导航操作。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 11:33:17 +08:00
KenanZhu 59c06b3a19 fix(workflows): 修复图标引用、条件逻辑死代码并统一输出格式
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 02:49:46 +08:00
KenanZhu b78fd2d1e4 chore: 添加 AutoLibrary 应用图标资源
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 01:55:12 +08:00
KenanZhu 2aace40a26 fix(services): 修复验证码识别逻辑、预约时间校验与异常处理结构
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 01:36:28 +08:00
KenanZhu df7ad92f7f fix(pages): 移除裸 except Exception 改用精确异常类型并加固元素操作防护
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 01:36:18 +08:00
KenanZhu 910e3e3224 chore: 统一 __init__.py 许可头为版权声明并改用相对导入
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 01:35:55 +08:00
KenanZhu f7167c13f4 fix(ALAutoScript*Dialog): 统一编排窗口生成的 Lua 函数名与 ASEngine 运行时一致
- date_add → dateadd, time_add → timeadd
- CURRENT_DATE() → datenow(), CURRENT_TIME() → timenow()
- 编辑窗口 Date/Time 字面量按钮模板同步更新为 date()/time() 格式

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 20:25:19 +08:00
KenanZhu eb8da498a2 refactor(pages): 引入 Page Object 模式替代 operators/ 模块并移除旧代码
- 以 Page Object + Strategy + Flow 分层架构重写 pages/ 模块
- 将页面元素定位 (LoginPage/MainShell/ReserveView/RecordsView) 与业务编排 (ReserveFlow/CheckinFlow/RenewFlow) 分离
- 抽取 Dialog 上下文管理器统一弹窗生命周期,集成 TimeSelectMaker 策略模式处理时间选择
- 拆分 Service 层:CaptchaSolver、RecordChecker、ReserveChecker 独立可注入
- 统一闭馆时间为 TimeSelectMaker.LIBRARY_CLOSE_MINS (22:30)
- 移除旧 operators/ 模块及 base/LibOperator 层

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 20:07:42 +08:00
KenanZhu b279b51b42 refactor: 移除旧 operators/ 模块和 base/ 层
operators/ 模块已被 pages/ 模块完全替代,base/ 中的 LibOperator 和 MsgBase
不再被任何新代码引用。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 20:05:24 +08:00
KenanZhu 43336f98d2 fix: 统一闭馆时间为 TimeSelectMaker.LIBRARY_CLOSE_MINS (22:30)
ReserveChecker._finalCheck 中存在硬编码的 "23:30",与 TimeSelectMaker.LIBRARY_CLOSE_MINS (22:30)
不一致,导致校验阶段与选时阶段使用不同的闭馆时间上限。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 20:03:35 +08:00
KenanZhu e77c561685 refactor: 时间选择逻辑下沉至 Dialog、Worker 模板方法抽象、配置访问安全化与代码风格统一
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 19:54:26 +08:00
KenanZhu 345cb95b98 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>
2026-05-27 13:13:43 +08:00
KenanZhu caa563e770 refactor(pages): 统一命名规范并修复 SeatMapOverlay 元素等待目标错误
- AutoLibPages → AutoLib(移除实现细节后缀)
- ReserveValidator → ReserveChecker(与 RecordChecker 命名一致)
- CaptchaHandler → CaptchaSolver(语义更准确,职责是"求解"验证码)
- ReserveChecker.validate() → check()(与 RecordChecker 风格统一)
- 修复 SeatMapOverlay.selectSeat() 中 _waitClickable 等待页面全局
  <a> 而非具体 seat_link 元素的时序缺陷
- ALMainWorkers 切换为 pages.AutoLib 新版实现

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 20:52:52 +08:00
KenanZhu 280028259f refactor(pages): 将 LoginPage 日志回调从方法参数改为构造器注入
消除 login() 方法签名中的 tracer/log_level 参数,通过构造器可选注入
tracer 统一日志模式,避免 Page Object 对外暴露 MsgBase 内部细节。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 18:01:25 +08:00
KenanZhu a6bc103c73 refactor(pages): 拆分 _dialogs 为独立组件文件,解耦 Service 构造函数,消除 PageObject 重复逻辑
- 将 _dialogs.py 拆分为 pages/components/ 下的独立文件,Overlay 基类同步移入
- CaptchaHandler / RecordChecker 构造函数不再持有 PageObject,改为方法参数注入
- LoginPage.login() 直接接收 auto_captcha 参数,简化 captcha_solver 调用链
- SeatMapOverlay.selectSeat 引入两层查找:先按 ID 直查,失败后遍历匹配
- 移除 ReserveView 中与 Dialog/Overlay 重复的方法(selectSeat、getAvailableTimeOptions)
- AutoLibPages 拆分 __initPagesServices / __initPagesFlows
- 修复 RecordsView.MORE_BTN 选择器被错误 snake_case 化(more_btn → moreBtn)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 13:41:55 +08:00
KenanZhu 2226e8ac90 refactor(pages): 引入 Page Object 模式重构全部页面模块,变量统一为 snake_case
将原始 Selenium 操作脚本重构为三层 Page Object 架构:
- Page Objects(LoginPage/ReserveView/RecordsView/MainShell)
- Component Objects(Overlay 基类 + SeatMapOverlay/ReserveResultDialog 等对话框)
- Flow 状态机(ReserveFlow/CheckinFlow/RenewFlow)
- Services(CaptchaHandler/ReserveValidator/RecordChecker)

变量命名统一为 snake_case,方法名保持 camelCase,类名保持 PascalCase。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 12:39:21 +08:00
KenanZhu 106463b9e5 refactor(autoscript): 对象化 ASEngine、移除旧变量导出、清理编排窗口解析逻辑
- ASEngine 转为类,目标变量注册作为 __init__ 接口,配套函数提取到 _helpers.py
- Lua 函数重命名 CURRENT_DATE→datenow, CURRENT_TIME→timenow, date_add→dateadd 等
- __init__.py 移除 ALL_VARIABLES/_TARGET_VAR_DEFS/_MOCK_TYPE_VALUES 导出,替换为接口函数
- 编排窗口移除脚本→控件的反向解析逻辑,合并常量定义为查询接口
- 编辑窗口新增工具函数 Tab、Tab 键插入 4 空格、图标改用 setIcon 加载

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 19:10:07 +08:00
KenanZhu 5e898180c7 refactor(style): 统一项目代码风格,整理导入顺序、间距规范与方法排列
- GUI 模块统一 QtCore → QtGui → QtWidgets 导入排列,各类独占一行按字母排序
- 统一类间两空行、类内方法间一空行、函数间一空行的间距规范
- 统一方法排列顺序:__init__ → setupUi → connectSignals → public → Slot → private
- 统一 _widgets 中 ConditionRowFrame/ActionStepFrame 方法命名(populate* / toScript / updateValueWidget)
- LibTimeSelector 迁入 operators/abs 抽象层

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 13:14:27 +08:00
KenanZhu a03ab38279 refactor(autoscript): 完善 Lua 错误分类与 Date/Time 严格校验,清理死代码并补齐类型注解
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 01:02:17 +08:00
KenanZhu 4761cade26 refactor(gui): 统一资源路径前缀并更新新版 SVG Logo 2026-05-23 20:05:39 +08:00
KenanZhu 531b05651e refactor(gui): 重构更新 AutoLibrary Logo 样式为全新设计样式 2026-05-23 19:26:00 +08:00
KenanZhu 3cea7df736 refactor(gui): 编排编辑窗口适配 Lua 引擎新接口
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 18:22:49 +08:00
KenanZhu a0fd03f12f refactor(autoscript): ASEngine 迁移至 Lua 沙箱引擎,强化类型安全与异常处理
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 18:22:36 +08:00
KenanZhu 9b47886e5b fix(autoscript): SET 赋值强制强类型检查,禁止跨类型隐式转换
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 04:22:06 +08:00
KenanZhu 82738be99a feat(gui): 编辑窗口支持调试运行与动态模拟目标数据输入
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 04:21:52 +08:00
KenanZhu e097b5afc9 refactor(gui): 编排窗口简化为纯代码生成器,移除脚本解析与预检逻辑
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 04:21:40 +08:00
KenanZhu fe7453fe02 feat(gui): 编排窗口支持算术表达式解析与回显
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 00:27:59 +08:00
KenanZhu 1d4b03d162 feat(autoscript): 支持算术表达式与变量参与加减运算
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 00:27:43 +08:00
KenanZhu 4642916fd5 fix(gui): 修正编排窗口日期映射 CURRENT_DATE 误识别为前天的问题 2026-05-18 20:47:35 +08:00
KenanZhu 5800437ba2 fix(gui): 编排窗口代码生成统一使用 END IF 结束块 2026-05-18 20:43:48 +08:00
KenanZhu 23467c1d3d feat(autoscript): 支持 // 行内注释与完整注释行解析 2026-05-18 20:13:46 +08:00
KenanZhu b8c0a29c59 fix(gui): 调整定时任务对话框布局边距与间距 2026-05-18 17:59:04 +08:00
KenanZhu 87787ad3dc style(gui): 编辑器高亮配色更改为 VSCode C 风格并为布尔字面量独立配色 2026-05-18 17:59:00 +08:00
KenanZhu e800f6ece1 refactor(gui): 统一 setupUi 命名并调整按钮布局 2026-05-18 16:01:22 +08:00
KenanZhu 600a304ab8 style(gui): 规范编排对话框属性命名并消除冗余代码 2026-05-18 16:01:16 +08:00
KenanZhu c038c8005d refactor(autoscript): 公开 splitTopLevel 并导出常量,消除冗余委托与重复变量 2026-05-18 16:01:10 +08:00
KenanZhu 6cf182c8c8 refactor(gui): 编排窗口迁移至新包并移除旧的预览/编排对话框 2026-05-18 11:15:35 +08:00
KenanZhu 33c0f4414c fix(autoscript): 为异常添加行号信息并补充类型兼容性检查 2026-05-17 02:58:47 +08:00
KenanZhu 2843300cf9 refactor(autoscript): 使用观察者模式解耦解析与预检查/编排流程 2026-05-17 01:48:25 +08:00
KenanZhu 9bdc9a3de9 refactor(autoscript): 使用 ASTokenizer 和 NodeVisitor 重构解析与执行流程 2026-05-17 01:33:22 +08:00
KenanZhu 500ddd41c5 refactor(autoscript): 替换 dsl 包为 autoscript 引擎模块 2026-05-12 11:49:43 +08:00