Class BooksController

java.lang.Object
info.ejava.examples.db.mongo.books.controller.BooksController

@RestController public class BooksController extends Object
  • Field Details

  • Constructor Details

    • BooksController

      public BooksController()
  • Method Details

    • createBook

      @RequestMapping(path="api/books", method=POST, consumes={"application/json","application/xml"}, produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<BookDTO> createBook(@RequestBody BookDTO bookDTO)
    • 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

      @RequestMapping(path="api/books/{id}", method=GET, produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<BookDTO> getBook(@PathVariable(name="id") String id)
    • getRandomBook

      @RequestMapping(path="api/books/random", method=GET, produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<BookDTO> getRandomBook()
    • updateBook

      @RequestMapping(path="api/books/{id}", method=PUT, consumes={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<Void> updateBook(@PathVariable("id") String id, @RequestBody BookDTO bookDTO)
    • deleteBook

      @RequestMapping(path="api/books/{id}", method=DELETE) public org.springframework.http.ResponseEntity<Void> deleteBook(@PathVariable(name="id") String id)
    • 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)