public Flux<GeoWithin<Object>> queryNearbyUsers(
            @NotNull Long userId,
            @NotNull @ValidDeviceType DeviceType deviceType,
            @Nullable Short maxCount,
            @Nullable Integer maxDistance,
            boolean withCoordinates,
            boolean withDistance) {
        try {
            Validator.notNull(userId, "userId");
            Validator.notNull(deviceType, "deviceType");
            Validator.inRange(maxCount, "maxCount", 1, maxNearbyUserCount);
            Validator.inRange(maxDistance, "maxDistance", 1, maxDistanceMeters);
            DeviceTypeUtil.validDeviceType(deviceType);
        } catch (ResponseException e) {
            return Flux.error(e);
        }
        if (!locationEnabled) {
            return Flux.error(ResponseException
                    .get(ResponseStatusCode.USER_LOCATION_RELATED_FEATURES_ARE_DISABLED));
        }
        if (maxCount == null) {
            maxCount = (short) Math.min(defaultMaxNearbyUserCount, maxNearbyUserCount);
        }
        if (maxDistance == null) {
            maxDistance = Math.min(defaultMaxDistanceMeters, maxDistanceMeters);
        }
        Object currentUserSessionId = treatUserIdAndDeviceTypeAsUniqueUser
                ? new UserSessionId(userId, deviceType)
                : userId;
        GeoArgs geoArgs = new GeoArgs().withCount(maxCount);
        if (withCoordinates) {
            geoArgs.withCoordinates();
        }
        if (withDistance) {
            geoArgs.withDistance();
        }
        Flux<GeoWithin<Object>> georadiusbymember =
                locationRedisClientManager.georadiusbymember(userId,
                        RedisEntryIdConst.KEY_LOCATION_BUFFER,
                        currentUserSessionId,
                        maxDistance,
                        geoArgs);
        return georadiusbymember.filter(geo -> !geo.getMember()
                .equals(currentUserSessionId));
    }
@return GeoWithin<Long> or GeoWithin<UserSessionId>
turms-server-common/src/main/java/im/turms/server/common/domain/session/service/SessionLocationService.java