answer.go 564 B

12345678910111213141516
  1. package models
  2. import "gorm.io/gorm"
  3. type Answer struct {
  4. gorm.Model
  5. QuestionId *uint8 `gorm:"question_id type:integer not null comment '问题编号'"`
  6. NextQuestionId *uint8 `gorm:"next_question_id type:integer comment '下一个问题编号'"`
  7. Answer string `gorm:"answer type:varchar(200) not null comment '答案信息'"`
  8. }
  9. type CreateAnswer struct {
  10. QuestionId *uint8 `json:"questionId" binding:"required,gt=0" `
  11. NextQuestionId *uint8 `json:"nextQuestionId" binding:"gt=0"`
  12. Answer string `json:"answer" binding:"required"`
  13. }