package model import "time" // QuestionOption 题目选项 type QuestionOption struct { Key string `json:"key"` Text string `json:"text"` } // Question 题目表 type Question struct { ID uint `gorm:"primaryKey" json:"id"` Domain string `gorm:"size:16;not null;index" json:"domain"` // company / product / sales CourseID *uint `gorm:"index" json:"course_id"` Type string `gorm:"size:16;not null" json:"type"` // single / multiple / judge Stem string `gorm:"type:text;not null" json:"stem"` Options string `gorm:"column:options;type:text;not null" json:"options"` Answer string `gorm:"column:answer;type:text;not null" json:"answer"` Explanation string `gorm:"type:text;default:''" json:"explanation"` Status string `gorm:"size:16;not null;default:active;index" json:"status"` // active / inactive CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` } func (Question) TableName() string { return "question" }