Добавил кал
This commit is contained in:
parent
059729f986
commit
fa6f53bd8a
@ -36,6 +36,17 @@ public class AuthorController {
|
|||||||
return new AuthorDto(authorService.updateAuthor(id, authorDto));
|
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}")
|
@DeleteMapping("/{id}")
|
||||||
public void deleteAuthor(@PathVariable Long id){
|
public void deleteAuthor(@PathVariable Long id){
|
||||||
authorService.deleteAuthor(id);
|
authorService.deleteAuthor(id);
|
||||||
|
@ -36,6 +36,17 @@ public class BookController {
|
|||||||
return new BookDto(bookService.updateBook(id, bookDto));
|
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}")
|
@DeleteMapping("/{id}")
|
||||||
public void deleteBook(@PathVariable Long id){
|
public void deleteBook(@PathVariable Long id){
|
||||||
bookService.deleteBook(id);
|
bookService.deleteBook(id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user