spark-server/internal/module/conversation/repository.go
2026-09-16 19:08:06 +08:00

23 lines
463 B
Go

package conversation
import "context"
const (
TypeP2P int = 1
TypeGroup int = 2
)
type Conversation struct {
ID int64
Type int
LastMsgID int64
LastMsgAt int64
}
type Repository interface {
Create(ctx context.Context, c *Conversation) error
Get(ctx context.Context, id int64) (*Conversation, error)
GetP2P(ctx context.Context, userA, userB int64) (*Conversation, error)
UpdateLastMsg(ctx context.Context, id, msgID, atMS int64) error
}