error log

No primary or single unique constructor found 
for interface org.springframework.data.domain.Pageable

해결

아래와 같은 코드를 추가해서 해결했다.

@Configuration
class PagingConfig : WebFluxConfigurer {

    override fun configureArgumentResolvers(configurer: ArgumentResolverConfigurer) {
        configurer.addCustomResolver(ReactivePageableHandlerMethodArgumentResolver())
    }
}

paging 처리하는법

jpql

@Query("SELECT * FROM travel_destination LIMIT :limit OFFSET :offset")
suspend fun findAll(limit: Int, offset: Int): Flow<TravelDestination>

suspend fun getAllTravelDestinationList(page: Int, size: Int): TravelDestinationListResponse {
        val offset = (page - 1) * size
        val travelDestinationList = travelDestinationRepository.findAll(size, offset).toList()

        return TravelDestinationListResponse(
            travelDestinationList = travelDestinationList.map { it.toTravelDestinationElement() }
        )
}

repository

suspend fun findAllBy(pageable: Pageable): Flux<TravelDestination>

suspend fun test(pageable: Pageable): List<TravelDestination> {
		return travelDestinationRepository.findAllBy(pageable).collectList().awaitSingle()
}

이해 안 되는 것