NoticeConfigService.java 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. package com.usthe.manager.service;
  2. import com.usthe.common.entity.alerter.Alert;
  3. import com.usthe.common.entity.manager.NoticeReceiver;
  4. import com.usthe.common.entity.manager.NoticeRule;
  5. import org.springframework.data.jpa.domain.Specification;
  6. import java.util.List;
  7. /**
  8. * Message notification configuration interface
  9. * 消息通知配置接口
  10. *
  11. * @author tom
  12. * @date 2021/12/16 16:14
  13. */
  14. public interface NoticeConfigService {
  15. /**
  16. * Dynamic conditional query
  17. * 动态条件查询
  18. *
  19. * @param specification Query conditions 查询条件
  20. * @return Search result 查询结果
  21. */
  22. List<NoticeReceiver> getNoticeReceivers(Specification<NoticeReceiver> specification);
  23. /**
  24. * Dynamic conditional query
  25. * 动态条件查询
  26. *
  27. * @param specification Query conditions 查询条件
  28. * @return Search result 查询结果
  29. */
  30. List<NoticeRule> getNoticeRules(Specification<NoticeRule> specification);
  31. /**
  32. * Add a notification recipient
  33. * 新增一个通知接收人
  34. *
  35. * @param noticeReceiver recipient information 接收人信息
  36. */
  37. void addReceiver(NoticeReceiver noticeReceiver);
  38. /**
  39. * Modify notification recipients
  40. * 修改通知接收人
  41. *
  42. * @param noticeReceiver recipient information 接收人信息
  43. */
  44. void editReceiver(NoticeReceiver noticeReceiver);
  45. /**
  46. * Delete recipient information based on recipient ID
  47. * 根据接收人ID删除接收人信息
  48. *
  49. * @param receiverId Recipient ID 接收人ID
  50. */
  51. void deleteReceiver(Long receiverId);
  52. /**
  53. * Added notification policy
  54. * 新增通知策略
  55. *
  56. * @param noticeRule Notification strategy 通知策略
  57. */
  58. void addNoticeRule(NoticeRule noticeRule);
  59. /**
  60. * Modify Notification Policy
  61. * 修改通知策略
  62. *
  63. * @param noticeRule Notification strategy 通知策略
  64. */
  65. void editNoticeRule(NoticeRule noticeRule);
  66. /**
  67. * Delete the specified notification policy
  68. * 删除指定的通知策略
  69. *
  70. * @param ruleId Notification Policy ID 通知策略ID
  71. */
  72. void deleteNoticeRule(Long ruleId);
  73. /**
  74. * According to the alarm information matching all notification policies, filter out the recipients who need to be notified
  75. * 根据告警信息与所有通知策略匹配,过滤出需要通知的接收人
  76. *
  77. * @param alert Alarm information 告警信息
  78. * @return Receiver 接收人
  79. */
  80. List<NoticeReceiver> getReceiverFilterRule(Alert alert);
  81. }