package model import ( "time" "gorm.io/gorm" ) // Profile 表示无烟打卡的基础资料配置。 type Profile 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:"uniqueIndex;comment:用户ID" json:"-"` QuitStartDate time.Time `gorm:"column:quit_start_date;type:date;comment:戒烟开始日期" json:"quit_start_date"` PackPriceCent int `gorm:"column:pack_price_cent;comment:每包价格(分)" json:"pack_price_cent"` BaselineCigsPerDay int `gorm:"column:baseline_cigs_per_day;comment:戒烟前日均支数" json:"baseline_cigs_per_day"` Motivation string `gorm:"column:motivation;size:200;comment:戒烟初心" json:"motivation"` NotifyTime string `gorm:"column:notify_time;size:5;comment:提醒时间(HH:MM)" json:"notify_time"` ResetRule string `gorm:"column:reset_rule;size:64;comment:连续天数重置规则" json:"reset_rule"` } // TableName 返回用户资料表名。 func (Profile) TableName() string { return "fa_quit_checkin_profile" } // TableComment 返回用户资料表注释。 func (Profile) TableComment() string { return "V2-无烟打卡-用户资料" }