kindergarten_java/reading-platform-java/init-admin.sql
En e501e17403 feat: 完善学校统计报告、资源服务及实体类字段
主要变更:
1. 新增学校报告服务 (SchoolReportService)
   - 学校概览统计 (getOverviewStats)
   - 教师统计报表 (getTeacherStats)
   - 课程统计报表 (getCourseStats)
   - 学生统计报表 (getStudentStats)
   - 课时趋势分析 (getLessonTrend)

2. 新增学校端 Controller
   - SchoolReportController: 学校统计报告接口
   - SchoolResourceController: 学校资源管理接口
   - SchoolFeedbackController: 学校反馈管理接口

3. 完善实体类字段
   - CourseLesson: 添加 lessonOrder 字段
   - ResourceItem: 添加 tenantId、type 字段
   - Task: 添加 name 字段
   - LessonFeedback: 添加 courseId、tenantId、overallRating 字段

4. 完善服务层实现
   - ResourceServiceImpl: 实现资源库和资源项管理方法
   - SchoolReportServiceImpl: 实现学校统计报表逻辑
   - TeacherDashboardServiceImpl: 修复时间类型转换
   - AdminStatsServiceImpl: 完善统计逻辑

5. 新增 Flyway 迁移脚本 (V2)
   - 添加 ORM 实体类缺失字段的数据库迁移

6. 修复路由冲突
   - 移除 AdminCourseController 中重复的 getCourseLessons 方法

7. 添加测试工具类
   - CheckDatabase, CheckClazzTable: 数据库检查工具
   - InitDatabase, InitClasses: 数据初始化工具
   - GeneratePasswordHash: 密码哈希生成工具

8. 配置 Maven Wrapper
   - 添加 maven-wrapper.properties 和 mvnw.cmd
   - 确保使用 Java 17 编译
2026-03-11 16:21:22 +08:00

38 lines
771 B
SQL
Raw Permalink 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.

-- 初始化 admin 用户数据
-- 密码admin123
-- BCrypt 哈希值 (使用 Spring Security BCrypt 生成)
-- 首先删除已存在的 admin 用户
DELETE FROM t_admin_user WHERE username = 'admin';
-- 插入 admin 用户
-- 密码 "admin123" 的 BCrypt 哈希
INSERT INTO t_admin_user (
id,
username,
password,
name,
email,
phone,
avatar_url,
status,
created_at,
updated_at,
deleted
) VALUES (
'admin001',
'admin',
'$2a$10$rO0y5vKJqGzWzJzQVnHw..5cY3sFZT1N9RfMiM7CGDCKuT5N5L5M5N',
'系统管理员',
'admin@example.com',
'13800138000',
NULL,
'active',
NOW(),
NOW(),
0
);
-- 验证插入
SELECT id, username, name, status, password FROM t_admin_user WHERE username = 'admin';