Class BooksController
java.lang.Object
info.ejava.examples.db.mongo.books.controller.BooksController
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
private final BooksService
static 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
@RequestMapping(path="api/books", method=GET, 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
@RequestMapping(path="api/books/random", method=GET, produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<BookDTO> getRandomBook() -
updateBook
-
deleteBook
-
deleteAllBooks
@RequestMapping(path="api/books", method=DELETE) public org.springframework.http.ResponseEntity<Void> deleteAllBooks() -
findBooksByExample
@RequestMapping(path="api/books/example", method=POST, 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)
-