Browse Source

更新 HomeController 中 /api/devops/dashboard 接口返回的数据

reghao 3 weeks ago
parent
commit
511db9e9c0

+ 5 - 4
mgr/src/main/java/cn/reghao/devops/mgr/admin/controller/HomeController.java

@@ -1,5 +1,6 @@
 package cn.reghao.devops.mgr.admin.controller;
 
+import cn.reghao.devops.mgr.admin.model.vo.DashboardData;
 import cn.reghao.devops.mgr.admin.service.HomeViewService;
 import cn.reghao.devops.mgr.ops.mon.service.InspectionService;
 import cn.reghao.devops.mgr.ops.mon.service.PrometheusService;
@@ -41,11 +42,11 @@ public class HomeController {
     @GetMapping(value = "/api/devops/dashboard", produces = MediaType.APPLICATION_JSON_VALUE)
     @ResponseBody
     public String dashboardData() {
-        //DashboardData dashboardData = homeViewService.getDashboardData();
-        InspectionReport inspectionReport = inspectionService.getInspectionReport();
+        DashboardData dashboardData = homeViewService.getDashboardData();
+        //InspectionReport inspectionReport = inspectionService.getInspectionReport();
         //PillarReportDTO pillarReportData = prometheusService.getPillarReportData();
-        if (inspectionReport != null) {
-            return WebResult.success(inspectionReport);
+        if (dashboardData != null) {
+            return WebResult.success(dashboardData);
         }
 
         return WebResult.failWithMsg("get dashboard data failed");