2023-02-10 11:03:03 +08:00
|
|
|
package controller
|
2023-02-10 15:46:29 +08:00
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
pbMsg "Open_IM/pkg/proto/msg"
|
|
|
|
|
"context"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type MsgInterface interface {
|
|
|
|
|
BatchInsertChat2DB(ctx context.Context, userID string, msgList []*pbMsg.MsgDataToMQ, currentMaxSeq uint64) error
|
|
|
|
|
BatchInsertChat2Cache(ctx context.Context, insertID string, msgList []*pbMsg.MsgDataToMQ) (error, uint64)
|
2023-02-10 17:02:20 +08:00
|
|
|
|
2023-02-10 15:46:29 +08:00
|
|
|
DelMsgBySeqList(ctx context.Context, userID string, seqList []uint32) (totalUnExistSeqList []uint32, err error)
|
2023-02-10 17:02:20 +08:00
|
|
|
// logic delete
|
|
|
|
|
DelMsgLogic(ctx context.Context, userID string, seqList []uint32) error
|
2023-02-10 15:46:29 +08:00
|
|
|
DelMsgBySeqListInOneDoc(ctx context.Context, docID string, seqList []uint32) (unExistSeqList []uint32, err error)
|
2023-02-10 17:02:20 +08:00
|
|
|
ReplaceMsgToBlankByIndex(docID string, index int) (replaceMaxSeq uint32, err error)
|
2023-02-10 15:46:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type MsgDatabaseInterface interface {
|
|
|
|
|
BatchInsertChat2DB(ctx context.Context, userID string, msgList []*pbMsg.MsgDataToMQ, currentMaxSeq uint64) error
|
|
|
|
|
BatchInsertChat2Cache(ctx context.Context, insertID string, msgList []*pbMsg.MsgDataToMQ) (error, uint64)
|
|
|
|
|
DelMsgBySeqList(ctx context.Context, userID string, seqList []uint32) (totalUnExistSeqList []uint32, err error)
|
|
|
|
|
}
|