예제 #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);
 }
예제 #2
0
 @RequestMapping(
     value = "/getBooksCount",
     method = {RequestMethod.GET, RequestMethod.POST},
     produces = "application/json")
 public int getBooksCount() {
   return bookdao.getBooksCount();
 }
예제 #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);
 }
예제 #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);
 }
예제 #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);
 }