feat(platforms): 增加能力推导与 /api/platforms capabilities 字段

新增 platforms/contract.py:生命周期 ↔ 槽位 ↔ 能力名映射,capabilities_of 按非空槽位推导;Platform.capabilities() 供 /api/platforms 返回 capabilities。行为不变,现有流程与前端未改。同步 architecture.md(生命周期与能力、广东公需课)、todo 第二/三步、OPTIMIZATION 平台列表。
This commit is contained in:
study-tool
2026-10-31 13:54:28 +08:00
parent 0e2923e675
commit d702830470
6 changed files with 68 additions and 5 deletions
+1 -1
View File
@@ -8,7 +8,7 @@
### 做了什么
- 「添加账号」弹窗最上面新增「学习平台」下拉,选项来自 `GET /api/platforms`(当前只有「莞易学」)。
- 「添加账号」弹窗最上面新增「学习平台」下拉,选项来自 `GET /api/platforms`(当前有「莞易学」「广东公需课」)。
- 账号记录新增 `platform` 字段(SQLite 老库启动时自动 `ALTER TABLE` 补列)。
- 登录(`/api/login`)、刷新课程(`/api/courses`)、发现课程(`/api/discover`、`/api/quiz`)、
开始学习(引擎 `run_one_course`)都按账号所选平台取 `Platform` 上的实现;选「莞易学」时