Commit Graph

2 Commits

Author SHA1 Message Date
859c71db09 fix(backend): 修复租户创建、接口字段和500错误
Bug 1: 创建租户时同步创建学校登录账号(teachers表)
- TenantCreateRequest支持loginAccount/contactPerson/studentQuota/teacherQuota字段
- TenantServiceImpl.createTenant()后自动插入Teacher记录,包含BCrypt加密密码
- 返回tempPassword字段供前端展示

Bug 2: 修复多个接口500错误
- 新增POST /auth/logout端点(JWT无状态,直接返回成功)
- 新增GET /admin/stats/trend端点(最近6个月统计趋势)
- 完善getStats()返回activeTenantCount/publishedCourseCount/monthlyLessons字段
- 新增AdminSettingsController(GET/PUT /admin/settings)
- 新增租户操作端点:/status、/reset-password、/quota

Bug 3: 统一前后端接口字段名
- Tenant实体用@JsonProperty重命名:code→loginAccount, contactName→contactPerson
  maxStudents→studentQuota, maxTeachers→teacherQuota, expireAt→expireDate
- status字段用UpperCaseSerializer返回大写值(前端期望ACTIVE/SUSPENDED)
- TenantCreateRequest/UpdateRequest用@JsonAlias接受前端字段名
- PageResult用@JsonProperty重命名:list→items, pageNum→page, pages→totalPages
- 所有分页控制器将pageNum参数改为page(与前端对齐)
- 新增TenantService.resetSchoolAccountPassword()方法

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 15:20:37 +08:00
7f757b6a63 初始提交:幼儿园阅读平台三端代码
- reading-platform-backend:NestJS 后端
- reading-platform-frontend:Vue3 前端
- reading-platform-java:Spring Boot 服务端
2026-02-28 17:51:15 +08:00