Exemplo n.º 1
0
 @RequestMapping(
     value = "/deleteBook",
     method = {RequestMethod.GET, RequestMethod.POST},
     consumes = "application/json")
 public List<Book> deleteBook(@RequestBody Book book) {
   bookdao.deleteBook(book);
   return bookdao.getAllBooks(1, 5);
 }
Exemplo n.º 2
0
 @RequestMapping(
     value = "/getBooksCount",
     method = {RequestMethod.GET, RequestMethod.POST},
     produces = "application/json")
 public int getBooksCount() {
   return bookdao.getBooksCount();
 }
Exemplo n.º 3
0
 @RequestMapping(
     value = "/editBook",
     method = {RequestMethod.GET, RequestMethod.POST},
     consumes = "application/json")
 public void editBook(@RequestBody List<Book> books) {
   for (Book book : books) bookdao.updateBook(book);
 }
Exemplo n.º 4
0
 /*Admin Book*/
 @RequestMapping(
     value = "/getBooks/{pageNo}/{pageSize}",
     method = {RequestMethod.GET, RequestMethod.POST},
     produces = "application/json")
 public List<Book> getBooks(@PathVariable int pageNo, @PathVariable int pageSize) {
   return bookdao.getAllBooks(pageNo, pageSize);
 }
Exemplo n.º 5
0
 @RequestMapping(
     value = "/getBooksByName/{searchString}/{pageNo}/{pageSize}",
     method = {RequestMethod.GET, RequestMethod.POST},
     produces = "application/json")
 public List<Book> getBooksByName(
     @PathVariable String searchString, @PathVariable int pageNo, @PathVariable int pageSize) {
   return bookdao.getBooksByName(searchString, pageNo, pageSize);
 }