kindergarten_java/reading-platform-java
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
..
.mvn/wrapper feat: 完善学校统计报告、资源服务及实体类字段 2026-03-11 16:21:22 +08:00
src feat: 完善学校统计报告、资源服务及实体类字段 2026-03-11 16:21:22 +08:00
build.bat feat: 完善学校统计报告、资源服务及实体类字段 2026-03-11 16:21:22 +08:00
compile.bat feat: 完善学校统计报告、资源服务及实体类字段 2026-03-11 16:21:22 +08:00
Dockerfile feat(backend): 补全所有未提交的 Java 源码文件 2026-03-03 13:51:33 +08:00
Fapache-maven-3.8.4confjvm.config feat: 完善 OpenAPI 注解和前端 API 客户端 2026-03-10 23:51:02 +08:00
init-admin.sql feat: 完善学校统计报告、资源服务及实体类字段 2026-03-11 16:21:22 +08:00
init-classes.sql feat: 完善学校统计报告、资源服务及实体类字段 2026-03-11 16:21:22 +08:00
init-data.sql feat: 完善学校统计报告、资源服务及实体类字段 2026-03-11 16:21:22 +08:00
mvnw.cmd feat: 完善学校统计报告、资源服务及实体类字段 2026-03-11 16:21:22 +08:00
pom.xml feat: 完善学校统计报告、资源服务及实体类字段 2026-03-11 16:21:22 +08:00
README.md 初始提交:幼儿园阅读平台三端代码 2026-02-28 17:51:15 +08:00

Reading Platform Java Backend

Spring Boot + MyBatis-Plus backend for the Reading Platform.

Tech Stack

  • Java: 17
  • Spring Boot: 3.2.3
  • MyBatis-Plus: 3.5.5
  • MySQL: 8.0+
  • Spring Security + JWT: Authentication
  • Knife4j: API Documentation (Swagger)
  • Lombok: Boilerplate reduction

Project Structure

reading-platform-java/
├── pom.xml                          # Maven dependencies
├── src/main/java/com/reading/platform/
│   ├── ReadingPlatformApplication.java
│   ├── common/                      # Common components
│   │   ├── config/                  # Configuration classes
│   │   ├── exception/               # Exception handling
│   │   ├── response/                # Unified response
│   │   ├── security/                # JWT security
│   │   ├── annotation/              # Custom annotations
│   │   ├── enums/                   # Enum classes
│   │   ├── aspect/                  # AOP aspects
│   │   └── util/                    # Utilities
│   ├── entity/                      # Entity classes (27)
│   ├── mapper/                      # MyBatis-Plus mappers (27)
│   ├── service/                     # Service interfaces
│   ├── service/impl/                # Service implementations
│   ├── controller/                  # REST controllers
│   │   ├── admin/                   # Super admin endpoints
│   │   ├── school/                  # School admin endpoints
│   │   ├── teacher/                 # Teacher endpoints
│   │   └── parent/                  # Parent endpoints
│   └── dto/                         # Data Transfer Objects
│       ├── request/
│       └── response/
└── src/main/resources/
    ├── application.yml              # Main configuration
    ├── application-dev.yml          # Dev environment config
    ├── mapper/                      # MyBatis XML files
    └── db/migration/                # SQL scripts

Quick Start

1. Prerequisites

  • JDK 17+
  • Maven 3.6+
  • MySQL 8.0+

2. Database Setup

# Create database and import schema
mysql -u root -p < src/main/resources/db/migration/V1__init_schema.sql

3. Configuration

Edit src/main/resources/application-dev.yml:

spring:
  datasource:
    url: jdbc:mysql://localhost:3306/reading_platform
    username: your_username
    password: your_password

4. Build and Run

# Build
mvn clean package -DskipTests

# Run
java -jar target/reading-platform-1.0.0.jar

# Or run with Maven
mvn spring-boot:run

5. API Documentation

After starting the application, access the API documentation at:

API Endpoints

Authentication

  • POST /api/auth/login - User login
  • GET /api/auth/me - Get current user info
  • POST /api/auth/change-password - Change password

Admin Endpoints

  • /api/admin/tenants - Tenant management
  • /api/admin/courses - System course management

School Endpoints

  • /api/school/teachers - Teacher management
  • /api/school/students - Student management
  • /api/school/classes - Class management
  • /api/school/parents - Parent management
  • /api/school/tasks - Task management
  • /api/school/growth-records - Growth record management

Teacher Endpoints

  • /api/teacher/courses - View courses
  • /api/teacher/lessons - Lesson management
  • /api/teacher/tasks - Task management
  • /api/teacher/growth-records - Growth record management
  • /api/teacher/notifications - Notifications

Parent Endpoints

  • /api/parent/children - Child information
  • /api/parent/tasks - View and complete tasks
  • /api/parent/growth-records - Growth record management
  • /api/parent/notifications - Notifications

Test Accounts

Role Username Password
Admin admin admin123

School, teacher, and parent accounts need to be created through the admin interface.

Database Tables (27)

Module Tables
Tenant tenants, tenant_courses
Users admin_users, teachers, students, parents, parent_students
Class classes, class_teachers, student_class_history
Course courses, course_versions, course_resources, course_scripts, course_script_pages, course_activities
Lesson lessons, lesson_feedbacks, student_records
Task tasks, task_targets, task_completions, task_templates
Growth growth_records
Resource resource_libraries, resource_items
Schedule schedule_plans, schedule_templates
System system_settings, notifications, operation_logs, tags

Development

Adding a New Entity

  1. Create entity class in entity/
  2. Create mapper interface in mapper/
  3. Create service interface in service/
  4. Create service implementation in service/impl/
  5. Create controller in appropriate controller/ subdirectory

Code Style

  • Use Lombok annotations to reduce boilerplate
  • Follow Spring Boot conventions
  • Use @RequireRole annotation for role-based access control

License

MIT License