package model import ( "time" "gorm.io/gorm" ) // SupervisorReminderLog 记录一次提醒尝试,用于: // - 频控:按天限制每个 (owner, supervisor) 的提醒次数 // - 追踪:后续接入真实通道(订阅消息)时可落库 status/result type SupervisorReminderLog 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:"-"` OwnerUID int `gorm:"column:owner_uid;index:idx_owner_supervisor_date,priority:1;comment:被监督用户ID" json:"owner_uid"` SupervisorUID int `gorm:"column:supervisor_uid;index:idx_owner_supervisor_date,priority:2;comment:监督人用户ID" json:"supervisor_uid"` ReminderDate time.Time `gorm:"column:reminder_date;type:date;index:idx_owner_supervisor_date,priority:3;comment:所属自然日" json:"reminder_date"` ReminderAt time.Time `gorm:"column:reminder_at;comment:提醒时间" json:"reminder_at"` Type string `gorm:"column:type;size:32;index;comment:提醒类型(missed_checkin...)" json:"type"` Status string `gorm:"column:status;size:16;index;comment:状态(stubbed|sent|failed)" json:"status"` Channel string `gorm:"column:channel;size:32;comment:通道(stub|subscribe_msg...)" json:"channel"` Message string `gorm:"column:message;type:text;comment:提醒内容(可选)" json:"message,omitempty"` } func (SupervisorReminderLog) TableName() string { return "fa_quit_checkin_supervisor_reminder_log" } func (SupervisorReminderLog) TableComment() string { return "V2-无烟打卡-监督提醒记录" }