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

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,65 @@
using SqlSugar;
using System;
namespace Model.Entity.Inspection
{
/// <summary>
/// 告警通知推送日志(每次向渠道推送的结果记录,失败可追溯)
/// </summary>
public class AlertNotifyLogEntity : BaseEntity
{
/// <summary>
/// 告警消息Id(关联 AlertMessageEntity.Id0表示渠道测试推送)
/// </summary>
[SugarColumn(ColumnDescription = "告警消息Id")]
public long AlertId { get; set; }
/// <summary>
/// 渠道类型(1飞书/2钉钉/3企微)
/// </summary>
[SugarColumn(ColumnDescription = "渠道类型")]
public NotifyChannelTypeEnum ChannelType { get; set; }
/// <summary>
/// 渠道Id(关联 AlertNotifyChannelEntity.Id
/// </summary>
[SugarColumn(ColumnDescription = "渠道Id")]
public long ChannelId { get; set; }
/// <summary>
/// 推送目标(Webhook 地址脱敏展示)
/// </summary>
[SugarColumn(ColumnDescription = "推送目标", Length = 200, IsNullable = true)]
public string Target { get; set; }
/// <summary>
/// 推送内容摘要
/// </summary>
[SugarColumn(ColumnDescription = "推送内容", Length = 1000, IsNullable = true)]
public string Content { get; set; }
/// <summary>
/// 是否成功
/// </summary>
[SugarColumn(ColumnDescription = "是否成功")]
public bool Success { get; set; }
/// <summary>
/// 错误信息
/// </summary>
[SugarColumn(ColumnDescription = "错误信息", Length = 500, IsNullable = true)]
public string ErrorMsg { get; set; }
/// <summary>
/// 重试次数
/// </summary>
[SugarColumn(ColumnDescription = "重试次数")]
public int RetryCount { get; set; }
/// <summary>
/// 推送时间
/// </summary>
[SugarColumn(ColumnDescription = "推送时间")]
public DateTime NotifyTime { get; set; }
}
}