Skip to content

Instantly share code, notes, and snippets.

@mstykt
Created May 5, 2020 08:33
Show Gist options
  • Save mstykt/9829d2e8314e40ccefd18670ed54b5d2 to your computer and use it in GitHub Desktop.
Save mstykt/9829d2e8314e40ccefd18670ed54b5d2 to your computer and use it in GitHub Desktop.
package com.gauge.demo.client;
import com.gauge.demo.config.FeignConfig;
import com.gauge.demo.model.Repo;
import com.gauge.demo.model.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import java.util.List;
@FeignClient(name = "github-api", url = "${api.client.url.github}", configuration = FeignConfig.class)
public interface GithubClient {
@GetMapping("/users/{username}")
User getUser(@PathVariable("username") String username);
@GetMapping("/users/{username}/repos")
List<Repo> getRepos(@PathVariable("username") String username);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment