public Mono<UserFriendRequestsWithVersion> queryFriendRequestsWithVersion(
            @NotNull Long userId,
            boolean areSentByUser,
            @Nullable Date lastUpdatedDate) {
        Mono<Date> versionMono = areSentByUser
                ? userVersionService.querySentFriendRequestsVersion(userId)
                : userVersionService.queryReceivedFriendRequestsVersion(userId);
        return versionMono.flatMap(version -> {
            if (DateTimeUtil.isAfterOrSame(lastUpdatedDate, version)) {
                return ResponseExceptionPublisherPool.alreadyUpToUpdate();
            }
            Flux<UserFriendRequest> requestFlux = areSentByUser
                    ? queryFriendRequestsByRequesterId(userId)
                    : queryFriendRequestsByRecipientId(userId);
            return requestFlux.collect(CollectorUtil.toChunkedList())
                    .map(requests -> {
                        if (requests.isEmpty()) {
                            throw ResponseException.get(ResponseStatusCode.NO_CONTENT);
                        }
                        UserFriendRequestsWithVersion.Builder builder =
                                ClientMessagePool.getUserFriendRequestsWithVersionBuilder();
                        int expireAfterSeconds =
                                userFriendRequestRepository.getEntityExpireAfterSeconds();
                        for (UserFriendRequest request : requests) {
                            builder.addUserFriendRequests(ProtoModelConvertor
                                    .friendRequest2proto(request, expireAfterSeconds));
                        }
                        return builder.setLastUpdatedDate(version.getTime())
                                .build();
                    });
        })
                .switchIfEmpty(ResponseExceptionPublisherPool.alreadyUpToUpdate());
    }
@return The requester ID, recipient ID, creation date and status.
turms-service/src/main/java/im/turms/service/domain/user/service/UserFriendRequestService.java