通知告警规则引擎
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
|
||||
namespace Model.Entity.Inspection
|
||||
{
|
||||
/// <summary>
|
||||
/// 告警规则(规则实例:查看所有设备告警的规则列表)
|
||||
/// </summary>
|
||||
public class AlertRuleEntity : BaseEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 规则名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "规则名称", Length = 100)]
|
||||
public string RuleName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 适用设备类型(空表示全部设备,如 TemperatureBox 温度箱)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "适用设备类型", Length = 64, IsNullable = true)]
|
||||
public string DeviceType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 监测指标(Temperature 温度 / Humidity 湿度等)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "监测指标", Length = 64)]
|
||||
public string Metric { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 比较运算符(> >= < <= = ≠)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "比较运算符", Length = 10)]
|
||||
public string Operator { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 阈值
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "阈值", IsNullable = true)]
|
||||
public double? Threshold { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 告警级别(信息/警告/紧急)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "告警级别", Length = 32)]
|
||||
public string AlarmLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否启用")]
|
||||
public bool Enabled { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 触发次数(系统统计)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "触发次数")]
|
||||
public int TriggerCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最近触发时间(系统统计)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "最近触发时间", IsNullable = true)]
|
||||
public DateTime? LastAlarmTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "备注", Length = 500, IsNullable = true)]
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
|
||||
namespace Model.Entity.Inspection
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据转发规则(配置数据转发规则,支持通过消息通知的方式定时转发数据)
|
||||
/// </summary>
|
||||
public class DataForwardRuleEntity : BaseEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 转发规则名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "转发规则名称", Length = 100)]
|
||||
public string ForwardName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 源设备类型(空表示全部设备,如 TemperatureBox 温度箱)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "源设备类型", Length = 64, IsNullable = true)]
|
||||
public string SourceDeviceType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 转发间隔(秒)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "转发间隔(秒)")]
|
||||
public int ForwardInterval { get; set; } = 60;
|
||||
|
||||
/// <summary>
|
||||
/// 通知方式(Email 邮件 / Sms 短信 / Http 接口推送)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "通知方式", Length = 32)]
|
||||
public string NotifyType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 目标地址(邮箱 / 手机号 / 接口URL)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "目标地址", Length = 200)]
|
||||
public string TargetAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否启用")]
|
||||
public bool Enabled { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 最近转发时间(系统统计)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "最近转发时间", IsNullable = true)]
|
||||
public DateTime? LastForwardTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "备注", Length = 500, IsNullable = true)]
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user