MdpSource.cs 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. namespace Admin.NET.Plugin.AiDOP.Entity.DataPlatform;
  2. /// <summary>
  3. /// MDP 外部数据源配置(DB 段 + API 段)。
  4. /// </summary>
  5. [SugarTable("mdp_source", "MDP外部数据源配置")]
  6. public class MdpSource
  7. {
  8. [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
  9. public long Id { get; set; }
  10. [SugarColumn(ColumnName = "tenant_id")]
  11. public long TenantId { get; set; }
  12. [SugarColumn(ColumnName = "source_code", Length = 100)]
  13. public string SourceCode { get; set; } = string.Empty;
  14. /// <summary>同一系统多通道归一后的来源码。空则等于 <see cref="SourceCode"/>。</summary>
  15. [SugarColumn(ColumnName = "system_code", Length = 50, IsNullable = true)]
  16. public string? SystemCode { get; set; }
  17. [SugarColumn(ColumnName = "source_name", Length = 200)]
  18. public string SourceName { get; set; } = string.Empty;
  19. /// <summary>DB / API / API_INBOUND / FILE_EXCEL。FILE_EXCEL 不得走 Pull dispatcher。</summary>
  20. [SugarColumn(ColumnName = "source_type", Length = 40)]
  21. public string SourceType { get; set; } = "DB";
  22. /// <summary>SELF=复用本进程主库;EXTERNAL=按 db_* 建独立连接。不得靠 source_code 或空主机推断。</summary>
  23. [SugarColumn(ColumnName = "conn_mode", Length = 16)]
  24. public string ConnMode { get; set; } = "EXTERNAL";
  25. [SugarColumn(ColumnName = "status")]
  26. public int Status { get; set; } = 1;
  27. [SugarColumn(ColumnName = "db_type", Length = 40, IsNullable = true)]
  28. public string? DbType { get; set; }
  29. [SugarColumn(ColumnName = "db_host", Length = 200, IsNullable = true)]
  30. public string? DbHost { get; set; }
  31. [SugarColumn(ColumnName = "db_port", IsNullable = true)]
  32. public int? DbPort { get; set; }
  33. [SugarColumn(ColumnName = "db_name", Length = 200, IsNullable = true)]
  34. public string? DbName { get; set; }
  35. [SugarColumn(ColumnName = "db_user", Length = 200, IsNullable = true)]
  36. public string? DbUser { get; set; }
  37. [SugarColumn(ColumnName = "db_password_enc", Length = 500, IsNullable = true)]
  38. public string? DbPasswordEnc { get; set; }
  39. [SugarColumn(ColumnName = "db_extra_params", Length = 500, IsNullable = true)]
  40. public string? DbExtraParams { get; set; }
  41. [SugarColumn(ColumnName = "api_base_url", Length = 500, IsNullable = true)]
  42. public string? ApiBaseUrl { get; set; }
  43. [SugarColumn(ColumnName = "api_auth_type", Length = 40, IsNullable = true)]
  44. public string? ApiAuthType { get; set; }
  45. [SugarColumn(ColumnName = "api_auth_config", ColumnDataType = "json", IsNullable = true)]
  46. public string? ApiAuthConfig { get; set; }
  47. [SugarColumn(ColumnName = "last_health_check", IsNullable = true)]
  48. public DateTime? LastHealthCheck { get; set; }
  49. [SugarColumn(ColumnName = "health_status", IsNullable = true)]
  50. public int? HealthStatus { get; set; }
  51. [SugarColumn(ColumnName = "health_msg", Length = 500, IsNullable = true)]
  52. public string? HealthMsg { get; set; }
  53. [SugarColumn(ColumnName = "remark", Length = 500, IsNullable = true)]
  54. public string? Remark { get; set; }
  55. [SugarColumn(ColumnName = "create_time")]
  56. public DateTime CreateTime { get; set; }
  57. [SugarColumn(ColumnName = "update_time")]
  58. public DateTime UpdateTime { get; set; }
  59. }