Добавил кал
This commit is contained in:
parent
059729f986
commit
fa6f53bd8a
@ -36,6 +36,17 @@ public class AuthorController {
|
||||
return new AuthorDto(authorService.updateAuthor(id, authorDto));
|
||||
}
|
||||
|
||||
@PostMapping("/{id}/Book/{bookId}")
|
||||
public void addBook(@PathVariable Long id, @PathVariable Long bookId) {
|
||||
authorService.addBookToAuthor(id, bookId);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}/Book/{bookId}")
|
||||
public void removeBook(@PathVariable Long id, @PathVariable Long bookId)
|
||||
{
|
||||
authorService.removeBookFromAuthor(id, bookId);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public void deleteAuthor(@PathVariable Long id){
|
||||
authorService.deleteAuthor(id);
|
||||
|
@ -36,6 +36,17 @@ public class BookController {
|
||||
return new BookDto(bookService.updateBook(id, bookDto));
|
||||
}
|
||||
|
||||
@PostMapping("/{id}/Genre/{genreId}")
|
||||
public void addGenre(@PathVariable Long id, @PathVariable Long genreId) {
|
||||
bookService.addGenreToBook(id, genreId);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}/Genre/{genreId}")
|
||||
public void removeGenre(@PathVariable Long id, @PathVariable Long genreId)
|
||||
{
|
||||
bookService.removeGenreFromBook(id, genreId);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public void deleteBook(@PathVariable Long id){
|
||||
bookService.deleteBook(id);
|
||||
|
Loading…
Reference in New Issue
Block a user