pull/236/head
skiffer-git 3 years ago
parent d2474c8a72
commit 5fd91e808a

@ -1,31 +1,27 @@
package gate package gate
import ( import (
"Open_IM/pkg/common/config"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
pbChat "Open_IM/pkg/proto/chat"
sdk_ws "Open_IM/pkg/proto/sdk_ws" sdk_ws "Open_IM/pkg/proto/sdk_ws"
"strings"
) )
var MaxPullMsgNum = 100 var MaxPullMsgNum = 100
func (r *RPCServer) GenPullSeqList(currentSeq uint32, operationID string, userID string) ([]uint32, error) { func (r *RPCServer) GenPullSeqList(currentSeq uint32, operationID string, userID string) ([]uint32, error) {
return nil, nil
} }
func (r *RPCServer) GetSingleMsgForPush(operationID string, msgData *sdk_ws.MsgData, pushToUserID string, platformID string) []*sdk_ws.MsgData { func (r *RPCServer) GetSingleMsgForPush(operationID string, msgData *sdk_ws.MsgData, pushToUserID string, platformID string) []*sdk_ws.MsgData {
seqList, err := r.GenPullSeqList(msgData.Seq, operationID, pushToUserID) //seqList, err := r.GenPullSeqList(msgData.Seq, operationID, pushToUserID)
if err != nil { //if err != nil {
return nil // return nil
} //}
rpcReq := sdk_ws.PullMessageBySeqListReq{} //rpcReq := sdk_ws.PullMessageBySeqListReq{}
rpcReq.SeqList = seqList //rpcReq.SeqList = seqList
rpcReq.UserID = pushToUserID //rpcReq.UserID = pushToUserID
rpcReq.OperationID = operationID //rpcReq.OperationID = operationID
grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) //grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName)
msgClient := pbChat.NewChatClient(grpcConn) //msgClient := pbChat.NewChatClient(grpcConn)
reply, err := msgClient.PullMessageBySeqList(context.Background(), &rpcReq) //reply, err := msgClient.PullMessageBySeqList(context.Background(), &rpcReq)
return nil return nil
} }

Loading…
Cancel
Save