2026-04-05 20:27:03 +08:00
|
|
|
package model
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
"gorm.io/gorm"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type VerificationRecord struct {
|
|
|
|
|
ID string `json:"id" gorm:"type:varchar(36);primaryKey"`
|
|
|
|
|
UserID string `json:"user_id" gorm:"type:varchar(36);index;not null"`
|
|
|
|
|
Identity UserIdentity `json:"identity" gorm:"type:varchar(20);not null"`
|
|
|
|
|
Status VerificationStatus `json:"status" gorm:"type:varchar(20);default:pending"`
|
|
|
|
|
|
|
|
|
|
RealName string `json:"real_name" gorm:"type:varchar(100)"`
|
|
|
|
|
StudentID string `json:"student_id" gorm:"type:varchar(50)"`
|
|
|
|
|
EmployeeID string `json:"employee_id" gorm:"type:varchar(50)"`
|
|
|
|
|
Department string `json:"department" gorm:"type:varchar(200)"`
|
|
|
|
|
ProofMaterials string `json:"proof_materials" gorm:"type:text"`
|
|
|
|
|
|
|
|
|
|
ReviewedAt *time.Time `json:"reviewed_at" gorm:"type:timestamp"`
|
|
|
|
|
ReviewedBy *string `json:"reviewed_by" gorm:"type:varchar(36)"`
|
|
|
|
|
RejectReason string `json:"reject_reason" gorm:"type:text"`
|
|
|
|
|
|
|
|
|
|
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
|
|
|
|
|
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
|
|
|
|
|
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (v *VerificationRecord) BeforeCreate(tx *gorm.DB) error {
|
2026-05-04 13:07:03 +08:00
|
|
|
SetUUIDIfEmpty(&v.ID)
|
2026-04-05 20:27:03 +08:00
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (VerificationRecord) TableName() string {
|
|
|
|
|
return "verification_records"
|
|
|
|
|
}
|