docs: 全文档合规检查与修正 - 代码示例规范/行数准确性/路径一致性/状态同步
This commit is contained in:
@@ -4316,7 +4316,7 @@
|
||||
"files": [
|
||||
{
|
||||
"path": "data-access.ts",
|
||||
"lines": 656,
|
||||
"lines": 548,
|
||||
"description": "核心班级 CRUD + 邀请码 + 教师班级管理(含 re-export 向后兼容)",
|
||||
"exports": [
|
||||
"getTeacherClasses",
|
||||
@@ -4344,7 +4344,7 @@
|
||||
},
|
||||
{
|
||||
"path": "data-access-stats.ts",
|
||||
"lines": 604,
|
||||
"lines": 531,
|
||||
"description": "作业统计查询(班级/年级作业洞察)",
|
||||
"exports": [
|
||||
"getClassHomeworkInsights",
|
||||
@@ -4354,7 +4354,7 @@
|
||||
},
|
||||
{
|
||||
"path": "data-access-schedule.ts",
|
||||
"lines": 230,
|
||||
"lines": 194,
|
||||
"description": "课表查询(学生/班级课表 CRUD)",
|
||||
"exports": [
|
||||
"getStudentSchedule",
|
||||
@@ -4366,7 +4366,7 @@
|
||||
},
|
||||
{
|
||||
"path": "data-access-students.ts",
|
||||
"lines": 280,
|
||||
"lines": 244,
|
||||
"description": "学生相关查询(科目成绩、学生名单、学生班级)",
|
||||
"exports": [
|
||||
"getStudentsSubjectScores",
|
||||
@@ -4377,7 +4377,7 @@
|
||||
},
|
||||
{
|
||||
"path": "data-access-admin.ts",
|
||||
"lines": 441,
|
||||
"lines": 406,
|
||||
"description": "管理员班级管理(管理员班级 CRUD、年级管理班级查询)",
|
||||
"exports": [
|
||||
"getAdminClasses",
|
||||
@@ -11216,7 +11216,7 @@
|
||||
"suggestion": "按职责拆分为 class-query/schedule/homework-insights/grade-query",
|
||||
"status": "resolved",
|
||||
"resolvedAt": "2026-06-17",
|
||||
"resolution": "拆分为 5 个文件:data-access.ts(656行,核心CRUD+邀请码+教师班级管理) + data-access-stats.ts(604行,作业统计) + data-access-schedule.ts(230行,课表) + data-access-students.ts(280行,学生查询) + data-access-admin.ts(441行,管理员班级管理),所有文件均 ≤800 行,data-access.ts 通过 re-export 保持向后兼容"
|
||||
"resolution": "拆分为 5 个文件:data-access.ts(548行,核心CRUD+邀请码+教师班级管理) + data-access-stats.ts(531行,作业统计) + data-access-schedule.ts(194行,课表) + data-access-students.ts(244行,学生查询) + data-access-admin.ts(406行,管理员班级管理),所有文件均 ≤800 行,data-access.ts 通过 re-export 保持向后兼容"
|
||||
},
|
||||
{
|
||||
"id": "P0-2",
|
||||
@@ -11228,7 +11228,7 @@
|
||||
"suggestion": "分离排名逻辑到独立文件(如 data-access-ranking.ts)",
|
||||
"status": "resolved",
|
||||
"resolvedAt": "2026-06-17",
|
||||
"resolution": "拆分为 data-access.ts(596行) + stats-service.ts(346行),统计函数(getTeacherGradeTrends/getHomeworkAssignmentAnalytics/getStudentDashboardGrades)迁移至 stats-service.ts,data-access.ts 通过 re-export 保持向后兼容"
|
||||
"resolution": "拆分为 data-access.ts(598行) + stats-service.ts(425行),统计函数(getTeacherGradeTrends/getHomeworkAssignmentAnalytics/getStudentDashboardGrades)迁移至 stats-service.ts,data-access.ts 通过 re-export 保持向后兼容"
|
||||
},
|
||||
{
|
||||
"id": "P0-3",
|
||||
@@ -11281,7 +11281,7 @@
|
||||
"suggestion": "将 DB 操作下沉到 data-access 层",
|
||||
"status": "resolved",
|
||||
"resolvedAt": "2026-06-17",
|
||||
"resolution": "4 个模块的 actions 层 DB 操作全部下沉到 data-access:exams 新增 7 个 data-access 函数(actions.ts 831→766 行,data-access.ts 374→524 行);homework 新建 data-access-write.ts(285 行,10 个写函数,actions.ts 387→239 行);questions 新增 4 个 data-access 函数(actions.ts 294→177 行,data-access.ts 138→299 行);announcements 新增 5 个 data-access 函数(actions.ts 242→231 行,data-access.ts 120→186 行)。users/scheduling 待后续处理"
|
||||
"resolution": "4 个模块的 actions 层 DB 操作全部下沉到 data-access:exams 新增 7 个 data-access 函数(actions.ts 831→691 行,data-access.ts 374→471 行);homework 新建 data-access-write.ts(285 行,10 个写函数,actions.ts 387→239 行);questions 新增 4 个 data-access 函数(actions.ts 294→149 行,data-access.ts 138→260 行);announcements 新增 5 个 data-access 函数(actions.ts 242→197 行,data-access.ts 120→171 行)。users/scheduling 待后续处理"
|
||||
},
|
||||
{
|
||||
"id": "P1-3",
|
||||
@@ -11291,7 +11291,7 @@
|
||||
"problem": "NextAuth 配置 + 密码安全 DB 操作 + 角色规范化 + IP 解析 + 回调函数混合",
|
||||
"suggestion": "拆分为 auth-config/password-security/role-normalizer/ip-utils 等多文件",
|
||||
"status": "resolved",
|
||||
"resolution": "已拆分:密码安全DB操作→shared/lib/password-security-service.ts,角色规范化→shared/lib/role-utils.ts,bcrypt哈希规范化→shared/lib/bcrypt-utils.ts,IP解析→shared/lib/http-utils.ts。auth.ts 现 208 行仅保留 NextAuth 配置"
|
||||
"resolution": "已拆分:密码安全DB操作→shared/lib/password-security-service.ts,角色规范化→shared/lib/role-utils.ts,bcrypt哈希规范化→shared/lib/bcrypt-utils.ts,IP解析→shared/lib/http-utils.ts。auth.ts 现 193 行仅保留 NextAuth 配置"
|
||||
},
|
||||
{
|
||||
"id": "P1-4",
|
||||
@@ -11328,7 +11328,7 @@
|
||||
"suggestion": "按职责拆分为 ai/ 目录多文件",
|
||||
"status": "resolved",
|
||||
"resolvedAt": "2026-06-17",
|
||||
"resolution": "已拆分为 src/shared/lib/ai/ 目录:payload-parser.ts(96 行,请求负载解析) + api-key-crypto.ts(34 行,API Key 加密/解密) + provider-config.ts(66 行,Provider 配置查询) + client.ts(67 行,AI 客户端创建与调用) + errors.ts(9 行,错误格式化) + index.ts(7 行,聚合导出)。原 ai.ts 保留为向后兼容的重导出文件(12 行)"
|
||||
"resolution": "已拆分为 src/shared/lib/ai/ 目录:payload-parser.ts(78 行,请求负载解析) + api-key-crypto.ts(28 行,API Key 加密/解密) + provider-config.ts(61 行,Provider 配置查询) + client.ts(58 行,AI 客户端创建与调用) + errors.ts(8 行,错误格式化) + index.ts(5 行,聚合导出)。原 ai.ts 保留为向后兼容的重导出文件(9 行)"
|
||||
}
|
||||
],
|
||||
"routes": {
|
||||
|
||||
Reference in New Issue
Block a user