李昊 4 years ago
parent
commit
bee49118bf

+ 1 - 1
gx_api/GxPress/Model/GxPress.Result/User/UserResult.cs

@@ -118,7 +118,7 @@ namespace GxPress.Result.User
     public class UserInfoByGroupoRoGroupChatResult
     {
         /// <summary>
-        /// 1 群聊 2小组
+        /// 1 群聊 2小组 3自建小组
         /// </summary>
         /// <value></value>
         public int TypeValue { get; set; }

+ 10 - 1
gx_api/GxPress/Service/GxPress.Service.Implement/UserService.cs

@@ -33,6 +33,7 @@ namespace GxPress.Service.Implement
         private readonly IUserRepository _userRepository;
         private readonly IDepartmentRepository _departmentRepository;
         private readonly IAddressBookGroupRepository _addressBookGroupRepository;
+        private readonly IAddressBookGroupUserRepository addressBookGroupUserRepository;
         private IWebHostEnvironment _webHostEnvironment;
         private readonly IBlacklistUserRepository _blacklistUserRepository;
         private readonly IRoleRepository _roleRepository;
@@ -47,7 +48,7 @@ namespace GxPress.Service.Implement
         private readonly IGroupUserRepository groupUserRepository;
         public UserService(IUserRepository userRepository, IDepartmentRepository departmentRepository,
             IAddressBookGroupRepository addressBookGroupRepository, IBlacklistUserRepository blacklistUserRepository,
-            IMapper mapper, IWebHostEnvironment webHostEnvironment, IRoleRepository roleRepository, IIMService imService, IFlowRepository flowRepository, IFlowTodoRepository flowTodoRepository, IWaitHandleRepository waitHandleRepository, IDepartmentUserRepository departmentUserRepository, IFriendsRepository friendsRepository, IGroupChatUserRepository groupChatUserRepository, IGroupUserRepository groupUserRepository)
+            IMapper mapper, IWebHostEnvironment webHostEnvironment, IRoleRepository roleRepository, IIMService imService, IFlowRepository flowRepository, IFlowTodoRepository flowTodoRepository, IWaitHandleRepository waitHandleRepository, IDepartmentUserRepository departmentUserRepository, IFriendsRepository friendsRepository, IGroupChatUserRepository groupChatUserRepository, IGroupUserRepository groupUserRepository, IAddressBookGroupUserRepository addressBookGroupUserRepository)
         {
 
             _userRepository = userRepository;
@@ -65,6 +66,7 @@ namespace GxPress.Service.Implement
             this.friendsRepository = friendsRepository;
             this.groupChatUserRepository = groupChatUserRepository;
             this.groupUserRepository = groupUserRepository;
+            this.addressBookGroupUserRepository = addressBookGroupUserRepository;
         }
 
         /// <summary>
@@ -562,6 +564,13 @@ namespace GxPress.Service.Implement
                 var result = await _userRepository.GetSearchUserInfoResults(keyword, groupUsers.Select(n => n.UserId));
                 return result;
             }
+            //自建小组
+            if (typeValue == 3)
+            {
+                var addressGroupUsers = await addressBookGroupUserRepository.GetAllAsync(Q.Where(nameof(Entity.AddressBookGroupUser.AddressBookGroupId), id));
+                var result = await _userRepository.GetSearchUserInfoResults(keyword, addressGroupUsers.Select(n => n.UserId));
+                return result;
+            }
             return null;
         }