| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- namespace Admin.NET.Plugin.AiDOP.Dto.SmartOps;
- /// <summary>新增/编辑草稿。</summary>
- public sealed class KpiCalcConfigUpsertDto
- {
- public string MetricCode { get; set; } = string.Empty;
- public string ModuleCode { get; set; } = string.Empty;
- public string CalcEngineType { get; set; } = "CONFIG_SQL";
- public string? DataSourceCode { get; set; }
- public string? SqlScript { get; set; }
- public string? SqlParametersJson { get; set; }
- public int TimeoutSeconds { get; set; } = 30;
- public string? Remark { get; set; }
- }
- /// <summary>配置版本输出。</summary>
- public sealed class KpiCalcConfigDto
- {
- public long Id { get; set; }
- public long? TenantId { get; set; }
- public string MetricCode { get; set; } = string.Empty;
- public string ModuleCode { get; set; } = string.Empty;
- public int VersionNo { get; set; }
- public string CalcEngineType { get; set; } = string.Empty;
- public string? DataSourceCode { get; set; }
- public string? SqlScript { get; set; }
- public string? SqlParametersJson { get; set; }
- public int TimeoutSeconds { get; set; }
- public string PublishStatus { get; set; } = string.Empty;
- public bool IsCurrent { get; set; }
- public string? Remark { get; set; }
- public string? CreatedBy { get; set; }
- public DateTime CreatedAt { get; set; }
- public string? PublishedBy { get; set; }
- public DateTime? PublishedAt { get; set; }
- }
- /// <summary>SQL 校验入参。</summary>
- public sealed class KpiSqlValidateDto
- {
- public string? SqlScript { get; set; }
- }
- /// <summary>SQL 校验结果。</summary>
- public sealed class KpiSqlValidateResultDto
- {
- public bool Ok { get; set; }
- public string ValidationStatus { get; set; } = string.Empty; // VALID / INVALID
- public string? ErrorCode { get; set; }
- public string? ErrorMessage { get; set; }
- public List<string> ReferencedTables { get; set; } = new();
- }
- /// <summary>试算入参(服务端重读/重校验,不信任前端 tenant/权限)。</summary>
- public sealed class KpiSqlPreviewDto
- {
- public string MetricCode { get; set; } = string.Empty;
- public string ModuleCode { get; set; } = string.Empty;
- public string? DataSourceCode { get; set; }
- public string? SqlScript { get; set; }
- public int TimeoutSeconds { get; set; } = 20;
- public DateTime? BizDate { get; set; }
- }
- /// <summary>试算结果(不写正式 KPI 值)。</summary>
- public sealed class KpiSqlPreviewResultDto
- {
- public bool Ok { get; set; }
- public string ValidationStatus { get; set; } = string.Empty;
- public string MetricCode { get; set; } = string.Empty;
- public string EngineType { get; set; } = "CONFIG_SQL";
- public string? DataSourceCode { get; set; }
- public string BizDate { get; set; } = string.Empty;
- public long DurationMs { get; set; }
- public int RowCount { get; set; }
- public decimal? MetricValue { get; set; }
- public decimal? NumeratorValue { get; set; }
- public decimal? DenominatorValue { get; set; }
- public string ResultStatus { get; set; } = string.Empty; // SUCCESS / NO_DATA / FAILED
- public string? ResultMessage { get; set; }
- public string? ExecutedParameters { get; set; }
- public string? ErrorCode { get; set; }
- public string? ErrorMessage { get; set; }
- }
|