package model import ( "time" "gorm.io/gorm" ) // RelapseEvent 表示一次复吸事件明细。 type RelapseEvent struct { ID uint `gorm:"primaryKey;comment:主键" json:"id"` CreatedAt time.Time `gorm:"comment:创建时间" json:"created_at"` UpdatedAt time.Time `gorm:"comment:更新时间" json:"updated_at"` DeletedAt gorm.DeletedAt `gorm:"index;comment:删除时间" json:"-"` UID int `gorm:"index;comment:用户ID" json:"-"` Date time.Time `gorm:"type:date;index;comment:所属自然日" json:"date"` RelapseAt time.Time `gorm:"column:relapse_at;comment:复吸时间" json:"relapse_at"` RelapseNum int `gorm:"column:relapse_num;comment:复吸支数" json:"relapse_num"` Reason string `gorm:"column:reason;size:64;comment:复吸原因" json:"reason,omitempty"` Note string `gorm:"column:note;size:200;comment:备注" json:"note,omitempty"` AffectStreak bool `gorm:"column:affect_streak;comment:是否影响连续天数" json:"affect_streak"` } // TableName 返回复吸事件表名。 func (RelapseEvent) TableName() string { return "fa_quit_checkin_relapse_event" } // TableComment 返回复吸事件表注释。 func (RelapseEvent) TableComment() string { return "V2-无烟打卡-复吸事件" }