feat(grpc): add support for fetching empty classrooms
All checks were successful
Build / build (push) Successful in 1m31s

Implement the `TASK_TYPE_GET_EMPTY_CLASSROOM` task type to allow users to fetch available classroom information.

- Add `TASK_TYPE_GET_EMPTY_CLASSROOM` to the `TaskType` enum in protobuf.
- Define `GetEmptyClassroomPayload` and `EmptyClassroomResultData` messages.
- Implement `getEmptyClassrooms`
This commit is contained in:
2026-06-02 13:59:30 +08:00
parent d64f2fa20b
commit ee5c36f3ac
7 changed files with 663 additions and 53 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; // 周次范围
}