コード例 #1
0
 @RequestMapping(
     value = "/deleteAuthor",
     method = {RequestMethod.GET, RequestMethod.POST},
     consumes = "application/json",
     produces = "application/json")
 public List<Author> deleteAuthor(@RequestBody Author author) {
   adao.deleteAuthor(author);
   return adao.getAllAuthors(1, 5);
 }
コード例 #2
0
 @RequestMapping(
     value = "/getAuthorsCount",
     method = {RequestMethod.GET, RequestMethod.POST},
     produces = "application/json")
 public int getAuthorsCount() {
   return adao.getAuthorsCount();
 }
コード例 #3
0
 @RequestMapping(
     value = "/getAuthorsByBookId/{bookId}",
     method = {RequestMethod.GET, RequestMethod.POST},
     produces = "application/json")
 public List<Author> getAuthorsByBookId(@PathVariable int bookId) {
   return adao.getAuthorsByBookId(bookId);
 }
コード例 #4
0
 @RequestMapping(
     value = "/getAuthorsById/{id}",
     method = {RequestMethod.GET, RequestMethod.POST},
     produces = "application/json")
 public Author getAuthorById(@PathVariable int authorId) {
   return adao.getAuthorById(authorId);
 }
コード例 #5
0
 @RequestMapping(
     value = "/editAuthor",
     method = {RequestMethod.GET, RequestMethod.POST},
     consumes = "application/json")
 public void editAuthor(@RequestBody List<Author> authors) {
   for (Author author : authors) adao.updateAuthor(author);
 }
コード例 #6
0
 /*Admin Author*/
 @RequestMapping(
     value = "/getAuthors/{pageNo}/{pageSize}",
     method = {RequestMethod.GET, RequestMethod.POST},
     produces = "application/json")
 public List<Author> getAuthors(@PathVariable int pageNo, @PathVariable int pageSize) {
   return adao.getAllAuthors(pageNo, pageSize);
 }
コード例 #7
0
 @RequestMapping(
     value = "/getAuthorsByName/{searchString}/{pageNo}/{pageSize}",
     method = {RequestMethod.GET, RequestMethod.POST},
     produces = "application/json")
 public List<Author> getAuthorsByName(
     @PathVariable String searchString, @PathVariable int pageNo, @PathVariable int pageSize) {
   return adao.getAuthorsByName(searchString, pageNo, pageSize);
 }