Introduce several performance and synchronization enhancements: - Implement `SeqBufferManager` to allow sequence number pre-allocation via Redis Lua scripts, reducing atomic increment overhead. - Add `PushWorker` to handle asynchronous message pushing using Redis Streams. - Implement incremental conversation synchronization via `ConversationVersionLog` to allow clients to fetch only recent changes. - Add support for Gzip compression in WebSocket communications to reduce bandwidth usage. - Update dependency injection and configuration to support these new components.
13 lines
617 B
Go
13 lines
617 B
Go
package model
|
|
|
|
import "time"
|
|
|
|
// ConversationVersionLog 会话版本日志(用于增量同步)
|
|
type ConversationVersionLog struct {
|
|
ID uint `gorm:"primaryKey;autoIncrement"`
|
|
UserID string `gorm:"not null;size:36;index:idx_vlog_user_version,priority:1"`
|
|
ConversationID string `gorm:"not null;size:20;index:idx_vlog_conv"`
|
|
Version int64 `gorm:"not null;index:idx_vlog_user_version,priority:2"`
|
|
ChangeType string `gorm:"not null;type:varchar(20)"` // new_msg, read, pin, unpin, mute, unmute, hide, group_update
|
|
CreatedAt time.Time `gorm:"autoCreateTime"`
|
|
} |