namespace OrpaonVision.Core.Audit.Contracts; /// /// 审计统计结果。 /// public sealed class AuditStatisticsDto { /// /// 统计时间范围开始(UTC)。 /// public DateTime StartTimeUtc { get; init; } /// /// 统计时间范围结束(UTC)。 /// public DateTime EndTimeUtc { get; init; } /// /// 总操作次数。 /// public long TotalOperations { get; init; } /// /// 成功操作次数。 /// public long SuccessOperations { get; init; } /// /// 失败操作次数。 /// public long FailedOperations { get; init; } /// /// 成功率。 /// public decimal SuccessRate { get; init; } /// /// 平均响应时间(毫秒)。 /// public decimal AverageResponseTimeMs { get; init; } /// /// 按操作类型分组的统计。 /// public IReadOnlyList OperationTypeStatistics { get; init; } = []; /// /// 按模块分组的统计。 /// public IReadOnlyList ModuleStatistics { get; init; } = []; /// /// 按用户分组的统计。 /// public IReadOnlyList UserStatistics { get; init; } = []; /// /// 按风险级别分组的统计。 /// public IReadOnlyList RiskLevelStatistics { get; init; } = []; /// /// 每小时操作统计。 /// public IReadOnlyList HourlyStatistics { get; init; } = []; } /// /// 操作类型统计。 /// public sealed class OperationTypeStatisticsDto { /// /// 操作类型。 /// public string ActionType { get; init; } = string.Empty; /// /// 操作次数。 /// public long Count { get; init; } /// /// 占比。 /// public decimal Percentage { get; init; } /// /// 平均响应时间(毫秒)。 /// public decimal AverageResponseTimeMs { get; init; } } /// /// 模块统计。 /// public sealed class ModuleStatisticsDto { /// /// 模块名称。 /// public string Module { get; init; } = string.Empty; /// /// 操作次数。 /// public long Count { get; init; } /// /// 占比。 /// public decimal Percentage { get; init; } /// /// 平均响应时间(毫秒)。 /// public decimal AverageResponseTimeMs { get; init; } } /// /// 用户统计。 /// public sealed class UserStatisticsDto { /// /// 用户ID。 /// public Guid UserId { get; init; } /// /// 用户名。 /// public string UserName { get; init; } = string.Empty; /// /// 操作次数。 /// public long Count { get; init; } /// /// 最后操作时间(UTC)。 /// public DateTime LastOperatedAtUtc { get; init; } } /// /// 风险级别统计。 /// public sealed class RiskLevelStatisticsDto { /// /// 风险级别。 /// public string RiskLevel { get; init; } = string.Empty; /// /// 操作次数。 /// public long Count { get; init; } /// /// 占比。 /// public decimal Percentage { get; init; } } /// /// 每小时统计。 /// public sealed class HourlyStatisticsDto { /// /// 小时(0-23)。 /// public int Hour { get; init; } /// /// 操作次数。 /// public long Count { get; init; } /// /// 成功操作次数。 /// public long SuccessCount { get; init; } /// /// 失败操作次数。 /// public long FailedCount { get; init; } }