spark-server/internal/module/inbox/entity/preview.go
DESKTOP-L8OUL9F\gfl0034 e27ae8723a fix: 单聊系统消息带回当前用户视角的对方
SYNC_INBOX 补 conversation_type、peer_id、group_id 和 last_read_msg_id。历史消息在 sender 为 0 时用 peer_id 定位对方。已读清未读时保留会话 ZSET 分数,避免被毫秒时间戳冲到游标后面。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-19 15:04:03 +08:00

29 lines
957 B
Go

package entity
type Preview struct {
ConversationID int64
MsgID int64
Snippet []byte
}
// DialogHit is a ZSET member updated after dialog_score.
type DialogHit struct {
ConversationID int64
Score int64
}
// Dialog is one conversation row for SYNC_INBOX.
// PeerID is the other user in a P2P chat (conversation_type=1), relative to the viewer.
// GroupID is groups.id (群号) when conversation_type=2. It is not conversation_id.
// LastReadMsgID is that viewer's member cursor; 0 means nothing read.
type Dialog struct {
ConversationID int64 `json:"conversation_id"`
ConversationType int `json:"conversation_type,omitempty"`
PeerID int64 `json:"peer_id,omitempty"`
GroupID int64 `json:"group_id,omitempty"`
LastReadMsgID int64 `json:"last_read_msg_id,omitempty"`
Score int64 `json:"score"`
Unread int64 `json:"unread"`
Preview []byte `json:"preview"`
}