|
|
@ -5,7 +5,7 @@ import (
|
|
|
|
"Open_IM/pkg/common/log"
|
|
|
|
"Open_IM/pkg/common/log"
|
|
|
|
"Open_IM/pkg/common/token_verify"
|
|
|
|
"Open_IM/pkg/common/token_verify"
|
|
|
|
"Open_IM/pkg/grpc-etcdv3/getcdv3"
|
|
|
|
"Open_IM/pkg/grpc-etcdv3/getcdv3"
|
|
|
|
"Open_IM/pkg/proto/chat"
|
|
|
|
"Open_IM/pkg/proto/msg"
|
|
|
|
open_im_sdk "Open_IM/pkg/proto/sdk_ws"
|
|
|
|
open_im_sdk "Open_IM/pkg/proto/sdk_ws"
|
|
|
|
"Open_IM/pkg/utils"
|
|
|
|
"Open_IM/pkg/utils"
|
|
|
|
"context"
|
|
|
|
"context"
|
|
|
@ -51,14 +51,14 @@ func PullMsgBySeqList(c *gin.Context) {
|
|
|
|
pbData.OperationID = params.OperationID
|
|
|
|
pbData.OperationID = params.OperationID
|
|
|
|
pbData.SeqList = params.SeqList
|
|
|
|
pbData.SeqList = params.SeqList
|
|
|
|
|
|
|
|
|
|
|
|
grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, pbData.OperationID)
|
|
|
|
grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMsgName, pbData.OperationID)
|
|
|
|
if grpcConn == nil {
|
|
|
|
if grpcConn == nil {
|
|
|
|
errMsg := pbData.OperationID + "getcdv3.GetConn == nil"
|
|
|
|
errMsg := pbData.OperationID + "getcdv3.GetConn == nil"
|
|
|
|
log.NewError(pbData.OperationID, errMsg)
|
|
|
|
log.NewError(pbData.OperationID, errMsg)
|
|
|
|
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
|
|
|
|
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
msgClient := pbChat.NewChatClient(grpcConn)
|
|
|
|
msgClient := msg.NewMsgClient(grpcConn)
|
|
|
|
reply, err := msgClient.PullMessageBySeqList(context.Background(), &pbData)
|
|
|
|
reply, err := msgClient.PullMessageBySeqList(context.Background(), &pbData)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
log.Error(pbData.OperationID, "PullMessageBySeqList error", err.Error())
|
|
|
|
log.Error(pbData.OperationID, "PullMessageBySeqList error", err.Error())
|
|
|
|