// Package model is mailbox and device-sync-cursor persistence. One file per table. package model import "time" // MailboxEvent maps table mailbox_events. Successful online pushes do not write this table. type MailboxEvent struct { ID int64 `gorm:"column:id;primaryKey;comment:Snowflake 事件 id"` UserID int64 `gorm:"column:user_id;comment:接收用户"` DeviceID int64 `gorm:"column:device_id;comment:目标设备;0 表示该用户全部设备"` Seq int64 `gorm:"column:seq;comment:该 user+device 上单调递增的邮箱序号"` EventType int16 `gorm:"column:event_type;comment:事件类型:撤回/踢人/成员变更/好友/漏推消息等,不含成功在线推送的新消息"` ConversationID *int64 `gorm:"column:conversation_id;comment:相关会话,可空"` Payload []byte `gorm:"column:payload;comment:控制事件载荷(会话 id+消息 id 等),不含消息正文"` CreatedAt time.Time `gorm:"column:created_at;comment:写入时间"` } func (MailboxEvent) TableName() string { return "t_mailbox_events" }