hereにあるサンプルプロジェクトを実行しようとしています。ことができ、私はこのコードが書かれていたので、春のAPIが変更されたことを推測している'Mono.and()'は、指定されたパラメータで呼び出すことができません
internal class ApiHandler(val geoLocationService: GeoLocationService, val sunriseSunsetService: SunriseSunsetService,
val errorHandler: ErrorHandler) {
private companion object {
const val ADDRESS = "address"
}
internal fun getLocation(request: ServerRequest) =
request.pathVariable(ADDRESS).toMono()
.transform(this::buildResponse)
.transform(this::serverResponse)
.onErrorResume(errorHandler::throwableError)!!
internal fun postLocation(request: ServerRequest) =
request.extract<LocationRequest>()
.map(LocationRequest::address)
.transform(this::buildResponse)
.transform(this::serverResponse)
.onErrorResume(errorHandler::throwableError)!!
internal fun buildResponse(address: Mono<String>) =
address.transform(geoLocationService::fromAddress)
.and(this::sunriseSunset, ::LocationResponse)
internal fun sunriseSunset(geographicCoordinates: GeographicCoordinates) =
geographicCoordinates.toMono().transform(sunriseSunsetService::fromGeographicCoordinates)
internal fun serverResponse(locationResponseMono: Mono<LocationResponse>): Mono<ServerResponse> =
locationResponseMono.flatMap { ok() withBody it }
}
、私:しかし、私はbuildResponse
機能でApiHandler.kt
クラスに
Error:(38, 22) Kotlin: None of the following functions can be called with the arguments supplied: public final fun and(p0: ((Subscriber<in Any!>!) -> Unit)!): Mono<Void!>! defined in reactor.core.publisher.Mono public final fun and(p0: Publisher<*>!): Mono<Void!>! defined in reactor.core.publisher.Mono
を見ています.and(...)
に何を変更するかを把握していない。