From 9a35af9fb2beb3aa43572184b1a10b83e6484420 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Mon, 21 Feb 2022 15:17:55 +0800 Subject: [PATCH] replace mongo driver --- internal/msg_transfer/logic/db.go | 4 ++-- internal/rpc/msg/pull_message.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/msg_transfer/logic/db.go b/internal/msg_transfer/logic/db.go index 549ebd1cf..edc269f9f 100644 --- a/internal/msg_transfer/logic/db.go +++ b/internal/msg_transfer/logic/db.go @@ -18,6 +18,6 @@ func saveUserChat(uid string, msg *pbMsg.MsgDataToMQ) error { pbSaveData := pbMsg.MsgDataToDB{} pbSaveData.MsgData = msg.MsgData log.NewInfo(msg.OperationID, "IncrUserSeq cost time", utils.GetCurrentTimestampByMill()-time) -// return db.DB.SaveUserChat(uid, pbSaveData.MsgData.SendTime, &pbSaveData) - return db.DB.SaveUserChatMongo2(uid, pbSaveData.MsgData.SendTime, &pbSaveData) + return db.DB.SaveUserChat(uid, pbSaveData.MsgData.SendTime, &pbSaveData) +// return db.DB.SaveUserChatMongo2(uid, pbSaveData.MsgData.SendTime, &pbSaveData) } diff --git a/internal/rpc/msg/pull_message.go b/internal/rpc/msg/pull_message.go index 56b79e39f..126c6eb29 100644 --- a/internal/rpc/msg/pull_message.go +++ b/internal/rpc/msg/pull_message.go @@ -39,8 +39,8 @@ func (rpc *rpcChat) GetMaxAndMinSeq(_ context.Context, in *pbMsg.GetMaxAndMinSeq func (rpc *rpcChat) PullMessageBySeqList(_ context.Context, in *open_im_sdk.PullMessageBySeqListReq) (*open_im_sdk.PullMessageBySeqListResp, error) { log.NewInfo(in.OperationID, "rpc PullMessageBySeqList is arriving", in.String()) resp := new(open_im_sdk.PullMessageBySeqListResp) -// msgList, err := commonDB.DB.GetMsgBySeqList(in.UserID, in.SeqList, in.OperationID) - msgList, err := commonDB.DB.GetMsgBySeqListMongo2(in.UserID, in.SeqList, in.OperationID) + msgList, err := commonDB.DB.GetMsgBySeqList(in.UserID, in.SeqList, in.OperationID) +// msgList, err := commonDB.DB.GetMsgBySeqListMongo2(in.UserID, in.SeqList, in.OperationID) if err != nil { log.ErrorByKv("PullMessageBySeqList data error", in.OperationID, in.String()) resp.ErrCode = 201