questionnaire_template.go 1018 B

12345678910111213141516171819202122
  1. package model
  2. import (
  3. "time"
  4. "gorm.io/gorm"
  5. )
  6. type QuestionnaireTemplate struct {
  7. ID int64 `gorm:"type:int(20);primaryKey;autoIncrement;comment:ID;" json:"id"`
  8. SN string `gorm:"type:varchar(255);not null;comment:编号" json:"sn"`
  9. Title string `gorm:"type:varchar(255);not null;comment:标题" json:"title"`
  10. Peg string `gorm:"type:longText;not null;comment:校验器" json:"peg"`
  11. SubjectRelations []*QuestionnaireTemplateSubject `gorm:"foreignKey:TemplateID;References:ID" json:"subjectRelations"`
  12. DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"-"`
  13. CreatedAt time.Time `gorm:"column:created_at" json:"createdAt"`
  14. UpdatedAt time.Time `gorm:"column:updated_at" json:"updatedAt"`
  15. }
  16. func (s *QuestionnaireTemplate) AfterFind(tx *gorm.DB) (err error) {
  17. return
  18. }