更新
This commit is contained in:
@@ -27,6 +27,7 @@ type Class struct {
|
||||
GraduateYear int `gorm:"index:idx_class_unique,priority:5" json:"graduate_year"` // 毕业年份
|
||||
AdminUserID uint `gorm:"index;not null" json:"admin_user_id"`
|
||||
GraduationPhoto string `gorm:"size:512" json:"graduation_photo"` // 毕业照URL(每个班级唯一一张)
|
||||
RowCount int `gorm:"default:1" json:"row_count"` // 毕业照排数
|
||||
StudentNamesJSON string `gorm:"type:text" json:"-"` // 班级所有同学名字 JSON 数组
|
||||
TeacherNamesJSON string `gorm:"type:text" json:"-"` // 老师名字 JSON 数组
|
||||
Status ClassStatus `gorm:"size:16;default:pending;index" json:"status"`
|
||||
@@ -114,3 +115,18 @@ type Invitation struct {
|
||||
Status string `gorm:"size:16;default:active" json:"status"` // active / disabled
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
// ClassRoster 班级毕业照排位花名册(预录入人员,每个同学/老师单独一行存储,支持后续注册后绑定具体账户)
|
||||
type ClassRoster struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
ClassID uint `gorm:"index:idx_class_roster;not null" json:"class_id"`
|
||||
RowNo int `gorm:"index:idx_class_roster;not null" json:"row_no"` // 排号(从1开始,第1排为前排)
|
||||
ColNo int `gorm:"not null" json:"col_no"` // 排内序号(从1开始,从左往右)
|
||||
Name string `gorm:"size:64;not null;index" json:"name"` // 姓名
|
||||
Role string `gorm:"size:16;default:student;index" json:"role"` // 身份:student(同学) / teacher(老师)
|
||||
UserID uint `gorm:"index;default:0" json:"user_id"` // 绑定的系统用户ID(0表示未注册/未绑定账户)
|
||||
IsClaimed bool `gorm:"default:false;index" json:"is_claimed"` // 是否已被具体账户绑定认领
|
||||
ClaimedAt *time.Time `json:"claimed_at,omitempty"` // 绑定认领时间
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user