2021-12-10 16:56:39 +08:00
|
|
|
package com.usthe.alert.service;
|
|
|
|
|
|
2022-03-06 21:48:00 +08:00
|
|
|
import com.usthe.alert.dto.AlertSummary;
|
2022-01-30 12:11:10 +08:00
|
|
|
import com.usthe.common.entity.alerter.Alert;
|
2021-12-10 16:56:39 +08:00
|
|
|
import org.springframework.data.domain.Page;
|
|
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
|
|
|
2021-12-13 14:50:23 +08:00
|
|
|
import java.util.HashSet;
|
2021-12-19 21:49:19 +08:00
|
|
|
import java.util.List;
|
2021-12-13 14:50:23 +08:00
|
|
|
|
2021-12-10 16:56:39 +08:00
|
|
|
/**
|
2022-04-10 20:51:30 +08:00
|
|
|
* Alarm information management interface
|
2021-12-10 16:56:39 +08:00
|
|
|
* 告警信息管理接口
|
2022-04-10 20:51:30 +08:00
|
|
|
*
|
2021-12-10 16:56:39 +08:00
|
|
|
* @author tom
|
|
|
|
|
* @date 2021/12/9 10:06
|
|
|
|
|
*/
|
|
|
|
|
public interface AlertService {
|
|
|
|
|
|
|
|
|
|
/**
|
2022-04-10 20:51:30 +08:00
|
|
|
* Add alarm record
|
|
|
|
|
* 新增告警记录
|
|
|
|
|
*
|
|
|
|
|
* @param alert Alert entity 告警实体
|
|
|
|
|
* @throws RuntimeException Add process exception throw 新增过程异常抛出
|
2021-12-10 16:56:39 +08:00
|
|
|
*/
|
|
|
|
|
void addAlert(Alert alert) throws RuntimeException;
|
|
|
|
|
|
|
|
|
|
/**
|
2022-04-10 20:51:30 +08:00
|
|
|
* Dynamic conditional query
|
2021-12-10 16:56:39 +08:00
|
|
|
* 动态条件查询
|
2022-04-10 20:51:30 +08:00
|
|
|
*
|
|
|
|
|
* @param specification Query conditions 查询条件
|
|
|
|
|
* @param pageRequest pagination parameters 分页参数
|
|
|
|
|
* @return search result 查询结果
|
2021-12-10 16:56:39 +08:00
|
|
|
*/
|
|
|
|
|
Page<Alert> getAlerts(Specification<Alert> specification, PageRequest pageRequest);
|
2021-12-13 14:50:23 +08:00
|
|
|
|
|
|
|
|
/**
|
2022-04-10 20:51:30 +08:00
|
|
|
* Delete alarms in batches according to the alarm ID list
|
2021-12-13 14:50:23 +08:00
|
|
|
* 根据告警ID列表批量删除告警
|
2022-04-10 20:51:30 +08:00
|
|
|
*
|
|
|
|
|
* @param ids Alarm ID List 告警IDS
|
2021-12-13 14:50:23 +08:00
|
|
|
*/
|
|
|
|
|
void deleteAlerts(HashSet<Long> ids);
|
2021-12-19 21:49:19 +08:00
|
|
|
|
|
|
|
|
/**
|
2022-04-10 20:51:30 +08:00
|
|
|
* Update the alarm status according to the alarm ID-status value
|
2021-12-19 21:49:19 +08:00
|
|
|
* 根据告警ID-状态值 更新告警状态
|
2022-04-10 20:51:30 +08:00
|
|
|
*
|
|
|
|
|
* @param status Alarm status to be modified 待修改为的告警状态
|
|
|
|
|
* @param ids Alarm ID List to be modified 待修改的告警ID集合
|
2021-12-19 21:49:19 +08:00
|
|
|
*/
|
|
|
|
|
void editAlertStatus(Byte status, List<Long> ids);
|
2022-03-06 21:48:00 +08:00
|
|
|
|
|
|
|
|
/**
|
2022-04-10 20:51:30 +08:00
|
|
|
* Get alarm statistics information 获取告警统计信息
|
|
|
|
|
*
|
|
|
|
|
* @return Alarm statistics information 告警统计
|
2022-03-06 21:48:00 +08:00
|
|
|
*/
|
|
|
|
|
AlertSummary getAlertsSummary();
|
|
|
|
|
|
2021-12-10 16:56:39 +08:00
|
|
|
}
|