xf 2 роки тому
батько
коміт
abf81fefea

+ 4 - 1
src/Hotline.Share/Dtos/FlowEngine/WorkflowDto.cs

@@ -1,4 +1,5 @@
-using Hotline.Share.Enums.FlowEngine;
+using Hotline.Share.Dtos.Users;
+using Hotline.Share.Enums.FlowEngine;
 using XF.Utility.EnumExtensions;
 
 namespace Hotline.Share.Dtos.FlowEngine
@@ -75,5 +76,7 @@ namespace Hotline.Share.Dtos.FlowEngine
         /// 附件
         /// </summary>
         public List<string> Additions { get; set; } = new();
+
+        public UserDto Creator { get; set; }
     }
 }

+ 1 - 1
src/Hotline/FlowEngine/Workflows/WorkflowDomainService.cs

@@ -112,7 +112,7 @@ namespace Hotline.FlowEngine.Workflows
             if (withDefine)
                 query = query.Includes(d => d.Definition);
             if (withSupplements)
-                query = query.Includes(d => d.Supplements);
+                query = query.Includes(d => d.Supplements, d => d.Creator);
             if (withAssigns)
                 query = query.Includes(d => d.Assigns);
 

+ 5 - 1
src/Hotline/FlowEngine/Workflows/WorkflowSupplement.cs

@@ -1,4 +1,5 @@
-using SqlSugar;
+using Hotline.Users;
+using SqlSugar;
 using XF.Domain.Repository;
 
 namespace Hotline.FlowEngine.Workflows;
@@ -21,4 +22,7 @@ public class WorkflowSupplement : CreationEntity
     /// </summary>
     [SugarColumn(ColumnDataType = "varchar(2000)", IsJson = true)]
     public List<string> Additions { get; set; } = new();
+
+    [Navigate(NavigateType.OneToOne, nameof(CreatorId))]
+    public User Creator { get; set; }
 }