From c3432d4eef8e6545708e30004189ca3f27b8a067 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期四, 04 七月 2024 17:58:09 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev

---
 src/main/java/com/ycl/jxkg/server/WebsocketServer.java |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/ycl/jxkg/server/WebsocketServer.java b/src/main/java/com/ycl/jxkg/server/WebsocketServer.java
index 9886607..2c3a644 100644
--- a/src/main/java/com/ycl/jxkg/server/WebsocketServer.java
+++ b/src/main/java/com/ycl/jxkg/server/WebsocketServer.java
@@ -20,6 +20,7 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.concurrent.CopyOnWriteArraySet;
 
 /**
@@ -133,4 +134,15 @@
         }
     }
 
+    /**
+     * 鏍¢獙鐢ㄦ埛鏄惁鍦ㄧ嚎
+     *
+     * @param userId
+     * @return
+     */
+    public Boolean checkUserOnline(Integer userId) {
+        Session session = SESSION_POOL.get(userId);
+        return Objects.nonNull(session);
+    }
+
 }

--
Gitblit v1.8.0