feat(api): implement exam and grade synchronization modules
All checks were successful
Build Backend / build (push) Successful in 2m18s
Build Backend / build-docker (push) Successful in 1m20s

Add new functionality for managing and synchronizing academic grades and exam schedules. This includes new models, repositories, services, and HTTP handlers, along with updated gRPC definitions and dependency injection configuration.

Additionally, improve the reliability of unread message count tracking by implementing an atomic Lua script for Redis operations in the conversation cache.
This commit is contained in:
2026-05-12 01:28:18 +08:00
parent 628a6acbe9
commit 2f2bbc646e
20 changed files with 1052 additions and 212 deletions

28
internal/model/exam.go Normal file
View File

@@ -0,0 +1,28 @@
package model
import (
"time"
"gorm.io/gorm"
)
type Exam struct {
ID string `json:"id" gorm:"type:varchar(36);primaryKey"`
UserID string `json:"user_id" gorm:"type:varchar(36);index;not null"`
Semester string `json:"semester" gorm:"type:varchar(30);not null"`
CourseName string `json:"course_name" gorm:"type:varchar(120);not null"`
ExamType string `json:"exam_type" gorm:"type:varchar(30)"`
Date string `json:"date" gorm:"type:varchar(20)"`
Time string `json:"time" gorm:"type:varchar(30)"`
Week string `json:"week" gorm:"type:varchar(20)"`
Weekday string `json:"weekday" gorm:"type:varchar(10)"`
CreatedAt time.Time
UpdatedAt time.Time
}
func (e *Exam) BeforeCreate(tx *gorm.DB) error {
SetUUIDIfEmpty(&e.ID)
return nil
}
func (Exam) TableName() string { return "exams" }