| | |
| | | |
| | | import com.wgcloud.entity.OspfErrorLog; |
| | | import com.wgcloud.entity.OspfInfo; |
| | | import com.wgcloud.entity.OspfMonitor; |
| | | import com.wgcloud.entity.SnmpInfo; |
| | | import com.wgcloud.service.OspfErrorLogService; |
| | | import com.wgcloud.service.OspfInfoService; |
| | | import com.wgcloud.service.OspfMonitorService; |
| | | import com.wgcloud.service.SnmpInfoService; |
| | | import com.wgcloud.util.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | private OspfInfoService ospfInfoService; |
| | | @Autowired |
| | | private OspfMonitorService ospfMonitorService; |
| | | @Autowired |
| | | private OspfErrorLogService ospfErrorLogService; |
| | | |
| | | @GetMapping("/getTop") |
| | |
| | | @GetMapping("/getWb") |
| | | public R getWb() throws Exception { |
| | | List<Map<String,Object>> list = new ArrayList<>(); |
| | | List<OspfInfo> ospfInfos = ospfInfoService.selectAllByParams(null); |
| | | |
| | | for (OspfInfo ospfInfo : ospfInfos) { |
| | | List<OspfMonitor> ospfMonitors = ospfMonitorService.selectAllByParams(null); |
| | | for (OspfMonitor ospfInfo : ospfMonitors) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("name",ospfInfo.getInfoContent()); |
| | | map.put("ipaddress",ospfInfo.getHostname()); |
| | | map.put("type",1); |
| | | map.put("status",1); |
| | | map.put("remoteType",ospfInfo.getRemoteType()); |
| | | list.add(map); |
| | | } |
| | | return R.ok(list); |
| | |
| | | List<Map<String,Object>> list = new ArrayList<>(); |
| | | List<OspfInfo> ospfInfos = ospfInfoService.selectAllByParams(null); |
| | | HashMap<String, Object> hxMap = new HashMap<>(); |
| | | hxMap.put("ipAddress","\n电信:192.168.1.1\n 联通:192.168.2.1\n 移动:192.168.3.1"); |
| | | hxMap.put("name","北国核心"); |
| | | hxMap.put("ipAddress","主监测设备IP"); |
| | | hxMap.put("name","主监测设备"); |
| | | hxMap.put("status","0"); |
| | | list.add(hxMap); |
| | | for (OspfInfo ospfInfo : ospfInfos) { |