com.nepxion.discovery.console.configuration.ConsoleAutoConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of discovery-console Show documentation
Show all versions of discovery-console Show documentation
Nepxion Discovery is an enhancement for Spring Cloud Discovery
package com.nepxion.discovery.console.configuration;
/**
* Title: Nepxion Discovery
* Description: Nepxion Discovery
* Copyright: Copyright (c) 2017-2050
* Company: Nepxion
* @author Haojun Ren
* @version 1.0
*/
import org.springframework.boot.actuate.endpoint.Endpoint;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.web.client.RestTemplate;
import com.nepxion.discovery.console.endpoint.ConsoleEndpoint;
import com.nepxion.discovery.console.handler.ConsoleErrorHandler;
@Configuration
// @ComponentScan(basePackages = { "com.nepxion.discovery.console.endpoint" })
@Import(SwaggerConfiguration.class)
public class ConsoleAutoConfiguration {
static {
System.out.println("");
System.out.println("╔═══╗");
System.out.println("╚╗╔╗║");
System.out.println(" ║║║╠╦══╦══╦══╦╗╔╦══╦═╦╗ ╔╗");
System.out.println(" ║║║╠╣══╣╔═╣╔╗║╚╝║║═╣╔╣║ ║║");
System.out.println("╔╝╚╝║╠══║╚═╣╚╝╠╗╔╣║═╣║║╚═╝║");
System.out.println("╚═══╩╩══╩══╩══╝╚╝╚══╩╝╚═╗╔╝");
System.out.println(" ╔═╝║");
System.out.println(" ╚══╝");
System.out.println("Nepxion Discovery - Console v3.3.29");
System.out.println("");
}
@ConditionalOnClass(Endpoint.class)
protected static class ConsoleEndpointConfiguration {
@Bean
public ConsoleEndpoint consoleEndpoint() {
return new ConsoleEndpoint();
}
@Bean
public RestTemplate consoleRestTemplate() {
RestTemplate restTemplate = new RestTemplate();
restTemplate.setErrorHandler(new ConsoleErrorHandler());
return restTemplate;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy