Ejemplo n.º 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);
 }
Ejemplo n.º 2
0
 @RequestMapping(
     value = "/getBranchesCount",
     method = {RequestMethod.GET, RequestMethod.POST},
     produces = "application/json")
 public int getBranchesCount() {
   return branchdao.getBranchesCount();
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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();
 }