apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/ldap/LdapUserService.java/LdapUserService/searchUserInfoByGroup
class LdapUserService:  private List<UserInfo> searchUserInfoByGroup(String groupBase, String groupSearch,
      String keyword, List<String> userIds) {

    return ldapTemplate
        .searchForObject(groupBase, groupSearch, ctx -> {
            List<UserInfo> userInfos = new ArrayList<>();

          if (!MEMBER_UID_ATTR_NAME.equals(groupMembershipAttrName)) {
            String[] members = ((DirContextAdapter) ctx).getStringAttributes(groupMembershipAttrName);
            for (String item : members) {
              LdapName ldapName = LdapUtils.newLdapName(item);
              LdapName memberRdn = LdapUtils.removeFirst(ldapName, LdapUtils.newLdapName(base));
              if (keyword != null) {
                String rdnValue = LdapUtils.getValue(memberRdn, rdnKey).toString();
                if (rdnValue.toLowerCase().contains(keyword.toLowerCase())) {
                  UserInfo userInfo = lookupUser(memberRdn.toString(), userIds);
                  userInfos.add(userInfo);
                }
              } else {
                UserInfo userInfo = lookupUser(memberRdn.toString(), userIds);
                if (userInfo != null) {
                  userInfos.add(userInfo);
                }
              }

            }
            return userInfos;
          }

          Set<String> memberUids = Sets.newHashSet(((DirContextAdapter) ctx)
              .getStringAttributes(groupMembershipAttrName));
          if (!CollectionUtils.isEmpty(userIds)) {
            memberUids = Sets.intersection(memberUids, Sets.newHashSet(userIds));
          }
          for (String memberUid : memberUids) {
            UserInfo userInfo = searchUserById(memberUid);
            if (userInfo != null) {
              if (keyword != null) {
                if (userInfo.getUserId().toLowerCase().contains(keyword.toLowerCase())) {
                  userInfos.add(userInfo);
                }
              } else {
                userInfos.add(userInfo);
              }
            }
          }
          return userInfos;
        });
  }