李昊 4 年之前
父节点
当前提交
6f14e3ebbb

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

@@ -143,6 +143,7 @@ namespace GxPress.Result.User
         /// </summary>
         /// <value></value>
         public int TypeValue { get; set; }
+        public int TypeId { get; set; }
         /// <summary>
         /// 群聊小组ID
         /// </summary>

+ 6 - 6
gx_api/GxPress/Service/GxPress.Service.Implement/UserService.cs

@@ -618,21 +618,21 @@ namespace GxPress.Service.Implement
             if (request.Id == 0)
                 return await GetAllGroupOrGroupChatUserInfosResult(request);
             //群聊
-            if (request.TypeValue == 1)
+            if (request.TypeValue == UserlinkConst.MyGroupChat.GetHashCode())
             {
                 var groupChatUsers = await groupChatUserRepository.GetAllAsync(Q.Where(nameof(Entity.GroupChatUser.GroupChatId), request.Id));
                 var result = await _userRepository.GetSearchUserInfoResults(request.Keyword, groupChatUsers.Select(n => n.UserId));
                 return result;
             }
             //小组
-            if (request.TypeValue == 2)
+            if (request.TypeValue == UserlinkConst.MyGroup.GetHashCode())
             {
                 var groupUsers = await groupUserRepository.GetAllAsync(Q.Where(nameof(Entity.GroupUser.GroupId), request.Id));
                 var result = await _userRepository.GetSearchUserInfoResults(request.Keyword, groupUsers.Select(n => n.UserId));
                 return result;
             }
             //自建小组
-            if (request.TypeValue == 3)
+            if (request.TypeId == UserlinkConst.My.GetHashCode())
             {
                 var addressGroupUsers = await addressBookGroupUserRepository.GetAllAsync(Q.Where(nameof(Entity.AddressBookGroupUser.AddressBookGroupId), request.Id));
                 var result = await _userRepository.GetSearchUserInfoResults(request.Keyword, addressGroupUsers.Select(n => n.UserId));
@@ -650,7 +650,7 @@ namespace GxPress.Service.Implement
         public async Task<IEnumerable<UserInfoResult>> GetAllGroupOrGroupChatUserInfosResult(UserInfoByGroupoRoGroupChatResult request)
         {
             //群聊
-            if (request.TypeValue == 1)
+            if (request.TypeValue == UserlinkConst.MyGroupChat.GetHashCode())
             {
                 var groupIds = await groupChatUserRepository.GetAllAsync(Q.Where(nameof(Entity.GroupChatUser.UserId), request.UserId));
                 var groupChatUsers = await groupChatUserRepository.GetAllAsync(Q.WhereIn(nameof(Entity.GroupChatUser.GroupChatId), groupIds.Select(n => n.GroupChatId)));
@@ -658,7 +658,7 @@ namespace GxPress.Service.Implement
                 return result;
             }
             //小组
-            if (request.TypeValue == 2)
+            if (request.TypeValue == UserlinkConst.MyGroup.GetHashCode())
             {
                 var groupIds = await groupUserRepository.GetAllAsync(Q.Where(nameof(Entity.GroupUser.UserId), request.UserId));
                 var groupUsers = await groupUserRepository.GetAllAsync(Q.WhereIn(nameof(Entity.GroupUser.GroupId), groupIds.Select(n => n.GroupId)));
@@ -666,7 +666,7 @@ namespace GxPress.Service.Implement
                 return result;
             }
             //自建小组
-            if (request.TypeValue == 3)
+            if (request.TypeValue == UserlinkConst.My.GetHashCode())
             {
                 var addressBookGroupIds = await addressBookGroupUserRepository.GetAllAsync(Q.Where(nameof(Entity.AddressBookGroupUser.UserId), request.UserId));
                 var addressGroupUsers = await addressBookGroupUserRepository.GetAllAsync(Q.WhereIn(nameof(Entity.AddressBookGroupUser.AddressBookGroupId), addressBookGroupIds.Select(n => n.AddressBookGroupId)));