offline_email_job.go 712 B

123456789101112131415
  1. package models
  2. import "time"
  3. // OfflineEmailJob 访客离线时延迟发送的邮件任务
  4. type OfflineEmailJob struct {
  5. ID uint `json:"id" gorm:"primaryKey"`
  6. ConversationID uint `json:"conversation_id" gorm:"index;not null"`
  7. MessageIDs string `json:"message_ids" gorm:"type:varchar(2000);not null"` // 逗号分隔的消息 ID
  8. ScheduledAt time.Time `json:"scheduled_at" gorm:"index;not null"`
  9. Status string `json:"status" gorm:"type:varchar(20);default:'pending';index"` // pending/sent/cancelled/failed
  10. LastError string `json:"last_error" gorm:"type:text"`
  11. CreatedAt time.Time `json:"created_at"`
  12. UpdatedAt time.Time `json:"updated_at"`
  13. }