Skip to content

Instantly share code, notes, and snippets.


b1a9id/ Secret

Created Sep 13, 2020
What would you like to do?
public class SakeController {
private final SakeService sakeService;
public Page<SakeResponse> page(@PageableDefault Pageable pageable) {
public List<SakeResponse> list() {
return sakeService.list();
public SakeResponse get(@PathVariable Integer id) {
return sakeService.get(id);
public SakeResponse create(@RequestBody @Validated SakeCreateRequest request) {
return sakeService.create(request);
public ResponseEntity<ErrorResponse> handleException(NotFoundException e) {
return ResponseEntity.of(Optional.of(new ErrorResponse(e.getMessage())));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment