[monitor]feature: Alarm and receiving Chinese and English support (#82)

* fix: 代码名称优化 #huacheng

* fix: msgtype更正名称 #huacheng

* fix: 企业微信更正名称 #huacheng

* feat: Alarm and receiving Chinese and English support #huacheng

Co-authored-by: tomsun28 <tomsun28@outlook.com>
This commit is contained in:
会编程的王学长
2022-04-10 20:51:30 +08:00
committed by GitHub
parent c79f66dd9f
commit 4f13875e01
17 changed files with 333 additions and 154 deletions

View File

@@ -12,30 +12,35 @@ import java.util.List;
import java.util.Set;
/**
* Alert 数据库操作
* Alert Database Operations Alert数据库操作
*
* @author tom
* @date 2021/12/9 10:03
*/
public interface AlertDao extends JpaRepository<Alert, Long>, JpaSpecificationExecutor<Alert> {
/**
* 根据ID列表删除告警
* @param alertIds 告警ID列表
* Delete alerts based on ID list 根据ID列表删除告警
*
* @param alertIds Alert ID List 告警ID列表
*/
void deleteAlertsByIdIn(Set<Long> alertIds);
/**
* 根据告警ID-状态值 更新告警状态
*
* @param status 状态值
* @param ids 告警ID列表
* @param ids 告警ID列表
*/
@Modifying
@Query("update Alert set status = :status where id in :ids")
void updateAlertsStatus(@Param(value = "status") Byte status, @Param(value = "ids") List<Long> ids);
/**
* Query the number of unhandled alarms of each alarm severity
* 查询各个告警级别的未处理告警数量
* @return 告警数量
*
* @return Number of alerts 告警数量
*/
@Query("select new com.usthe.alert.dto.AlertPriorityNum(mo.priority, count(mo.id)) from Alert mo where mo.status = 0 group by mo.priority")
List<AlertPriorityNum> findAlertPriorityNum();