Skip to content

Instantly share code, notes, and snippets.

@b1a9id

b1a9id/SakeController.java Secret

Created Sep 4, 2020
Embed
What would you like to do?
Spring Cloud OpenFeignサンプルのSakeController.java
@RestController
@RequestMapping("/sakes")
public class SakeController {
final SakeClient sakeClient;
public SakeController(SakeClient sakeClient) {
this.sakeClient = sakeClient;
}
@GetMapping
public List<SakeResponse> list() {
return sakeClient.list();
}
@GetMapping("{id}")
public SakeResponse get(@PathVariable Integer id) {
return sakeClient.get(id);
}
@PostMapping
public SakeResponse create() {
return sakeClient.create(new SakeCreateRequest("寫樂", "宮泉銘醸"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.