questionnaire_template_subject.go 759 B

123456789101112131415161718
  1. package model
  2. import (
  3. "gorm.io/gorm"
  4. )
  5. type QuestionnaireTemplateSubject struct {
  6. ID int64 `gorm:"type:int(20);primaryKey;autoIncrement;comment:ID;" json:"id"`
  7. TemplateID int64 `gorm:"type:int(20);not null;comment:模板ID" json:"templateId"`
  8. SubjectID int64 `gorm:"type:int(20);not null;comment:题目ID" json:"subjectId"`
  9. Sort int64 `gorm:"type:int(11);comment:排序;default:0;" json:"sort"`
  10. Template QuestionnaireTemplate `gorm:"foreignKey:TemplateID;references:ID" json:"template"`
  11. Subject QuestionnaireSubject `gorm:"foreignKey:SubjectID;references:ID" json:"subject"`
  12. }
  13. func (o *QuestionnaireTemplateSubject) AfterFind(tx *gorm.DB) (err error) {
  14. return
  15. }