diff --git a/src/main/java/com/sixteam/irs/controller/JurisdictionController.java b/src/main/java/com/sixteam/irs/controller/JurisdictionController.java index 85a7f416fc7b9972ef99c464311eed43a398276f..3f3975b32572d190194c064ab104281f85f1ae97 100644 --- a/src/main/java/com/sixteam/irs/controller/JurisdictionController.java +++ b/src/main/java/com/sixteam/irs/controller/JurisdictionController.java @@ -16,33 +16,33 @@ public class JurisdictionController { private JurisdictionService jurisdictionService; @RequestMapping("/find/findAll") - public void findAllJurisdiction(HttpServletRequest request){ + public String findAllJurisdiction(HttpServletRequest request) { List all = jurisdictionService.findAll(); - System.out.println(all); - + request.setAttribute("all", all); + return "/test/jurisdiction/权限列表页面.html"; } @RequestMapping("/find/findId") - public String findJurisdictionId(String id,HttpServletRequest request){ - Jurisdiction ij = jurisdictionService.getJurisdictionById("1"); - if (ij !=null){ - System.out.println(ij); + public String findJurisdictionId(String id, HttpServletRequest request) { + Jurisdiction ij = jurisdictionService.getJurisdictionById(id); + if (ij != null) { + request.setAttribute("ij", ij); return "成功"; + } else { + request.setAttribute("errorMessage", "查询错误"); + return "/test/错误页面"; } - else - return "失败"; } @RequestMapping("/find/findName") - public String findJurisdictionName(String name,HttpServletRequest request){ - List ij = jurisdictionService.getJurisdictionByName("温"); - if(ij !=null){ - System.out.println(ij); - return "成功"; + public String findJurisdictionName(String name, HttpServletRequest request) { + List ij = jurisdictionService.getJurisdictionByName(name); + if (ij != null) { + request.setAttribute("ij", ij); + return "/test/jurisdiction/权限列表页面.html"; + } else { + request.setAttribute("errorMessage", "查询错误"); + return "/test/错误页面"; } - else - return "失败"; } - - } diff --git "a/src/main/resources/templates/test/jurisdiction/\346\235\203\351\231\220\345\210\227\350\241\250\351\241\265\351\235\242.html" "b/src/main/resources/templates/test/jurisdiction/\346\235\203\351\231\220\345\210\227\350\241\250\351\241\265\351\235\242.html" new file mode 100644 index 0000000000000000000000000000000000000000..635a9553df25506d092120dadfbff2378be0a77f --- /dev/null +++ "b/src/main/resources/templates/test/jurisdiction/\346\235\203\351\231\220\345\210\227\350\241\250\351\241\265\351\235\242.html" @@ -0,0 +1,27 @@ + + + + + Title + + +

权限列表页面

+ + +
+ 查询:
+ +
+ + + + + + + + + + +
id权限名
id(遍历的值)权限名(遍历的值)
+ + \ No newline at end of file