mirror of
https://github.com/OtusTeam/Spring.git
synced 2026-05-30 10:50:42 +00:00
32 lines
729 B
Java
32 lines
729 B
Java
|
|
package hello;
|
|
|
|
import org.springframework.boot.CommandLineRunner;
|
|
import org.springframework.boot.SpringApplication;
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
import hello.wsdl.GetCountryResponse;
|
|
|
|
@SpringBootApplication
|
|
public class Application {
|
|
|
|
public static void main(String[] args) {
|
|
SpringApplication.run(Application.class, args);
|
|
}
|
|
|
|
@Bean
|
|
CommandLineRunner lookup(CountryClient quoteClient) {
|
|
return args -> {
|
|
String country = "Spain";
|
|
|
|
if (args.length > 0) {
|
|
country = args[0];
|
|
}
|
|
GetCountryResponse response = quoteClient.getCountry(country);
|
|
System.err.println(response.getCountry().getCurrency());
|
|
};
|
|
}
|
|
|
|
}
|