You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.4 KiB
Go

package model
import (
"gorm.io/gorm"
"mime/multipart"
"time"
)
type Question struct {
Id int `json:"id" gorm:"primaryKey;autoIncrement;comment:主键编码" comment:"主键ID"`
KnowledgePointId int `json:"knowledge_point_id" comment:"知识点ID"`
SubjectType string `json:"subject_type" gorm:"type:varchar(10);comment:题目类型 1-大学英语/2-大学英语/3-大学数学/4-大学计算机"`
Content string `json:"content" gorm:"type:text;comment:题目内容"`
Answer string `json:"answer" gorm:"type:text;not null;comment:答案"`
CorrectAnswer string `json:"correct_answer" gorm:"type:text;comment:正确答案"`
Analysis string `json:"analysis" gorm:"type:text;comment:题目解析"`
Score float64 `json:"score"`
Subject string `json:"subject" gorm:"type:varchar(10);comment:科目类型 大学英语/大学数学/大学语文"`
CreatedAt time.Time `json:"createdAt" gorm:"comment:创建时间"`
UpdatedAt time.Time `json:"updatedAt" gorm:"comment:最后更新时间"`
DeletedAt gorm.DeletedAt `json:"-" gorm:"index;comment:删除时间"`
}
func (Question) TableName() string {
return "sys_question_bank"
}
type AddQuestion struct {
File *multipart.FileHeader `json:"file" form:"file" binding:"required"`
}