[alerter] 告警定义批量接口
This commit is contained in:
@@ -67,7 +67,7 @@ public interface AlertDefineService {
|
||||
* @param pageRequest 分页参数
|
||||
* @return 查询结果
|
||||
*/
|
||||
Page<AlertDefine> getAlertDefines(Specification<AlertDefine> specification, PageRequest pageRequest);
|
||||
Page<AlertDefine> getMonitorBindAlertDefines(Specification<AlertDefine> specification, PageRequest pageRequest);
|
||||
|
||||
/**
|
||||
* 应用告警定于与监控关联关系
|
||||
@@ -83,5 +83,13 @@ public interface AlertDefineService {
|
||||
* @param metrics 指标组
|
||||
* @return field - define[]
|
||||
*/
|
||||
Map<String, List<AlertDefine>> getAlertDefines(long monitorId, String app, String metrics);
|
||||
Map<String, List<AlertDefine>> getMonitorBindAlertDefines(long monitorId, String app, String metrics);
|
||||
|
||||
/**
|
||||
* 动态条件查询
|
||||
* @param specification 查询条件
|
||||
* @param pageRequest 分页参数
|
||||
* @return 查询结果
|
||||
*/
|
||||
Page<AlertDefine> getAlertDefines(Specification<AlertDefine> specification, PageRequest pageRequest);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public class AlertDefineServiceImpl implements AlertDefineService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<AlertDefine> getAlertDefines(Specification<AlertDefine> specification, PageRequest pageRequest) {
|
||||
public Page<AlertDefine> getMonitorBindAlertDefines(Specification<AlertDefine> specification, PageRequest pageRequest) {
|
||||
return alertDefineDao.findAll(specification, pageRequest);
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class AlertDefineServiceImpl implements AlertDefineService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<AlertDefine>> getAlertDefines(long monitorId, String app, String metrics) {
|
||||
public Map<String, List<AlertDefine>> getMonitorBindAlertDefines(long monitorId, String app, String metrics) {
|
||||
List<AlertDefine> defines = alertDefineDao.queryAlertDefinesByMonitor(monitorId, metrics);
|
||||
if (defines == null || defines.isEmpty()) {
|
||||
return null;
|
||||
@@ -96,4 +96,9 @@ public class AlertDefineServiceImpl implements AlertDefineService {
|
||||
return defines.stream().sorted(Comparator.comparing(AlertDefine::getPriority))
|
||||
.collect(Collectors.groupingBy(AlertDefine::getField));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<AlertDefine> getAlertDefines(Specification<AlertDefine> specification, PageRequest pageRequest) {
|
||||
return alertDefineDao.findAll(specification, pageRequest);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user