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