2025-12-09 zwy 整理代码,减少日志打印
| | |
| | | if (isSubscribe) { |
| | | // 订阅操作:不存在则创建,存在则添加用户 |
| | | subscriptions.computeIfAbsent(subscriptionKey, k -> ConcurrentHashMap.newKeySet()).add(userId); |
| | | log.info("用户[{}]订阅设备[{}]的[{}]类型消息", userId, sn, type); |
| | | // log.info("用户[{}]订阅设备[{}]的[{}]类型消息", userId, sn, type); |
| | | |
| | | // 直播类型订阅:触发开启直播 |
| | | if (MessageType.LIVESTREAM.getType().equals(type)) { |
| | |
| | | return; |
| | | } |
| | | |
| | | log.info("开始向所有在线客户端({}人)广播消息", userSessions.size()); |
| | | // log.info("开始向所有在线客户端({}人)广播消息", userSessions.size()); |
| | | // 遍历所有在线会话发送消息 |
| | | for (Map.Entry<String, WebSocketSession> entry : userSessions.entrySet()) { |
| | | String userId = entry.getKey(); |