AdoS8WatchRule.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. namespace Admin.NET.Plugin.AiDOP.Entity.S8;
  2. [SugarTable("ado_s8_watch_rule", "S8 监视规则")]
  3. public class AdoS8WatchRule
  4. {
  5. [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true, ColumnDataType = "bigint")]
  6. public long Id { get; set; }
  7. [SugarColumn(ColumnName = "tenant_id", ColumnDataType = "bigint")]
  8. public long TenantId { get; set; }
  9. [SugarColumn(ColumnName = "factory_id", ColumnDataType = "bigint")]
  10. public long FactoryId { get; set; }
  11. [SugarColumn(ColumnName = "rule_code", Length = 64)]
  12. public string RuleCode { get; set; } = string.Empty;
  13. [SugarColumn(ColumnName = "scene_code", Length = 64)]
  14. public string SceneCode { get; set; } = string.Empty;
  15. [SugarColumn(ColumnName = "data_source_id", ColumnDataType = "bigint")]
  16. public long DataSourceId { get; set; }
  17. [SugarColumn(ColumnName = "watch_object_type", Length = 64)]
  18. public string WatchObjectType { get; set; } = string.Empty;
  19. [SugarColumn(ColumnName = "expression", Length = 2000, IsNullable = true)]
  20. public string? Expression { get; set; }
  21. [SugarColumn(ColumnName = "severity", Length = 32)]
  22. public string Severity { get; set; } = "MEDIUM";
  23. [SugarColumn(ColumnName = "poll_interval_seconds")]
  24. public int PollIntervalSeconds { get; set; } = 300;
  25. [SugarColumn(ColumnName = "enabled", ColumnDataType = "boolean")]
  26. public bool Enabled { get; set; }
  27. [SugarColumn(ColumnName = "created_at")]
  28. public DateTime CreatedAt { get; set; } = DateTime.Now;
  29. [SugarColumn(ColumnName = "updated_at", IsNullable = true)]
  30. public DateTime? UpdatedAt { get; set; }
  31. /// <summary>规则类型:TIMEOUT / SHORTAGE / OUT_OF_RANGE。R1 仅落列,evaluator 不分派。</summary>
  32. [SugarColumn(ColumnName = "rule_type", Length = 32, IsNullable = true)]
  33. public string? RuleType { get; set; }
  34. /// <summary>源对象类型(DEVICE / ORDER / MATERIAL / QUALITY_CHECK 等)。R1 与 watch_object_type 可保持一致。</summary>
  35. [SugarColumn(ColumnName = "source_object_type", Length = 64, IsNullable = true)]
  36. public string? SourceObjectType { get; set; }
  37. /// <summary>规则类型相关结构化参数 JSON。R1 仅预留,service 不解析。</summary>
  38. [SugarColumn(ColumnName = "params_json", ColumnDataType = "mediumtext", IsNullable = true)]
  39. public string? ParamsJson { get; set; }
  40. }