예제 #1
0
 @RequestMapping(
     value = "/deleteBranch",
     method = {RequestMethod.GET, RequestMethod.POST},
     consumes = "application/json")
 public List<Branch> deleteBranch(@RequestBody Branch branch) {
   branchdao.deleteBranch(branch);
   return branchdao.getAllBranches(1, 5);
 }
예제 #2
0
 @RequestMapping(
     value = "/getBranchesCount",
     method = {RequestMethod.GET, RequestMethod.POST},
     produces = "application/json")
 public int getBranchesCount() {
   return branchdao.getBranchesCount();
 }
예제 #3
0
 @RequestMapping(
     value = "/editBranch",
     method = {RequestMethod.GET, RequestMethod.POST},
     consumes = "application/json")
 public void editBranch(@RequestBody List<Branch> branches) {
   for (Branch branch : branches) branchdao.updateBranch(branch);
 }
예제 #4
0
 /*Admin Branch*/
 @RequestMapping(
     value = "/getBranches/{pageNo}/{pageSize}",
     method = {RequestMethod.GET, RequestMethod.POST},
     produces = "application/json")
 public List<Branch> getBranches(@PathVariable int pageNo, @PathVariable int pageSize) {
   return branchdao.getAllBranches(pageNo, pageSize);
 }
예제 #5
0
 /*Borrower*/
 @RequestMapping(
     value = "/getBooksByBranch",
     method = {RequestMethod.GET, RequestMethod.POST},
     produces = "application/json",
     consumes = "application/json")
 public List<Book> getBooksByBranch(@RequestBody Branch branch) {
   Branch b = branchdao.getBranchById(branch.getBranchId());
   return b.getBooks();
 }