
package com.google.example;

import java.io.IOException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@EnableFeignClients
@RestController
@SpringBootApplication
public class TestMain {
  @Autowired private GreetingClient greetingClient;

  public static void main(String[] args) throws IOException {
    SpringApplication.run(TestMain.class, args);
  }

  @GetMapping("/greeting")
  public String greeting() {
    return "Hello";
  }

  @GetMapping("/")
  public String home() {
    return greetingClient.greeting() + " World";
  }
}
