using SqlSugar;
using System;
namespace Model.Entity.Inspection
{
///
/// 跨网推送发件箱(内网只写此表;跳板机上的 AlertBridge 控制台程序轮询拉取,
/// 在外网推送飞书/钉钉/企微后回写结果,实现工控内网与即时通讯软件的隔离穿透)
///
public class AlertOutboxEntity : BaseEntity
{
///
/// 告警消息Id(关联 AlertMessageEntity.Id)
///
[SugarColumn(ColumnDescription = "告警消息Id")]
public long AlertId { get; set; }
///
/// 渠道Id(关联 AlertNotifyChannelEntity.Id)
///
[SugarColumn(ColumnDescription = "渠道Id")]
public long ChannelId { get; set; }
///
/// 完整推送报文(自包含 JSON:渠道类型/WebhookUrl/Secret/标题/内容/@列表,
/// AlertBridge 拉取后无需再查任何配置即可直接推送)
///
[SugarColumn(ColumnDescription = "推送报文", ColumnDataType = "text", IsNullable = true)]
public string Payload { get; set; }
///
/// 状态(1待推送/2已拉取/3成功/4失败)
///
[SugarColumn(ColumnDescription = "状态")]
public OutboxStatusEnum Status { get; set; } = OutboxStatusEnum.Pending;
///
/// 重试次数(AlertBridge 推送失败回写时累加)
///
[SugarColumn(ColumnDescription = "重试次数")]
public int RetryCount { get; set; }
///
/// 拉取时间
///
[SugarColumn(ColumnDescription = "拉取时间", IsNullable = true)]
public DateTime? PullTime { get; set; }
///
/// 完成时间(成功/失败回写时间)
///
[SugarColumn(ColumnDescription = "完成时间", IsNullable = true)]
public DateTime? FinishTime { get; set; }
///
/// 结果信息(失败原因等)
///
[SugarColumn(ColumnDescription = "结果信息", Length = 500, IsNullable = true)]
public string ResultMsg { get; set; }
}
}