questionnaire_suvey.go 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package model
  2. import (
  3. "time"
  4. "gorm.io/gorm"
  5. )
  6. const (
  7. QUESTIONNAIRE_SURVEY_STATUS_ENABLE = 1 // 启用
  8. QUESTIONNAIRE_SURVEY_STATUS_DISABLE = 2 // 禁用
  9. QUESTIONNAIRE_SURVEY_TYPE_NORMAL = 1 // 决策问卷
  10. )
  11. type QuestionnaireSurvey struct {
  12. ID int64 `gorm:"type:int(20);primaryKey;autoIncrement;comment:ID;" json:"id"`
  13. Title string `gorm:"type:varchar(255);not null;comment:标题" json:"title"`
  14. SN string `gorm:"type:varchar(255);comment:问卷编号;default:'';" json:"sn"`
  15. CanSkipIntro int `gorm:"type:int(1);comment:是否可以跳过问卷介绍;default:1;" json:"canSkipIntro"`
  16. CanSkipResult int `gorm:"type:int(1);comment:是否可以跳过问卷结果;default:1;" json:"canSkipResult"`
  17. GuestAvatar string `gorm:"type:varchar(255);comment:访客头像;default:'';" json:"guestAvatar"`
  18. CustomerAvatar string `gorm:"type:varchar(255);comment:客服头像;default:'';" json:"customerAvatar"`
  19. GreetingText string `gorm:"type:text;comment:问卷提示语;nullable;" json:"greetingText"`
  20. FinishedText string `gorm:"type:text;comment:问卷结束语;nullable;" json:"finishedText"`
  21. Intro string `gorm:"type:longText;comment:问卷介绍;nullable;" json:"intro"`
  22. Status int `gorm:"type:int(1);comment:状态;default:1;" json:"status"`
  23. Returns int `gorm:"type:int(11);comment:返回次数;default:0;" json:"returns"`
  24. Dsl string `gorm:"type:longText;comment:问卷DSL;nullable;" json:"dsl"`
  25. Type int `gorm:"type:int(1);comment:问卷类型;default:1;" json:"type"`
  26. Peg string `gorm:"type:longText;comment:PEG.js;nullable;" json:"peg"`
  27. Remark string `gorm:"type:longText;comment:备注;nullable;" json:"remark"`
  28. Subjects []*QuestionnaireSurveyQuestionnaireSubject `gorm:"foreignKey:SurveyID;references:ID" json:"subjects"`
  29. DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"-"`
  30. CreatedAt time.Time `gorm:"column:created_at" json:"createdAt"`
  31. UpdatedAt time.Time `gorm:"column:updated_at" json:"updatedAt"`
  32. }
  33. func (s *QuestionnaireSurvey) AfterFind(tx *gorm.DB) (err error) {
  34. return
  35. }