搭建消息告警模块以及跨网推送服务,支持企微,飞书,钉钉通知

This commit is contained in:
2026-09-03 14:02:35 +08:00
parent cfa8e78d33
commit 3927b0c201
40 changed files with 4360 additions and 7 deletions
@@ -0,0 +1,58 @@
using SqlSugar;
namespace Model.Entity.Inspection
{
/// <summary>
/// 告警通知规则(按告警级别配置通知渠道与接收人,支持值班排班关联与静默期)
/// </summary>
public class AlertNotifyRuleEntity : BaseEntity
{
/// <summary>
/// 规则名称
/// </summary>
[SugarColumn(ColumnDescription = "规则名称", Length = 100)]
public string RuleName { get; set; }
/// <summary>
/// 适用告警级别(信息/警告/紧急)
/// </summary>
[SugarColumn(ColumnDescription = "适用告警级别")]
public AlertLevelEnum AlertLevel { get; set; }
/// <summary>
/// 通知渠道Id(关联 AlertNotifyChannelEntity.Id
/// </summary>
[SugarColumn(ColumnDescription = "通知渠道Id")]
public long ChannelId { get; set; }
/// <summary>
/// 接收人(@手机号/企微账号,逗号分隔,可空表示不@)
/// </summary>
[SugarColumn(ColumnDescription = "接收人", Length = 500, IsNullable = true)]
public string Receivers { get; set; }
/// <summary>
/// 是否通知当班值班人(按告警时间查值班排班表)
/// </summary>
[SugarColumn(ColumnDescription = "是否通知值班人")]
public bool NotifyDutyPerson { get; set; }
/// <summary>
/// 静默期(分钟):同一告警合并窗口内重复触发时,静默期内不重复推送,0表示每次必推
/// </summary>
[SugarColumn(ColumnDescription = "静默期分钟")]
public int SilenceMinutes { get; set; } = 5;
/// <summary>
/// 是否启用
/// </summary>
[SugarColumn(ColumnDescription = "是否启用")]
public bool IsEnabled { get; set; } = true;
/// <summary>
/// 备注
/// </summary>
[SugarColumn(ColumnDescription = "备注", Length = 500, IsNullable = true)]
public string Remark { get; set; }
}
}