docs(textbooks): 新增教材模块审计报告并同步架构图

- 新增 docs/architecture/audit/textbooks-audit-report.md,覆盖三层架构、权限、i18n、类型安全、错误边界、组件复用、a11y、可测试性、性能、安全等维度的审计,并给出 P0/P1/P2 改进优先级与重构方案要点

- 同步 004 架构影响地图 §2.5:修正 actions/data-access 行数与导出函数名(移除不存在的读 Action,补充 reorderChaptersAction),补充跨模块 UI 依赖、已知问题清单

- 同步 005 架构数据 JSON:补充 getKnowledgePointOptions 跨模块接口、uiDeps、knownIssues、auditReport 字段,修正 getTextbooks/getTextbookById 的 usedBy 以包含学生端页面
This commit is contained in:
SpecialX
2026-06-22 15:38:26 +08:00
parent 30f4983d49
commit 2548f70f40
3 changed files with 575 additions and 12 deletions

View File

@@ -4076,14 +4076,16 @@
"name": "getTextbooks",
"signature": "(query?, subject?, grade?) => Promise<Textbook[]>",
"usedBy": [
"teacher/textbooks/page.tsx"
"teacher/textbooks/page.tsx",
"student/learning/textbooks/page.tsx"
]
},
{
"name": "getTextbookById",
"signature": "(id) => Promise<Textbook | undefined>",
"usedBy": [
"teacher/textbooks/[id]/page.tsx"
"teacher/textbooks/[id]/page.tsx",
"student/learning/textbooks/[id]/page.tsx"
]
},
{
@@ -4194,6 +4196,14 @@
"usedBy": [
"dashboard/data-access.getAdminDashboardData"
]
},
{
"name": "getKnowledgePointOptions",
"signature": "() => Promise<KnowledgePointOption[]>",
"purpose": "跨模块接口:获取所有知识点选项(含章节/教材信息),供 questions 模块调用",
"usedBy": [
"questions/data-access.getKnowledgePointOptions"
]
}
],
"hooks": [
@@ -4350,7 +4360,29 @@
"name": "TextbookSettingsDialog",
"purpose": "教材设置对话框"
}
]
],
"uiDeps": [
{
"from": "textbooks/components/knowledge-point-dialogs.tsx",
"to": "questions/components/create-question-dialog",
"status": "P0 待解耦(直接 import 跨模块业务组件,应改为 props/Context 注入)",
"auditRef": "audit/textbooks-audit-report.md §2.1.1"
}
],
"knownIssues": [
"P0 跨模块 UI 依赖knowledge-point-dialogs.tsx 直接 import questions 模块 CreateQuestionDialog",
"P0 前端权限硬编码canEdit={true} 按路由写死,未用 usePermission().hasPermission()",
"P0 全模块零 i18n中英文文案硬编码未接入 next-intl",
"P1 Server Action 未校验资源归属chapterId 是否属于 textbookId",
"P1 data-access 缺数据范围过滤(学生端未按年级过滤)",
"P1 缺 Error Boundary无 error.tsx",
"P1 知识点列表/弹窗重复实现knowledge-point-panel.tsx 无调用方)",
"P1 学科/年级选项硬编码三处且彼此不一致",
"P1 纯逻辑未导出,零单测",
"P2 类型断言chapter-sidebar-list.tsx 用 ! 、knowledge-graph.tsx 用 as+!",
"P2 删除确认不一致textbook-settings-dialog 用 confirm(),其余用 AlertDialog"
],
"auditReport": "audit/textbooks-audit-report.md"
}
},
"classes": {