lxw
2023-04-06 bd989c804911b5ba0e28aa7d7dc2183f39e30a2f
领导层首页修改
1个文件已修改
8 ■■■■■ 已修改文件
src/main/java/com/whyc/webSocket/HomeAdminSocket.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/webSocket/HomeAdminSocket.java
@@ -6,10 +6,12 @@
import com.whyc.pojo.Battinf;
import com.whyc.pojo.PowerInf;
import com.whyc.pojo.StationInf;
import com.whyc.pojo.UserInf;
import com.whyc.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpSession;
import javax.websocket.*;
import javax.websocket.server.ServerEndpoint;
import java.util.HashMap;
@@ -77,10 +79,10 @@
    @OnOpen
    public void onOpen(Session session, EndpointConfig config) {
        this.session = session;
        /*HttpSession httpSession = (HttpSession) config.getUserProperties().get("httpSession");
        HttpSession httpSession = (HttpSession) config.getUserProperties().get("httpSession");
        UserInf user = (UserInf) httpSession.getAttribute("user");
        final int userId = user.getUId().intValue();*/
        final int userId = 1087;
        final int userId = user.getUId().intValue();
        //final int userId = 1087;
        Thread thread = new Thread() {
            @Override
            public void run() {