pull/258/head
skiffer-git 3 years ago
parent f383d6c636
commit 663db12594

@ -1 +1 @@
Subproject commit d471ef590b1c00c553821de715d23be03c0c8142
Subproject commit 18c0a4485c8a3116bca4b782cc3879375d00d937

@ -185,14 +185,14 @@ func ManagementSendMsg(c *gin.Context) {
pbData := newUserSendMsgReq(&params)
log.Info(params.OperationID, "", "api ManagementSendMsg call start..., [data: %s]", pbData.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, params.OperationID)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMsgName, params.OperationID)
if etcdConn == nil {
errMsg := params.OperationID + "getcdv3.GetConn == nil"
log.NewError(params.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbChat.NewChatClient(etcdConn)
client := pbChat.NewMsgClient(etcdConn)
log.Info(params.OperationID, "", "api ManagementSendMsg call, api call rpc...")
@ -294,14 +294,14 @@ func ManagementBatchSendMsg(c *gin.Context) {
pbData := newUserSendMsgReq(req)
pbData.MsgData.RecvID = recvID
log.Info(params.OperationID, "", "api ManagementSendMsg call start..., ", pbData.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, params.OperationID)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMsgName, params.OperationID)
if etcdConn == nil {
errMsg := params.OperationID + "getcdv3.GetConn == nil"
log.NewError(params.OperationID, errMsg)
resp.Data.FailedIDList = append(resp.Data.FailedIDList, recvID)
continue
}
client := pbChat.NewChatClient(etcdConn)
client := pbChat.NewMsgClient(etcdConn)
rpcResp, err := client.SendMsg(context.Background(), pbData)
if err != nil {
log.NewError(params.OperationID, "call delete UserSendMsg rpc server failed", err.Error())

@ -198,9 +198,9 @@ func GetUsersOnlineStatus(c *gin.Context) {
var wsResult []*pbRelay.GetUsersOnlineStatusResp_SuccessResult
var respResult []*pbRelay.GetUsersOnlineStatusResp_SuccessResult
flag := false
grpcCons := getcdv3.GetConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOnlineMessageRelayName)
grpcCons := getcdv3.GetConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImRelayName)
for _, v := range grpcCons {
client := pbRelay.NewOnlineMessageRelayServiceClient(v)
client := pbRelay.NewRelayClient(v)
reply, err := client.GetUsersOnlineStatus(context.Background(), req)
if err != nil {
log.NewError(params.OperationID, "GetUsersOnlineStatus rpc err", req.String(), err.Error())

Loading…
Cancel
Save