[alerter,manager] 告警信息入库,监控状态变更联动
This commit is contained in:
14
alerter/src/main/java/com/usthe/alert/dao/AlertDao.java
Normal file
14
alerter/src/main/java/com/usthe/alert/dao/AlertDao.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package com.usthe.alert.dao;
|
||||
|
||||
import com.usthe.alert.pojo.entity.Alert;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* Alert 数据库操作
|
||||
* @author tom
|
||||
* @date 2021/12/9 10:03
|
||||
*/
|
||||
public interface AlertDao extends JpaRepository<Alert, Long>, JpaSpecificationExecutor<Alert> {
|
||||
|
||||
}
|
||||
@@ -29,7 +29,7 @@ public interface AlertDefineDao extends JpaRepository<AlertDefine, Long>, JpaSpe
|
||||
* @return 告警定义列表
|
||||
*/
|
||||
@Query("select define from AlertDefine define join AlertDefineBind bind on bind.alertDefineId = define.id " +
|
||||
"where bind.monitorId = :monitorId and define.metric = :metrics")
|
||||
"where bind.monitorId = :monitorId and define.metric = :metrics and define.enable = true")
|
||||
List<AlertDefine> queryAlertDefinesByMonitor(@Param(value = "monitorId") Long monitorId,
|
||||
@Param(value = "metrics") String metrics);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user