namespace OrpaonVision.Model.Production; /// /// 检测记录模型。 /// public sealed class DetectionRecordModel { /// /// 记录ID。 /// public Guid Id { get; set; } /// /// 产品会话ID。 /// public Guid SessionId { get; set; } /// /// 层级会话ID。 /// public Guid LayerSessionId { get; set; } /// /// 检测时间(UTC)。 /// public DateTime DetectedAtUtc { get; set; } /// /// 模型名称。 /// public string ModelName { get; set; } = string.Empty; /// /// 模型版本。 /// public string ModelVersion { get; set; } = string.Empty; /// /// 推理耗时(毫秒)。 /// public double InferenceTimeMs { get; set; } /// /// 检测结果JSON。 /// public string DetectionResultJson { get; set; } = string.Empty; /// /// 检测到的目标数量。 /// public int DetectedObjectCount { get; set; } /// /// 图像路径。 /// public string? ImagePath { get; set; } /// /// 图像宽度。 /// public int ImageWidth { get; set; } /// /// 图像高度。 /// public int ImageHeight { get; set; } /// /// 是否为NG检测。 /// public bool IsNgDetection { get; set; } /// /// 规则引擎判定结果JSON。 /// public string? RuleEngineResultJson { get; set; } /// /// 创建时间(UTC)。 /// public DateTime CreatedAtUtc { get; set; } /// /// 创建人。 /// public string CreatedBy { get; set; } = string.Empty; } /// /// 异常记录模型。 /// public sealed class ExceptionRecordModel { /// /// 记录ID。 /// public Guid Id { get; set; } /// /// 产品会话ID。 /// public Guid SessionId { get; set; } /// /// 层级会话ID。 /// public Guid? LayerSessionId { get; set; } /// /// 异常类型。 /// public ExceptionType Type { get; set; } /// /// 异常代码。 /// public string ExceptionCode { get; set; } = string.Empty; /// /// 异常消息。 /// public string ExceptionMessage { get; set; } = string.Empty; /// /// 异常详情JSON。 /// public string? ExceptionDetailJson { get; set; } /// /// 发生时间(UTC)。 /// public DateTime OccurredAtUtc { get; set; } /// /// 严重程度。 /// public ExceptionSeverity Severity { get; set; } /// /// 是否已处理。 /// public bool IsHandled { get; set; } /// /// 处理时间(UTC)。 /// public DateTime? HandledAtUtc { get; set; } /// /// 处理人。 /// public string? HandledBy { get; set; } /// /// 处理方式。 /// public string? HandlingMethod { get; set; } /// /// 创建时间(UTC)。 /// public DateTime CreatedAtUtc { get; set; } /// /// 创建人。 /// public string CreatedBy { get; set; } = string.Empty; } /// /// 异常类型枚举。 /// public enum ExceptionType { /// /// 相机异常。 /// Camera = 0, /// /// 推理异常。 /// Inference = 1, /// /// 规则引擎异常。 /// RuleEngine = 2, /// /// 状态机异常。 /// StateMachine = 3, /// /// 系统异常。 /// System = 4, /// /// 业务异常。 /// Business = 5 } /// /// 异常严重程度枚举。 /// public enum ExceptionSeverity { /// /// 低。 /// Low = 0, /// /// 中。 /// Medium = 1, /// /// 高。 /// High = 2, /// /// 严重。 /// Critical = 3 }