30 lines
1.5 KiB
Go
30 lines
1.5 KiB
Go
package model
|
|
|
|
import (
|
|
"gorm.io/gorm"
|
|
"time"
|
|
)
|
|
|
|
type Testpaper12 struct {
|
|
Id uint64 `gorm:"column:id;type:bigint(20) unsigned;primary_key;AUTO_INCREMENT" json:"id"`
|
|
StemType string `gorm:"column:stem_type;type:varchar(1000);comment:题干名称" json:"stem_type"`
|
|
Name string `gorm:"column:name;type:varchar(1000);comment:题目名称" json:"name"`
|
|
Item string `gorm:"column:item;type:varchar(1000);comment:选项" json:"item"`
|
|
Answer string `gorm:"column:answer;type:varchar(1000);comment:答案" json:"answer"`
|
|
Explain string `gorm:"column:explain;type:varchar(2000);comment:解析" json:"explain"`
|
|
QuestionType uint `gorm:"column:question_type;type:tinyint(4) unsigned;comment:题目类型" json:"question_type"`
|
|
Level uint `gorm:"column:level;type:tinyint(4) unsigned;comment:难易程度" json:"level"`
|
|
KnowledgeType uint `gorm:"column:knowledge_type;type:tinyint(4) unsigned;comment:知识题库分类" json:"knowledge_type"`
|
|
PaperUuid string `gorm:"column:paper_uuid;type:varchar(50);comment:所属paper;NOT NULL" json:"paper_uuid"`
|
|
CreateDate time.Time `gorm:"column:create_date;type:datetime" json:"create_date"`
|
|
IsMigrate uint `gorm:"column:is_migrate;type:tinyint(4) unsigned;comment:是否迁移" json:"is_migrate"`
|
|
}
|
|
|
|
func (m *Testpaper12) TableName() string {
|
|
return "tb_testpaper12"
|
|
}
|
|
|
|
func (m *Testpaper12) BeforeCreate(tx *gorm.DB) error {
|
|
return nil
|
|
}
|