jiazx0107@163.com
2023-10-26 233c0e20548cadafb77efdcb3418f38c6658bbad
src/main/java/com/fzzy/gateway/hx2023/websocket/WebSocketDeviceLed.java
@@ -1,7 +1,7 @@
package com.fzzy.gateway.hx2023.websocket;
import com.alibaba.fastjson.JSONObject;
import com.fzzy.gateway.hx2023.ScConstant;
import com.fzzy.gateway.GatewayUtils;
import com.fzzy.gateway.hx2023.data.WebSocketPacket;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
@@ -42,7 +42,7 @@
        sessionPool.put(key, session);
        sessionIds.put(session.getId(), key);
        ScConstant.updateOnline(deviceId);
        GatewayUtils.updateOnline(deviceId);
        log.info("new webSocket,clientId={}", key);
    }
@@ -57,7 +57,7 @@
        String deviceId = key.substring(0, key.indexOf("-"));
        ScConstant.updateOffOnline(deviceId);
        GatewayUtils.updateOffOnline(deviceId);
        log.info("WebSocket连接关闭={}", key);
@@ -84,7 +84,7 @@
        String deviceId = key.substring(0, key.indexOf("-"));
        ScConstant.updateOffOnline(deviceId);
        GatewayUtils.updateOffOnline(deviceId);
        sessionPool.remove(key);
        sessionIds.remove(session.getId());