[alerter] 告警信息批量接口

This commit is contained in:
tomsun28
2021-12-13 14:50:23 +08:00
parent 23def5cc37
commit 83449a8556
7 changed files with 41 additions and 3 deletions

View File

@@ -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);
}

View File

@@ -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

View File

@@ -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);
}
}