whycxzp
2023-07-27 aedf1c438d5df3834c57a198183c550a73c47f34
更新
1个文件已修改
10 ■■■■ 已修改文件
src/main/java/com/whyc/webSocket/GroupStationSocket.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/webSocket/GroupStationSocket.java
@@ -42,10 +42,10 @@
    @OnOpen
    public void onOpen(Session session, EndpointConfig config){
        this.session = session;
        HttpSession httpSession = (HttpSession) config.getUserProperties().get("httpSession");
        UserInf user = (UserInf) httpSession.getAttribute("user");
        final int userId = user.getUId().intValue();
        //final int userId = 1001;
        //HttpSession httpSession = (HttpSession) config.getUserProperties().get("httpSession");
        //UserInf user = (UserInf) httpSession.getAttribute("user");
        //final int userId = user.getUId().intValue();
        final int userId = 1001;
        Thread thread = new Thread() {
            @Override
            public void run() {
@@ -53,7 +53,7 @@
                    while (!currentThread().isInterrupted()) {
                        Response groupWithStationAndAlarm = baoJiGroupService.getGroupWithStationAndAlarm(userId);
                        session.getBasicRemote().sendObject(groupWithStationAndAlarm);
                        sleep(4000);
                        sleep(10000);
                    }
                } catch (Exception e) {
                    e.printStackTrace();