kindergarten_java/docs/dev-logs/2026-02-14.md
En 6e11c874d2 chore: 忽略 target 目录和 .class 文件
- 添加 target/ 到 .gitignore
- 从 git 暂存区移除已追踪的 target 目录

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 16:50:54 +08:00

168 lines
4.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 开发日志 - 2026年2月14日
## 今日工作概要
完成P0和P1优先级功能开发包括学校端核心管理模块、教师端首页数据、以及四个P1扩展功能资源库、成长档案、阅读任务、课程反馈
## 详细工作内容
### 1. P0核心功能 - 学校端管理模块
**新增模块**: `src/modules/school/`
| 功能 | 控制器 | 服务 | API端点 |
|-----|-------|------|---------|
| 教师管理 | school.controller.ts | school.service.ts | `/school/teachers` |
| 学生管理 | student.controller.ts | student.service.ts | `/school/students` |
| 班级管理 | school.controller.ts | school.service.ts | `/school/classes` |
| 统计数据 | stats.controller.ts | stats.service.ts | `/school/stats` |
| 套餐信息 | package.controller.ts | - | `/school/package` |
**核心API端点**:
```
# 教师管理
GET/POST /school/teachers
GET/PUT/DELETE /school/teachers/:id
POST /school/teachers/:id/reset-password
# 学生管理
GET/POST /school/students
GET/PUT/DELETE /school/students/:id
POST /school/students/import
# 班级管理
GET/POST /school/classes
GET/PUT/DELETE /school/classes/:id
# 统计数据
GET /school/stats
GET /school/stats/teachers
GET /school/stats/courses
```
### 2. P0核心功能 - 教师端首页API
**更新模块**: `src/modules/teacher-course/`
新增API端点:
```
GET /teacher/dashboard # 首页全部数据
GET /teacher/dashboard/today # 今日课程
GET /teacher/dashboard/recommend # 推荐课程
GET /teacher/dashboard/weekly # 本周统计
```
### 3. 登录功能修复
**问题**: 学校端登录失败,租户使用中文名称作为账号
**解决方案**:
1. 数据库Schema更新 - Tenant模型添加字段:
```prisma
loginAccount String? @unique @map("login_account")
passwordHash String? @map("password_hash")
```
2. 认证服务更新 - `auth.service.ts`:
```typescript
// 使用 loginAccount 查询bcrypt 验证密码
const tenant = await this.prisma.tenant.findUnique({
where: { loginAccount: account },
});
const isValid = await bcrypt.compare(password, tenant.passwordHash);
```
**测试账号**:
- 学校端: school1 / 123456
- 教师端: teacher1 / 123456
- 超管端: admin / 123456
### 4. P1功能 - 资源库管理
**新增模块**: `src/modules/resource/`
数据库表:
```prisma
model ResourceLibrary {
id Int @id @default(autoincrement())
name String
libraryType String @map("library_type") // PICTURE_BOOK, MATERIAL, TEMPLATE
description String?
coverImage String? @map("cover_image")
tenantId Int? @map("tenant_id")
createdBy Int @map("created_by")
status String @default("PUBLISHED")
items ResourceItem[]
}
```
### 5. P1功能 - 成长档案
**新增模块**: `src/modules/growth/`
API端点:
```
# 学校端
GET/POST /school/growth-records
GET/PUT/DELETE /school/growth-records/:id
# 教师端
GET/POST /teacher/growth-records
GET/PUT/DELETE /teacher/growth-records/:id
```
### 6. P1功能 - 阅读任务
**新增模块**: `src/modules/task/`
数据库表:
```prisma
model Task {
id Int @id @default(autoincrement())
tenantId Int @map("tenant_id")
title String
taskType String @map("task_type") // READING, ACTIVITY, HOMEWORK
targetType String @map("target_type") // CLASS, STUDENT
relatedCourseId Int? @map("related_course_id")
startDate DateTime @map("start_date")
endDate DateTime @map("end_date")
status String @default("PUBLISHED")
targets TaskTarget[]
completions TaskCompletion[]
}
```
### 7. P1功能 - 课程反馈
新增API端点:
```
# 教师端
POST /teacher/lessons/:id/feedback
GET /teacher/lessons/:id/feedback
# 学校端
GET /school/feedbacks
GET /school/feedbacks/stats
```
## 测试验证
- [x] 学校端登录school1 / 123456
- [x] 教师端登录teacher1 / 123456
- [x] 教师管理 CRUD
- [x] 学生管理 CRUD
- [x] 班级管理 CRUD
- [x] 教师首页数据展示
- [x] 资源库管理
- [x] 成长档案管理
- [x] 阅读任务管理
- [x] 课程反馈功能
## 待处理事项
1. [ ] 前端教师端反馈提交界面(上课结束后提交反馈)
2. [ ] 前端教师端成长档案和任务页面
3. [ ] 数据导入功能优化
4. [ ] 移动端适配
5. [ ] 性能优化(大量学生/课程时的分页加载)