Class BooksController
java.lang.Object
info.ejava.examples.db.mongo.books.controller.BooksController
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringprivate final BooksServicestatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<BookDTO> createBook(BookDTO bookDTO) org.springframework.http.ResponseEntity<Void> org.springframework.http.ResponseEntity<Void> deleteBook(String id) org.springframework.http.ResponseEntity<BooksPageDTO> findBooksByExample(Integer pageNumber, Integer pageSize, String sortString, BookDTO probe) org.springframework.http.ResponseEntity<BookDTO> org.springframework.http.ResponseEntity<BooksPageDTO> org.springframework.http.ResponseEntity<BookDTO> org.springframework.http.ResponseEntity<Void> updateBook(String id, BookDTO bookDTO)
-
Field Details
-
BOOKS_PATH
- See Also:
-
BOOK_PATH
- See Also:
-
RANDOM_BOOK_PATH
- See Also:
-
booksService
-
-
Constructor Details
-
BooksController
public BooksController()
-
-
Method Details
-
createBook
-
getBooks
@GetMapping(path="api/books", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<BooksPageDTO> getBooks(@RequestParam(value="pageNumber",defaultValue="0",required=false) Integer pageNumber, @RequestParam(value="pageSize",defaultValue="5",required=false) Integer pageSize, @RequestParam(value="sort",required=false) String sortString) -
getBook
-
getRandomBook
@GetMapping(path="api/books/random", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<BookDTO> getRandomBook() -
updateBook
-
deleteBook
-
deleteAllBooks
-
findBooksByExample
@PostMapping(path="api/books/example", consumes={"application/json","application/xml"}, produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<BooksPageDTO> findBooksByExample(@RequestParam(value="pageNumber",defaultValue="0",required=false) Integer pageNumber, @RequestParam(value="pageSize",required=false) Integer pageSize, @RequestParam(value="sort",required=false) String sortString, @RequestBody BookDTO probe)
-