[alerter] 告警信息批量接口
This commit is contained in:
@@ -5,6 +5,8 @@ import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
/**
|
||||
* 告警信息管理接口
|
||||
* @author tom
|
||||
@@ -26,4 +28,10 @@ public interface AlertService {
|
||||
* @return 查询结果
|
||||
*/
|
||||
Page<Alert> getAlerts(Specification<Alert> specification, PageRequest pageRequest);
|
||||
|
||||
/**
|
||||
* 根据告警ID列表批量删除告警
|
||||
* @param ids 告警IDs
|
||||
*/
|
||||
void deleteAlerts(HashSet<Long> ids);
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ public class AlertDefineServiceImpl implements AlertDefineService {
|
||||
|
||||
@Override
|
||||
public void deleteAlertDefines(Set<Long> alertIds) throws RuntimeException {
|
||||
alertDefineDao.deleteAllByIdIn(alertIds);
|
||||
alertDefineDao.deleteAlertDefinesByIdIn(alertIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -9,6 +9,8 @@ import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
/**
|
||||
* 告警信息服务实现
|
||||
* @author tom
|
||||
@@ -29,4 +31,9 @@ public class AlertServiceImpl implements AlertService {
|
||||
public Page<Alert> getAlerts(Specification<Alert> specification, PageRequest pageRequest) {
|
||||
return alertDao.findAll(specification, pageRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAlerts(HashSet<Long> ids) {
|
||||
alertDao.deleteAlertsByIdIn(ids);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user