|
|
@@ -1,18 +1,13 @@
|
|
|
package com.goafanti.core.websocket;
|
|
|
|
|
|
+import com.goafanti.common.utils.LoggerUtils;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.web.socket.*;
|
|
|
+
|
|
|
import java.io.IOException;
|
|
|
import java.util.Map;
|
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
|
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.web.socket.CloseStatus;
|
|
|
-import org.springframework.web.socket.TextMessage;
|
|
|
-import org.springframework.web.socket.WebSocketHandler;
|
|
|
-import org.springframework.web.socket.WebSocketMessage;
|
|
|
-import org.springframework.web.socket.WebSocketSession;
|
|
|
-
|
|
|
-import com.goafanti.common.utils.LoggerUtils;
|
|
|
-
|
|
|
@Service
|
|
|
public class SystemWebSocketHandler implements WebSocketHandler {
|
|
|
|
|
|
@@ -86,6 +81,7 @@ public class SystemWebSocketHandler implements WebSocketHandler {
|
|
|
try {
|
|
|
if (user.isOpen()) {
|
|
|
user.sendMessage(message);
|
|
|
+ LoggerUtils.debug(getClass(), "用户" + userId + "websocket通知消息成功");
|
|
|
}
|
|
|
} catch (IOException e) {
|
|
|
LoggerUtils.error(getClass(), "用户" + userId + "websocket通知异常", e);
|