|
|
@ -24,29 +24,20 @@ import (
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
type Msg interface {
|
|
|
|
type Msg interface {
|
|
|
|
//PushMsgsToDoc(ctx context.Context, docID string, msgsToMongo []model.MsgInfoModel) error
|
|
|
|
|
|
|
|
Create(ctx context.Context, model *model.MsgDocModel) error
|
|
|
|
Create(ctx context.Context, model *model.MsgDocModel) error
|
|
|
|
UpdateMsg(ctx context.Context, docID string, index int64, key string, value any) (*mongo.UpdateResult, error)
|
|
|
|
UpdateMsg(ctx context.Context, docID string, index int64, key string, value any) (*mongo.UpdateResult, error)
|
|
|
|
PushUnique(ctx context.Context, docID string, index int64, key string, value any) (*mongo.UpdateResult, error)
|
|
|
|
PushUnique(ctx context.Context, docID string, index int64, key string, value any) (*mongo.UpdateResult, error)
|
|
|
|
UpdateMsgContent(ctx context.Context, docID string, index int64, msg []byte) error
|
|
|
|
|
|
|
|
IsExistDocID(ctx context.Context, docID string) (bool, error)
|
|
|
|
|
|
|
|
FindOneByDocID(ctx context.Context, docID string) (*model.MsgDocModel, error)
|
|
|
|
FindOneByDocID(ctx context.Context, docID string) (*model.MsgDocModel, error)
|
|
|
|
GetMsgBySeqIndexIn1Doc(ctx context.Context, userID, docID string, seqs []int64) ([]*model.MsgInfoModel, error)
|
|
|
|
GetMsgBySeqIndexIn1Doc(ctx context.Context, userID, docID string, seqs []int64) ([]*model.MsgInfoModel, error)
|
|
|
|
GetNewestMsg(ctx context.Context, conversationID string) (*model.MsgInfoModel, error)
|
|
|
|
GetNewestMsg(ctx context.Context, conversationID string) (*model.MsgInfoModel, error)
|
|
|
|
GetOldestMsg(ctx context.Context, conversationID string) (*model.MsgInfoModel, error)
|
|
|
|
GetOldestMsg(ctx context.Context, conversationID string) (*model.MsgInfoModel, error)
|
|
|
|
DeleteDocs(ctx context.Context, docIDs []string) error
|
|
|
|
|
|
|
|
GetMsgDocModelByIndex(ctx context.Context, conversationID string, index, sort int64) (*model.MsgDocModel, error)
|
|
|
|
|
|
|
|
DeleteMsgsInOneDocByIndex(ctx context.Context, docID string, indexes []int) error
|
|
|
|
DeleteMsgsInOneDocByIndex(ctx context.Context, docID string, indexes []int) error
|
|
|
|
MarkSingleChatMsgsAsRead(ctx context.Context, userID string, docID string, indexes []int64) error
|
|
|
|
MarkSingleChatMsgsAsRead(ctx context.Context, userID string, docID string, indexes []int64) error
|
|
|
|
SearchMessage(ctx context.Context, req *msg.SearchMessageReq) (int64, []*model.MsgInfoModel, error)
|
|
|
|
SearchMessage(ctx context.Context, req *msg.SearchMessageReq) (int64, []*model.MsgInfoModel, error)
|
|
|
|
RangeUserSendCount(ctx context.Context, start time.Time, end time.Time, group bool, ase bool, pageNumber int32, showNumber int32) (msgCount int64, userCount int64, users []*model.UserCount, dateCount map[string]int64, err error)
|
|
|
|
RangeUserSendCount(ctx context.Context, start time.Time, end time.Time, group bool, ase bool, pageNumber int32, showNumber int32) (msgCount int64, userCount int64, users []*model.UserCount, dateCount map[string]int64, err error)
|
|
|
|
RangeGroupSendCount(ctx context.Context, start time.Time, end time.Time, ase bool, pageNumber int32, showNumber int32) (msgCount int64, userCount int64, groups []*model.GroupCount, dateCount map[string]int64, err error)
|
|
|
|
RangeGroupSendCount(ctx context.Context, start time.Time, end time.Time, ase bool, pageNumber int32, showNumber int32) (msgCount int64, userCount int64, groups []*model.GroupCount, dateCount map[string]int64, err error)
|
|
|
|
|
|
|
|
|
|
|
|
DeleteDoc(ctx context.Context, docID string) error
|
|
|
|
DeleteDoc(ctx context.Context, docID string) error
|
|
|
|
DeleteMsgByIndex(ctx context.Context, docID string, index []int) error
|
|
|
|
|
|
|
|
GetRandBeforeMsg(ctx context.Context, ts int64, limit int) ([]*model.MsgDocModel, error)
|
|
|
|
GetRandBeforeMsg(ctx context.Context, ts int64, limit int) ([]*model.MsgDocModel, error)
|
|
|
|
|
|
|
|
|
|
|
|
GetLastMessageSeqByTime(ctx context.Context, conversationID string, time int64) (int64, error)
|
|
|
|
GetLastMessageSeqByTime(ctx context.Context, conversationID string, time int64) (int64, error)
|
|
|
|
|
|
|
|
|
|
|
|
FindSeqs(ctx context.Context, conversationID string, seqs []int64) ([]*model.MsgInfoModel, error)
|
|
|
|
FindSeqs(ctx context.Context, conversationID string, seqs []int64) ([]*model.MsgInfoModel, error)
|
|
|
|
}
|
|
|
|
}
|
|
|
|