AlertService.java 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package com.usthe.alert.service;
  2. import com.usthe.alert.dto.AlertSummary;
  3. import com.usthe.common.entity.alerter.Alert;
  4. import org.springframework.data.domain.Page;
  5. import org.springframework.data.domain.PageRequest;
  6. import org.springframework.data.jpa.domain.Specification;
  7. import java.util.HashSet;
  8. import java.util.List;
  9. /**
  10. * 告警信息管理接口
  11. * @author tom
  12. * @date 2021/12/9 10:06
  13. */
  14. public interface AlertService {
  15. /**
  16. * 新增告警
  17. * @param alert 告警实体
  18. * @throws RuntimeException 新增过程异常抛出
  19. */
  20. void addAlert(Alert alert) throws RuntimeException;
  21. /**
  22. * 动态条件查询
  23. * @param specification 查询条件
  24. * @param pageRequest 分页参数
  25. * @return 查询结果
  26. */
  27. Page<Alert> getAlerts(Specification<Alert> specification, PageRequest pageRequest);
  28. /**
  29. * 根据告警ID列表批量删除告警
  30. * @param ids 告警IDs
  31. */
  32. void deleteAlerts(HashSet<Long> ids);
  33. /**
  34. * 根据告警ID-状态值 更新告警状态
  35. * @param status 待修改为的告警状态
  36. * @param ids 待修改的告警IDs
  37. */
  38. void editAlertStatus(Byte status, List<Long> ids);
  39. /**
  40. * 获取告警统计信息
  41. * @return 告警统计
  42. */
  43. AlertSummary getAlertsSummary();
  44. }