|
@@ -8,6 +8,7 @@ import com.jjt.common.enums.BusinessType;
|
|
|
import com.jjt.common.utils.poi.ExcelUtil;
|
|
|
import com.jjt.hl.domain.HlMetricsScore;
|
|
|
import com.jjt.hl.service.IHlMetricsScoreService;
|
|
|
+import com.jjt.hl.vo.ScoreDetailVO;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
@@ -15,7 +16,10 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.Random;
|
|
|
|
|
|
/**
|
|
|
* 业务模型健康度指标得分Controller
|
|
@@ -43,6 +47,30 @@ public class HlMetricsScoreController extends BaseController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 查询模型健康度分类得分列表
|
|
|
+ */
|
|
|
+ @ApiOperation("根据指标查询扣分明细")
|
|
|
+ @GetMapping("/detail/{scoreMetricsId}")
|
|
|
+ public AjaxResult detail4score(@PathVariable("scoreMetricsId") Long scoreMetricsId) {
|
|
|
+ //TODO 到处都是模拟数据
|
|
|
+// String[] names = {"cluster-node1", "cluster-node2", "cluster-node3", "cluster-node4", "cluster-node5"};
|
|
|
+// String[] remarks = {"超过80%,且持续1小时", "超过60,且持续1小时", "超过90%", "超过200,且持续1小时", "当前值超过5"};
|
|
|
+ Random random = new Random();
|
|
|
+ List<ScoreDetailVO> list = new ArrayList<>();
|
|
|
+ for (int i = 0; i < 5; i++) {
|
|
|
+ ScoreDetailVO vo = new ScoreDetailVO();
|
|
|
+ vo.setObjName("node-" + random.nextInt(50));
|
|
|
+ vo.setEvent("超过80,且持续1小时");
|
|
|
+ vo.setMetricsName("内存使用率");
|
|
|
+ float v = 80F + random.nextInt(20);
|
|
|
+ vo.setValue(v);
|
|
|
+ vo.setTime(new Date());
|
|
|
+ list.add(vo);
|
|
|
+ }
|
|
|
+ return AjaxResult.success(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 查询业务模型健康度指标得分列表
|
|
|
*/
|
|
|
@ApiOperation("查询业务模型健康度指标得分列表")
|