Files
backend/internal/model/conversation_version_log.go
lan 6bf87fec46
All checks were successful
Build Backend / build (push) Successful in 4m20s
Build Backend / build-docker (push) Successful in 1m7s
feat(chat): implement sequence pre-allocation, versioned sync, and push worker
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.
2026-05-17 23:38:04 +08:00

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"`
}