package model import "time" // Certificate 考试合格证书:正式考试通过后自动颁发,供培训验收与留存。 // 每张证书对应一条正式考试记录(同一学员同一试卷仅一次正式考,故不会重复发证)。 type Certificate struct { ID uint `gorm:"primaryKey" json:"id"` UserID uint `gorm:"not null;index" json:"user_id"` ExamRecordID uint `gorm:"not null;index" json:"exam_record_id"` UserName string `gorm:"size:64;not null" json:"user_name"` ExamName string `gorm:"size:128;not null" json:"exam_name"` Score int `gorm:"not null" json:"score"` TotalScore int `gorm:"not null" json:"total_score"` PassScore int `gorm:"not null" json:"pass_score"` CertNo string `gorm:"size:64;not null;uniqueIndex" json:"cert_no"` IssuedAt time.Time `gorm:"not null" json:"issued_at"` } func (Certificate) TableName() string { return "certificate" }