feat(grpc): enhance grades and exams data structures
All checks were successful
Build / build (push) Successful in 1m39s

Update the gRPC service definitions and handlers to provide more detailed
information for grades and exams.

- Add `GpaSummary` message to include average GPA, rank, and other
  academic statistics.
- Expand `Grade` message with additional fields like `term`, `nature`,
  `category`, and `is_exam`.
- Refactor `Exam` message to use `week` and `weekday` instead of `room`
  and `seat`.
- Update `TaskHandler.getGrades` to populate the new `GpaSummary` and
  enriched grade details.
- Update protobuf generated files to reflect schema changes.
This commit is contained in:
2026-05-11 15:53:26 +08:00
parent 478ec3e3ab
commit d64f2fa20b
4 changed files with 276 additions and 137 deletions

View File

@@ -178,20 +178,35 @@ message ScheduleTime {
repeated int32 weeks = 3; // 周次,如 [1, 2, 3, 4, 5]
}
// GpaSummary 学分绩汇总信息
message GpaSummary {
string average_gpa = 1; // 平均学分绩
string rank = 2; // 专业排名
string exam_total_gpa = 3; // 考试课学分绩
string exam_total_credits = 4; // 考试课学分数
string fail_credits = 5; // 考查课不及格学分
string semesters = 6; // 计算学期数
}
// GradesResultData 成绩结果数据
message GradesResultData {
string semester = 1; // 学期
string student_id = 2; // 学号
repeated Grade grades = 3; // 成绩列表
GpaSummary gpa_summary = 4; // 学分绩汇总 (可选)
}
// Grade 成绩信息
message Grade {
string course_code = 1; // 课程代码
string course_name = 2; // 课程名称
float credit = 3; // 学分
string grade = 4; // 成绩 (可能是等级或分数)
float grade_point = 5; // 绩点
string term = 1; // 学期
string course_code = 2; // 课程代码
string course_name = 3; // 课程名称
string nature = 4; // 课程性质
string category = 5; // 课程类别
string credit = 6; // 学分
string score = 7; // 成绩 (可能是等级或分数)
string grade_point = 8; // 绩点
string is_exam = 9; // 是否考试课
}
// ExamsResultData 考试安排结果数据
@@ -203,13 +218,12 @@ message ExamsResultData {
// Exam 考试信息
message Exam {
string course_code = 1; // 课程代码
string course_name = 2; // 课程名称
string exam_type = 3; // 考试类型 (期末/期中/补考)
string date = 4; // 考试日期 (YYYY-MM-DD)
string time = 5; // 考试时间 (HH:MM-HH:MM)
string room = 6; // 考场
string seat = 7; // 座位号
string course_name = 1; // 课程名称
string exam_type = 2; // 考试类型 (期末/期中/补考)
string date = 3; // 考试日期
string time = 4; // 考试时间
string week = 5; // 考试周次
string weekday = 6; // 星期几
}
// UserInfoResultData 用户信息结果数据