spark-server/internal/module/sync/model/mailbox_event.go
zhr ae9a71034d feat: implement Spark IM V3 modular monolith
Add HTTP /v1 MVC, TCP send path, groups with server-side member-avatar collage, object-storage upload, and friends/favorites around the architecture-v3 layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 19:52:11 +08:00

19 lines
1.1 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 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 "mailbox_events" }