Commit b53579ab authored by 高飞's avatar 高飞

xintiao

parent 278b0635
...@@ -2,6 +2,7 @@ package com.hzjt.handler; ...@@ -2,6 +2,7 @@ package com.hzjt.handler;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.hzjt.service.TraffFlowService; import com.hzjt.service.TraffFlowService;
import com.hzjt.util.DateUtils;
import com.hzjt.util.JsonUtil; import com.hzjt.util.JsonUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -9,9 +10,7 @@ import org.springframework.stereotype.Component; ...@@ -9,9 +10,7 @@ import org.springframework.stereotype.Component;
import javax.websocket.*; import javax.websocket.*;
import javax.websocket.server.PathParam; import javax.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint; import javax.websocket.server.ServerEndpoint;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
@Slf4j @Slf4j
...@@ -85,6 +84,13 @@ public class WebSocket { ...@@ -85,6 +84,13 @@ public class WebSocket {
} }
} }
if(message.indexOf("HEARTBEAT")>=0){
Map map=new HashMap();
map.put("type","HEARTBEAT");
map.put("ts",new Date().getTime());
AppointSending(name, JSONUtil.toJsonStr(map));
}
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment