kongdeqiang
2025-12-03 285b20e698b0f26bdb3e9182d367ecae2c5a63d0
src/main/java/com/wgcloud/controller/dp/DpController.java
@@ -9,6 +9,7 @@
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;
@@ -84,6 +85,7 @@
            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);
@@ -113,6 +115,11 @@
    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());
@@ -123,5 +130,17 @@
        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();
        }
    }
}