|
|
@@ -9,6 +9,7 @@ import com.xunmei.common.core.domain.mediator.domain.IotAlarmData;
|
|
|
import com.xunmei.common.core.domain.notice.WebsocketNoticeLog;
|
|
|
import com.xunmei.common.core.vo.notice.WebSocketNoticeVo;
|
|
|
import com.xunmei.common.security.utils.SecurityUtils;
|
|
|
+import com.xunmei.common.websocket.dto.WebSocketMessageDto;
|
|
|
import com.xunmei.common.websocket.utils.WebSocketUtils;
|
|
|
import com.xunmei.system.api.vo.WebSocketSendVo;
|
|
|
import com.xunmei.system.dto.notice.NoticeDealDto;
|
|
|
@@ -132,7 +133,12 @@ public class NoticeServiceImpl extends ServiceImpl<NoticeLogMapper, WebsocketNot
|
|
|
for (WebSocketSendVo webSocketSendVo : list) {
|
|
|
Long userId = webSocketSendVo.getUserId();
|
|
|
JSONObject object = new JSONObject(webSocketSendVo.getContent());
|
|
|
- WebSocketUtils.sendMessage(userId, object.toString());
|
|
|
+ WebSocketMessageDto messageDto = new WebSocketMessageDto();
|
|
|
+ List<Long> sessionKeys = new ArrayList<>();
|
|
|
+ sessionKeys.add(userId);
|
|
|
+ messageDto.setSessionKeys(sessionKeys);
|
|
|
+ messageDto.setMessage(object.toString());
|
|
|
+ WebSocketUtils.publishMessage(messageDto);
|
|
|
}
|
|
|
}
|
|
|
|