23 lines
463 B
Go
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
|
|
}
|