AlertService.java 924 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package com.usthe.alert.service;
  2. import com.usthe.alert.pojo.entity.Alert;
  3. import org.springframework.data.domain.Page;
  4. import org.springframework.data.domain.PageRequest;
  5. import org.springframework.data.jpa.domain.Specification;
  6. import java.util.HashSet;
  7. /**
  8. * 告警信息管理接口
  9. * @author tom
  10. * @date 2021/12/9 10:06
  11. */
  12. public interface AlertService {
  13. /**
  14. * 新增告警
  15. * @param alert 告警实体
  16. * @throws RuntimeException 新增过程异常抛出
  17. */
  18. void addAlert(Alert alert) throws RuntimeException;
  19. /**
  20. * 动态条件查询
  21. * @param specification 查询条件
  22. * @param pageRequest 分页参数
  23. * @return 查询结果
  24. */
  25. Page<Alert> getAlerts(Specification<Alert> specification, PageRequest pageRequest);
  26. /**
  27. * 根据告警ID列表批量删除告警
  28. * @param ids 告警IDs
  29. */
  30. void deleteAlerts(HashSet<Long> ids);
  31. }