org.zodiac.autoconfigure.web.remote.WebRemoteApiReactiveAutoConfiguration Maven / Gradle / Ivy
package org.zodiac.autoconfigure.web.remote;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
import org.springframework.boot.autoconfigure.web.reactive.WebFluxRegistrations;
import org.springframework.web.reactive.config.WebFluxConfigurer;
import org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMapping;
import org.zodiac.core.web.remote.reactive.RemoteApiFilterReactiveInterceptor;
import org.zodiac.core.web.remote.reactive.RemoteApiHandlerMapping;
@SpringBootConfiguration
@ConditionalOnWebApplication(type = Type.REACTIVE)
public class WebRemoteApiReactiveAutoConfiguration implements WebFluxConfigurer, WebFluxRegistrations {
private com.fasterxml.jackson.databind.ObjectMapper objectMapper;
private RemoteApiFilterReactiveInterceptor remoteApiFilterInterceptor;
public WebRemoteApiReactiveAutoConfiguration(ObjectProvider objectMapperProvider,
ObjectProvider remoteApiFilterInterceptorProvider) {
this.objectMapper = objectMapperProvider.getIfAvailable();
this.remoteApiFilterInterceptor = remoteApiFilterInterceptorProvider.getIfAvailable();
}
@Override
public RequestMappingHandlerMapping getRequestMappingHandlerMapping() {
return new RemoteApiHandlerMapping();
}
}