spark-server/internal/module/conversation/entity/conversation.go
2026-09-18 14:50:41 +08:00

23 lines
440 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
}