Commit Graph

5 Commits

Author SHA1 Message Date
lan
ee5c36f3ac 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`
2026-06-02 13:59:30 +08:00
lan
d64f2fa20b 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.
2026-05-11 15:53:26 +08:00
lan
478ec3e3ab feat(grpc): add support for fetching grades and exams
All checks were successful
Build / build (push) Successful in 2m14s
Implement new gRPC task handlers for retrieving student grades and exam schedules. This includes adding new parser logic for processing score and exam data, and updating the client capabilities to advertise support for these new task types.

- Add `getGrades` and `getExams` handlers in `grpc/handler.go`
- Add `parser/encoding.go`, `parser/exam.go`, and `parser/score.go` for data parsing
- Update `grpc/client.go` to include `TASK_TYPE_GET_GRADES` and `TASK_TYPE_GET_EXAMS` in capabilities
2026-05-11 00:46:38 +08:00
lafay
74438c1f7f refactor: 重构代码架构并使用 Modern Go 特性
- 重命名模块 jwts -> schedule_converter
- 新增 service 包,统一业务逻辑层
- 新增 pkg/logger 包,使用 slog 结构化日志
- 新增 pkg/errors 包,统一错误处理
- 拆分 captcha 包,图片识别移至 service/recognizer
- 清理 models 包,只保留数据结构定义
- 消除 grpc/handler.go 中的重复代码
- 简化 main.go,使用 slog 和 context
- 配置支持单例模式和结构化配置
- 使用 any 替代 interface{}
- 使用 sync.Map 替代 map + RWMutex
2026-03-16 13:40:53 +08:00
lan
17cdb7ad0d Initial commit 2026-03-13 20:43:44 +08:00