All Downloads are FREE. Search and download functionalities are using the official Maven repository.

JavaSpring.libraries.spring-http-interface.httpInterfacesConfiguration.mustache Maven / Gradle / Ivy

There is a newer version: 7.7.0
Show newest version
/**
* 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}}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy