JavaSpring.libraries.spring-http-interface.httpInterfacesConfiguration.mustache Maven / Gradle / Ivy
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) ({{{generatorVersion}}}).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package {{configPackage}};
{{#apiInfo}}
{{#apis}}
import {{apiPackage}}.{{classname}};
{{/apis}}
{{/apiInfo}}
import org.springframework.context.annotation.Bean;
import org.springframework.web.reactive.function.client.WebClient;
import org.springframework.web.reactive.function.client.support.WebClientAdapter;
import org.springframework.web.service.invoker.HttpServiceProxyFactory;
public abstract class HttpInterfacesAbstractConfigurator {
private final WebClient webClient;
public HttpInterfacesAbstractConfigurator(final WebClient webClient) {
this.webClient = webClient;
}
{{#apiInfo}}
{{#apis}}
@Bean(name = "{{configPackage}}.HttpInterfacesAbstractConfigurator.{{classVarName}}")
{{classname}} {{classVarName}}HttpProxy() {
HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build();
return factory.createClient({{classname}}.class);
}
{{/apis}}
{{/apiInfo}}
}