修改华为融合通信 单呼 -> 多呼
This commit is contained in:
parent
84b0a0438f
commit
73d287a877
@ -9,6 +9,9 @@ import ink.wgink.module.instantmessage.websocket.pojo.WebSocketClientMessage;
|
||||
import ink.wgink.pojo.session.WebSocketSession;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName: VideoCallServiceImpl
|
||||
* @Description: 视频通话
|
||||
@ -21,12 +24,14 @@ public class HuaweiRtcServiceImpl implements IHuaweiRtcService {
|
||||
|
||||
@Override
|
||||
public void rtcCall(WebSocketClientMessage webSocketClientMessage) throws UserOfflineException {
|
||||
String receiverUserId = webSocketClientMessage.getTo();
|
||||
WebSocketSession onlineUser = WebSocketChannelManager.getInstance().getOnlineUser(receiverUserId, ISmartCityUserCenterConsts.APP_CLIENT_NAME);
|
||||
if (onlineUser == null) {
|
||||
throw new RtcUserOfflineException("用户不在线");
|
||||
List<String> receiverUserIds = Arrays.asList(webSocketClientMessage.getTo().split(","));
|
||||
List<WebSocketSession> onlineUsers = WebSocketChannelManager.getInstance().listOnlineUser(receiverUserIds, ISmartCityUserCenterConsts.APP_CLIENT_NAME);
|
||||
if (onlineUsers.isEmpty()) {
|
||||
throw new RtcUserOfflineException("没有在线用户");
|
||||
}
|
||||
WebSocketChannelManager.getInstance().sendText(onlineUser.getChannel(), webSocketClientMessage);
|
||||
onlineUsers.forEach(onlineUser -> {
|
||||
WebSocketChannelManager.getInstance().sendText(onlineUser.getChannel(), webSocketClientMessage);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user