Commit Graph

17 Commits

Author SHA1 Message Date
WuYuuuub
1cd0c655f8 查询空教室功能测试通过
All checks were successful
Build / build (push) Successful in 1m46s
2026-06-12 20:52:18 +08:00
lan
accc6567f2 refactor(grpc): restructure task handling and migrate to slog
All checks were successful
Build / build (push) Successful in 5m28s
Refactor the gRPC client and task handling logic to improve modularity,
error handling, and observability.

- Split `grpc/handler.go` into specialized handler files (login,
  classroom, exams, grades, schedule) to reduce complexity.
- Replace standard `log` with `log/slog` throughout the project for
  structured logging.
- Refactor `grpc/client.go` to use a thread-safe connection management
  pattern with `sync.RWMutex`.
- Remove the legacy `service` package and HTTP server implementation,
  transitioning the application to a pure gRPC runner mode.
- Clean up `config` and `pkg/errors` to remove unused utilities and
  simplify the API.
- Improve error reporting in parsers and HTTP clients by checking
  response status codes.
2026-06-09 23:08:03 +08:00
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
a04e5c2c50 fix: 降级upload-artifact到v3以兼容Gitea
All checks were successful
Build / build (push) Successful in 6m33s
2026-03-19 11:39:42 +08:00
lafay
766eb9cda4 fix: 添加setup-go步骤
Some checks failed
Build / build (push) Failing after 7m17s
2026-03-19 11:31:14 +08:00
lafay
a168e6f2e4 fix: 修复CI workflow缺少checkout步骤和路径错误
Some checks failed
Build / build (push) Failing after 10s
2026-03-19 10:59:42 +08:00
lafay
d0ff0a28df feat: 添加重连逻辑和CI workflow
Some checks failed
Build / build (push) Failing after 1m30s
2026-03-19 10:52:23 +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
lafay
294151cd40 refactor: 将recognizer模块拆分到现有模块中
- 将课表识别功能合并到captcha模块
- 将RecognizerClient添加到client模块
- 将输出函数移至models/output.go
- 更新API结构体添加扩展字段
- 删除recognizer目录
2026-03-16 13:15:56 +08:00
lafay
01ea9ac77d 更新.gitignore: 添加二进制文件和测试输出文件的忽略规则 2026-03-16 13:03:40 +08:00
lafay
a5c9bc9f87 Merge branch 'image_recognize' 2026-03-16 13:03:02 +08:00
lafay
ed1d252fab 重构: 将API配置提取到config模块并优化错误处理
- 将硬编码的API配置移到config模块,支持环境变量配置
- 添加API Key验证和配置检查
- 添加图片上传大小限制(10MB)
- 移除不必要的注释,简化代码
- 改进错误处理和日志记录
2026-03-16 13:02:57 +08:00
WuYuuuub
9addc89a66 添加了通过识别图片导入课表的模块 2026-03-15 21:49:10 +08:00
lan
eebf239528 Ignore test HTML files 2026-03-13 20:44:53 +08:00
lan
17cdb7ad0d Initial commit 2026-03-13 20:43:44 +08:00