question.go 638 B

12345678910111213141516
  1. package models
  2. import "gorm.io/gorm"
  3. type Question struct {
  4. gorm.Model
  5. Question string `gorm:"chat type:varchar(100) not null comment '问题'"`
  6. NextQuestionId *uint8 `gorm:"next_question_id comment '下一个问题编号:如果此编号不为空,则说明此问题为陈述,没有答案信息'"`
  7. QuestionType *uint8 `gorm:"question_type not null default '0' comment '题目类型:0选择题;1填空题'"`
  8. }
  9. type CreateQuestion struct {
  10. Question string `json:"chat" binding:"required"`
  11. NextQuestionId *uint8 `json:"nextQuestionId"`
  12. QuestionType *uint8 `json:"questionType" binding:"required,gte=0" `
  13. }