lihao 4 年之前
父节点
当前提交
7fb3166bfa

+ 1 - 1
gx_api/GxPress/Api/GxPress.Api/AppControllers/GroupController.cs

@@ -116,7 +116,7 @@ namespace GxPress.Api.AppControllers
         /// <param name="request"></param>
         /// <returns></returns>
         [HttpPost("find")]
-        public async Task<IEnumerable<GroupUserFindResult>> FindGroupByGroupFolderId(GroupSearchRequest request)
+        public async Task<PagedList<GroupUserFindResult>> FindGroupByGroupFolderId(GroupSearchRequest request)
         {
             request.UserId = _loginContext.AccountId;
             return await _groupService.FindGroupByGroupFolderIdAsync(request);

+ 1 - 1
gx_api/GxPress/Api/GxPress.Api/WebControllers/WebGroupController.cs

@@ -136,7 +136,7 @@ namespace GxPress.Api.WebControllers
         /// <param name="request"></param>
         /// <returns></returns>
         [HttpPost("find")]
-        public async Task<IEnumerable<GroupUserFindResult>> FindGroupByGroupFolderId(GroupSearchRequest request)
+        public async Task<PagedList<GroupUserFindResult>> FindGroupByGroupFolderId(GroupSearchRequest request)
         {
             request.UserId = _loginContext.AccountId;
             return await _groupService.FindGroupByGroupFolderIdAsync(request);

+ 8 - 5
gx_api/GxPress/Repository/GxPress.Repository.Implement/GroupRepository.cs

@@ -149,13 +149,16 @@ namespace GxPress.Repository.Implement
         /// </summary>
         /// <param name="request"></param>
         /// <returns></returns>
-        public async Task<IEnumerable<GroupUserFindResult>> FindGroupByGroupFolderId(GroupSearchRequest request)
+        public async Task<PagedList<GroupUserFindResult>> FindGroupByGroupFolderId(GroupSearchRequest request)
         {
-            var result = new List<GroupUserFindResult>();
-            result.AddRange(await GetGroupUserFindResult(true, request));
-            result.AddRange(await GetGroupUserFindResult(false, request));
-            foreach (var item in result)
+            var result = new PagedList<GroupUserFindResult>();
+            var data = new List<GroupUserFindResult>();
+            data.AddRange(await GetGroupUserFindResult(true, request));
+            data.AddRange(await GetGroupUserFindResult(false, request));
+            foreach (var item in data)
                 item.AvatarUrl = StringUtils.AddDomainMin(item.AvatarUrl);
+            result.Items = data;
+            result.Total = result.Items.Count();
             return result;
         }
         public async Task<IEnumerable<GroupUserFindResult>> GetGroupUserFindResult(bool IsTop, GroupSearchRequest request)

+ 2 - 1
gx_api/GxPress/Repository/GxPress.Repository.Interface/IGroupRepository.cs

@@ -7,6 +7,7 @@ using Datory;
 using GxPress.Entity;
 using GxPress.Request.App.Topic;
 using GxPress.Result.Job;
+using GxPress.Common.Page;
 
 namespace GxPress.Repository.Interface
 {
@@ -16,7 +17,7 @@ namespace GxPress.Repository.Interface
         Task<bool> UpdateAsync(GroupUpRequest request);
         Task<bool> DeleteAsync(int id);
         Task<bool> DeleteAsync(SqlKata.Query query);
-        Task<IEnumerable<GroupUserFindResult>> FindGroupByGroupFolderId(GroupSearchRequest request);
+        Task<PagedList<GroupUserFindResult>> FindGroupByGroupFolderId(GroupSearchRequest request);
 
         Task<GroupDetailResult> GroupDetailAsync(GroupDetailRequest request);
 

+ 2 - 2
gx_api/GxPress/Service/GxPress.Service.Implement/Group/GroupService.cs

@@ -109,10 +109,10 @@ namespace GxPress.Service.Implement.Group
         /// </summary>
         /// <param name="request"></param>
         /// <returns></returns>
-        public async Task<IEnumerable<GroupUserFindResult>> FindGroupByGroupFolderIdAsync(GroupSearchRequest request)
+        public async Task<PagedList<GroupUserFindResult>> FindGroupByGroupFolderIdAsync(GroupSearchRequest request)
         {
             var result = await _groupRepository.FindGroupByGroupFolderId(request);
-            foreach (var item in result)
+            foreach (var item in result.Items)
             {
                 item.TypeId = UserlinkConst.System.GetHashCode();
                 if (item.AttributeValue == 2)

+ 1 - 1
gx_api/GxPress/Service/GxPress.Service.Interface/Group/IGroupService.cs

@@ -14,7 +14,7 @@ namespace GxPress.Service.Interface.Group
     public interface IGroupService : IService
     {
         Task<GroupDetailResult> InsertGroup(GroupInRequest request);
-        Task<IEnumerable<GroupUserFindResult>> FindGroupByGroupFolderIdAsync(GroupSearchRequest request);
+        Task<PagedList<GroupUserFindResult>> FindGroupByGroupFolderIdAsync(GroupSearchRequest request);
 
         Task<AppResult<Object>> InsertsAsync(GroupUserInRequest request);