lihao 4 years ago
parent
commit
f977b3f4c9
1 changed files with 8 additions and 11 deletions
  1. 8 11
      gx_api/GxPress/Service/GxPress.Service.Implement/Note/NoteService.cs

+ 8 - 11
gx_api/GxPress/Service/GxPress.Service.Implement/Note/NoteService.cs

@@ -344,17 +344,14 @@ namespace GxPress.Service.Implement.Note
                 }
                 if (item.Data == null || item.Data.Count == 0)
                     item.Data = new List<ContentJsonData>();
-                // //获取共享人员
-                // if (item.RoleId == 3)
-                // {
-                //     var sourceId = item.Id;
-                //     if (item.ParentId > 0)
-                //         sourceId = item.MiddleSonId;
-                //     var userMiddles = await _userMiddleService.FindUserMiddlesAsync(item.FolderType, sourceId);
-                //     item.EnjoyUser = StringUtils.ObjectCollectionToString(userMiddles.Select(n => n.SourceName), "、");
-                //     // var folderUsers = await _folderUserRepository.GetAllAsync(Q.Where(nameof(FolderUser.MiddleId), item.Id).OrderByDesc(nameof(FolderUser.CreatedDate)).Take(10));
-                //     // item.EnjoyUser = StringUtils.ObjectCollectionToString(folderUsers.Select(n => n.UserName), "、");
-                // }
+                foreach (var data in item.Data)
+                {
+                    if (data.Type == AllTypeConst.CollectFolder.GetHashCode())
+                    {
+                        var userName = await _userRepository.GetNameAsync(data.SourceUserId);
+                        data.Author = userName;
+                    }
+                }
             }
 
             return result;