Created
July 16, 2022 10:01
-
-
Save atesibrahim/696fec46f519c91e440cbb0e846812bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RestController | |
@RequestMapping("books") | |
@RequiredArgsConstructor | |
public class BookController { | |
private final BookService bookService; | |
@GetMapping | |
public List<Book> findAll() { | |
return bookService.findAll(); | |
} | |
@PostMapping | |
public Book save(@RequestBody Book book) { | |
return bookService.save(book); | |
} | |
@DeleteMapping("/{id}") | |
public void deleteById(@PathVariable(name = "id") String id) { | |
bookService.deleteById(id); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment