MdpEntityDtos.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. namespace Admin.NET.Plugin.AiDOP.Dto.DataPlatform;
  2. public sealed class MdpEntityRow
  3. {
  4. public long Id { get; set; }
  5. public long TenantId { get; set; }
  6. public long SourceId { get; set; }
  7. public string? SourceCode { get; set; }
  8. public string? SourceName { get; set; }
  9. public string? SourceType { get; set; }
  10. public string EntityCode { get; set; } = string.Empty;
  11. public string EntityName { get; set; } = string.Empty;
  12. public string EntityType { get; set; } = "TABLE";
  13. public string? SourceTableName { get; set; }
  14. public string? TransformSourceTable { get; set; }
  15. public string? SourceApiPath { get; set; }
  16. public string? TargetTableName { get; set; }
  17. public string SyncMode { get; set; } = "INCR";
  18. public string? IncrColumn { get; set; }
  19. public string? TieBreakerColumn { get; set; }
  20. public string? BizKeyExpr { get; set; }
  21. public int BatchSize { get; set; } = 5000;
  22. public string? JobId { get; set; }
  23. public int Status { get; set; } = 1;
  24. public string? LastCursor { get; set; }
  25. public DateTime? LastSyncTo { get; set; }
  26. public string? Remark { get; set; }
  27. public int FieldMappingCount { get; set; }
  28. public string ConfigState { get; set; } = "COMPLETE";
  29. public List<string> ConfigErrors { get; set; } = new();
  30. }
  31. public sealed class MdpEntityUpsertInput
  32. {
  33. /// <summary>仅新增时使用;复制该 tenant=0 内置模板的字段映射。</summary>
  34. public long? TemplateEntityId { get; set; }
  35. public string EntityCode { get; set; } = string.Empty;
  36. public string EntityName { get; set; } = string.Empty;
  37. public string EntityType { get; set; } = "TABLE";
  38. public long SourceId { get; set; }
  39. public string? SourceCode { get; set; }
  40. public string? SourceTableName { get; set; }
  41. public string? TransformSourceTable { get; set; }
  42. public string? SourceApiPath { get; set; }
  43. public string? TargetTableName { get; set; }
  44. public string SyncMode { get; set; } = "INCR";
  45. public string? IncrColumn { get; set; }
  46. public string? TieBreakerColumn { get; set; }
  47. public int? BatchSize { get; set; }
  48. public string? JobId { get; set; }
  49. public int Status { get; set; } = 1;
  50. public string? Remark { get; set; }
  51. /// <summary>未传时保留原值。仅 source_type=API_INBOUND 允许为 1。</summary>
  52. public int? InboundEnabled { get; set; }
  53. public string? BizKeyExpr { get; set; }
  54. }
  55. public sealed class MdpFieldMappingRow
  56. {
  57. public long Id { get; set; }
  58. public long EntityId { get; set; }
  59. public string SourceField { get; set; } = string.Empty;
  60. public string TargetField { get; set; } = string.Empty;
  61. public string FieldType { get; set; } = "DIRECT";
  62. public string? TransformScript { get; set; }
  63. public string? ConstValue { get; set; }
  64. public string? LookupTable { get; set; }
  65. public bool IsRequired { get; set; }
  66. public string? DefaultValue { get; set; }
  67. public int SortOrder { get; set; }
  68. }
  69. public sealed class MdpFieldMappingUpsertInput
  70. {
  71. public string SourceField { get; set; } = string.Empty;
  72. public string TargetField { get; set; } = string.Empty;
  73. public string FieldType { get; set; } = "DIRECT";
  74. public string? TransformScript { get; set; }
  75. public string? ConstValue { get; set; }
  76. public string? LookupTable { get; set; }
  77. public bool IsRequired { get; set; }
  78. public string? DefaultValue { get; set; }
  79. public int SortOrder { get; set; }
  80. }