Commit 6552ef81 authored by 耿迪迪's avatar 耿迪迪

websocket 接口修改 gengdidi

parent ea9efa47
...@@ -3,8 +3,6 @@ package com.zehong.web.controller.websocket; ...@@ -3,8 +3,6 @@ package com.zehong.web.controller.websocket;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.zehong.system.domain.vo.DeviceAlarmVo; import com.zehong.system.domain.vo.DeviceAlarmVo;
import com.zehong.system.service.ITDeviceAlarmService; import com.zehong.system.service.ITDeviceAlarmService;
import com.zehong.system.service.ITDeviceInfoService;
import com.zehong.system.service.ITPipeService;
import com.zehong.system.service.WebSocketServer; import com.zehong.system.service.WebSocketServer;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -25,25 +23,11 @@ public class WebSocketController { ...@@ -25,25 +23,11 @@ public class WebSocketController {
@Autowired @Autowired
private ITDeviceAlarmService itDeviceAlarmService; private ITDeviceAlarmService itDeviceAlarmService;
@Autowired
private ITDeviceInfoService itDeviceInfoService;
@Autowired
private ITPipeService itPipeService;
private final static String PIPE_TYPE = "0";
@GetMapping("/send") @GetMapping("/send")
public void send(int alarmId){ public void send(int alarmId){
try { try {
DeviceAlarmVo alarm = itDeviceAlarmService.selectTDeviceAlarmById(alarmId); DeviceAlarmVo alarm = itDeviceAlarmService.selectTDeviceAlarmById(alarmId);
/*JSONObject json = new JSONObject();
json.put("alarmInfo",alarm);*/
/*if(PIPE_TYPE.equals(alarm.getAlarmType())){
json.put("deviceInfo",itPipeService.selectTPipeById(alarm.getDeviceId()));
}else{
json.put("deviceInfo",itDeviceInfoService.selectTDeviceInfoById(alarm.getDeviceId()));
}*/
webSocketServer.batchSendMessage(JSONObject.toJSONString(alarm)); webSocketServer.batchSendMessage(JSONObject.toJSONString(alarm));
} catch (Exception e) { } catch (Exception e) {
log.error("wesocket发送失败!"); log.error("wesocket发送失败!");
......
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