ApprovalFlowItem.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. // Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
  2. //
  3. // 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
  4. //
  5. // 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
  6. using System.Text.Json.Serialization;
  7. namespace Admin.NET.Plugin.ApprovalFlow.Service;
  8. public class ApprovalFlowItem
  9. {
  10. [JsonPropertyName("nodes")]
  11. public List<ApprovalFlowNodeItem> Nodes { get; set; }
  12. [JsonPropertyName("edges")]
  13. public List<ApprovalFlowEdgeItem> Edges { get; set; }
  14. }
  15. public class ApprovalFlowNodeItem
  16. {
  17. [JsonPropertyName("id")]
  18. public string Id { get; set; }
  19. [JsonPropertyName("type")]
  20. public string Type { get; set; }
  21. [JsonPropertyName("x")]
  22. public float X { get; set; }
  23. [JsonPropertyName("y")]
  24. public float Y { get; set; }
  25. [JsonPropertyName("properties")]
  26. public FlowProperties Properties { get; set; }
  27. [JsonPropertyName("text")]
  28. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
  29. public FlowTextItem Text { get; set; }
  30. }
  31. public class ApprovalFlowEdgeItem
  32. {
  33. [JsonPropertyName("id")]
  34. public string Id { get; set; }
  35. [JsonPropertyName("type")]
  36. public string Type { get; set; }
  37. [JsonPropertyName("sourceNodeId")]
  38. public string SourceNodeId { get; set; }
  39. [JsonPropertyName("targetNodeId")]
  40. public string TargetNodeId { get; set; }
  41. [JsonPropertyName("startPoint")]
  42. public FlowEdgePointItem StartPoint { get; set; }
  43. [JsonPropertyName("endPoint")]
  44. public FlowEdgePointItem EndPoint { get; set; }
  45. [JsonPropertyName("properties")]
  46. public FlowProperties Properties { get; set; }
  47. [JsonPropertyName("text")]
  48. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
  49. public FlowTextItem Text { get; set; }
  50. [JsonPropertyName("pointsList")]
  51. public List<FlowEdgePointItem> PointsList { get; set; }
  52. }
  53. public class FlowProperties
  54. {
  55. }
  56. public class FlowTextItem
  57. {
  58. [JsonPropertyName("x")]
  59. public float X { get; set; }
  60. [JsonPropertyName("y")]
  61. public float Y { get; set; }
  62. [JsonPropertyName("value")]
  63. public string Value { get; set; }
  64. }
  65. public class FlowEdgePointItem
  66. {
  67. [JsonPropertyName("x")]
  68. public float X { get; set; }
  69. [JsonPropertyName("y")]
  70. public float Y { get; set; }
  71. }