| | |
| | | import com.wgcloud.util.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("date",sdf.format(ospfInfo.getCreateTime())); |
| | | map.put("name",ospfInfo.getInfoContent()); |
| | | map.put("id",ospfInfo.getId()); |
| | | map.put("ipaddress",ospfInfo.getHostname()); |
| | | map.put("status",ospfInfo.getState()); |
| | | list.add(map); |
| | |
| | | public R getInfo() throws Exception { |
| | | 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("status","0"); |
| | | list.add(hxMap); |
| | | for (OspfInfo ospfInfo : ospfInfos) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("ipAddress",ospfInfo.getHostname()); |
| | |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @GetMapping("/handle") |
| | | public R handle(String id) throws Exception { |
| | | OspfErrorLog ospfErrorLog = ospfErrorLogService.selectById(id); |
| | | if(ospfErrorLog.getState().equals("1")){ |
| | | ospfErrorLog.setState("0"); |
| | | ospfErrorLogService.updateById(ospfErrorLog); |
| | | return R.ok(); |
| | | }else { |
| | | return R.ok(); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |