spark-server/internal/module/conversation/entity/conversation.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

33 lines
736 B
Go

// Package entity holds conversation domain types.
package entity
// Type is persisted as conversations.type.
type Type int
const (
TypeP2P Type = 1
TypeGroup Type = 2
)
func (t Type) Valid() bool {
return t == TypeP2P || t == TypeGroup
}
// Conversation is a P2P or group chat. LastMsgID is the Snowflake cursor, not ConversationSeq.
type Conversation struct {
ID int64
Type Type
LastMsgID int64
LastMsgAt int64
}
// DialogFace is the viewer-relative identity of one conversation.
// PeerID is the other member of a P2P chat. GroupID is groups.id, not the conversation id.
type DialogFace struct {
ConversationID int64
Type Type
PeerID int64
GroupID int64
LastReadMsgID int64
}