package models import "gorm.io/gorm" type Answer struct { gorm.Model QuestionId *uint8 `gorm:"question_id type:integer not null comment '问题编号'"` NextQuestionId *uint8 `gorm:"next_question_id type:integer comment '下一个问题编号'"` Answer string `gorm:"answer type:varchar(200) not null comment '答案信息'"` } type CreateAnswer struct { QuestionId *uint8 `json:"questionId" binding:"required,gt=0" ` NextQuestionId *uint8 `json:"nextQuestionId" binding:"gt=0"` Answer string `json:"answer" binding:"required"` }