feat(runner): implement empty classroom sync functionality
Some checks failed
Build Backend / build (push) Successful in 2m22s
Build Backend / build-docker (push) Failing after 3m3s

Add support for fetching and synchronizing empty classroom data. This includes new protobuf definitions for task payloads and results, database models, repository, service, and HTTP handlers.

- Add `TASK_TYPE_GET_EMPTY_CLASSROOM` to `TaskType` enum
- Implement `EmptyClassroom` model and auto-migration
- Add `EmptyClassroomHandler` with `GET` and `POST /sync` routes
- Implement `EmptyClassroomSyncService` and `EmptyClassroomRepository`
- Update dependency injection with wire sets
This commit is contained in:
2026-05-31 21:29:45 +08:00
parent 2084473fb5
commit 9356cb6876
13 changed files with 3007 additions and 48 deletions

View File

@@ -81,6 +81,7 @@ enum TaskType {
TASK_TYPE_GET_GRADES = 3; // 获取成绩
TASK_TYPE_GET_EXAMS = 4; // 获取考试安排
TASK_TYPE_GET_USER_INFO = 5; // 获取用户信息
TASK_TYPE_GET_EMPTY_CLASSROOM = 6; // 获取空教室
}
// TaskStatus 任务状态枚举
@@ -236,3 +237,30 @@ message UserInfoResultData {
string class_name = 6; // 班级
string grade = 7; // 年级
}
// GetEmptyClassroomPayload 获取空教室任务载荷
message GetEmptyClassroomPayload {
string username = 1; // 学号
string password = 2; // 密码
string semester = 3; // 学期
string week_start = 4; // 起始周次
string week_end = 5; // 结束周次
string campus_code = 6; // 校区代码
string building_code = 7; // 楼号代码(可选)
}
// EmptyClassroomResultData 空教室结果数据
message EmptyClassroomResultData {
string semester = 1; // 学期
string student_id = 2; // 学号
repeated EmptyClassroomEntry classrooms = 3; // 空教室列表
}
// EmptyClassroomEntry 空教室条目
message EmptyClassroomEntry {
string classroom = 1; // 教室名称
string weekday = 2; // 星期几
string periods = 3; // 可用节次
string term = 4; // 学期描述
string weeks = 5; // 周次范围
}