using System.Collections.Generic; namespace CncModels.Dto.Alert { /// /// 告警统计结果(未处理告警分类型统计) /// public class AlertStatisticsResponse { /// 未处理告警总数(前端用 unresolved) public int UnresolvedCount { get; set; } /// 按告警类型统计的未处理数量 public Dictionary UnresolvedByType { get; set; } = new Dictionary(); // 以下为前端 AlertStats 接口需要的扁平字段 /// 未处理总数(前端字段名 unresolved) public int Unresolved => UnresolvedCount; /// 采集失败未处理数 public int CollectFail => UnresolvedByType.TryGetValue("collect_fail", out var v) ? v : 0; /// 设备离线未处理数 public int DeviceOffline => UnresolvedByType.TryGetValue("device_offline", out var v) ? v : 0; /// 产量异常未处理数 public int ProductionAnomaly => UnresolvedByType.TryGetValue("production_anomaly", out var v) ? v : 0; /// 未知设备未处理数 public int UnknownDevice => UnresolvedByType.TryGetValue("unknown_device", out var v) ? v : 0; } }