diff --git a/diboot-components-msg/src/main/java/com/diboot/components/msg/controller/MessageController.java b/diboot-components-msg/src/main/java/com/diboot/components/msg/controller/MessageController.java index 832ecbe..84da038 100644 --- a/diboot-components-msg/src/main/java/com/diboot/components/msg/controller/MessageController.java +++ b/diboot-components-msg/src/main/java/com/diboot/components/msg/controller/MessageController.java @@ -51,7 +51,7 @@ public class MessageController extends BaseCrudRestController { * @throws Exception */ @GetMapping("/{id}") - public JsonResult getModel(@PathVariable("id")Long id, HttpServletRequest request, ModelMap modelMap) + public JsonResult getModel(@PathVariable("id")Long id, HttpServletRequest request) throws Exception{ MessageVO entityVO = messageService.getViewObject(id, MessageVO.class); return new JsonResult(entityVO); diff --git a/diboot-components-msg/src/main/java/com/diboot/components/msg/controller/MessageTemplateController.java b/diboot-components-msg/src/main/java/com/diboot/components/msg/controller/MessageTemplateController.java index 520de74..248721b 100644 --- a/diboot-components-msg/src/main/java/com/diboot/components/msg/controller/MessageTemplateController.java +++ b/diboot-components-msg/src/main/java/com/diboot/components/msg/controller/MessageTemplateController.java @@ -47,7 +47,7 @@ public class MessageTemplateController extends BaseCrudRestController { * @throws Exception */ @GetMapping("/{id}") - public JsonResult getModel(@PathVariable("id")Long id, HttpServletRequest request, ModelMap modelMap) + public JsonResult getModel(@PathVariable("id")Long id, HttpServletRequest request) throws Exception{ MessageTemplate entity = messageTemplateService.getEntity(id); return new JsonResult(entity); @@ -72,7 +72,7 @@ public class MessageTemplateController extends BaseCrudRestController { */ @PutMapping("/{id}") public JsonResult updateModel(@PathVariable("id")Long id, @ModelAttribute MessageTemplate entity, BindingResult result, - HttpServletRequest request, ModelMap modelMap) throws Exception{ + HttpServletRequest request) throws Exception{ return super.updateEntity(entity, result); } diff --git a/diboot-example/src/main/java/com/diboot/example/controller/DepartmentController.java b/diboot-example/src/main/java/com/diboot/example/controller/DepartmentController.java index bbc4ca9..db54c3e 100644 --- a/diboot-example/src/main/java/com/diboot/example/controller/DepartmentController.java +++ b/diboot-example/src/main/java/com/diboot/example/controller/DepartmentController.java @@ -110,7 +110,7 @@ public class DepartmentController extends BaseCrudRestController { * @throws Exception */ @GetMapping("/{id}") - public JsonResult getModel(@PathVariable("id")Long id, HttpServletRequest request, ModelMap modelMap) + public JsonResult getModel(@PathVariable("id")Long id, HttpServletRequest request) throws Exception{ DepartmentVO vo = departmentService.getViewObject(id, DepartmentVO.class); return new JsonResult(vo); diff --git a/diboot-example/src/main/java/com/diboot/example/controller/SysUserController.java b/diboot-example/src/main/java/com/diboot/example/controller/SysUserController.java index ea57b7a..d2d4e8a 100644 --- a/diboot-example/src/main/java/com/diboot/example/controller/SysUserController.java +++ b/diboot-example/src/main/java/com/diboot/example/controller/SysUserController.java @@ -71,7 +71,7 @@ public class SysUserController extends BaseCrudRestController { * @throws Exception */ @PostMapping("/") - public JsonResult createEntity(@RequestBody SysUser entity, BindingResult result, HttpServletRequest request, ModelMap modelMap) + public JsonResult createEntity(@RequestBody SysUser entity, BindingResult result, HttpServletRequest request) throws Exception{ boolean success = sysUserService.createSysUser(entity); if(success){ @@ -90,15 +90,11 @@ public class SysUserController extends BaseCrudRestController { */ @PutMapping("/{id}") public JsonResult updateModel(@PathVariable("id")Long id, @RequestBody SysUser entity, BindingResult result, - HttpServletRequest request, ModelMap modelMap) throws Exception{ + HttpServletRequest request) throws Exception{ // Model属性值验证结果 if(result.hasErrors()) { return new JsonResult(Status.FAIL_INVALID_PARAM, super.getBindingError(result)); } - if(modelMap.get(ERROR) != null){ - return new JsonResult(Status.FAIL_VALIDATION, (String) modelMap.get(ERROR)); - } - entity.setId(id); boolean success = sysUserService.updateSysUser(entity); if(success){ @@ -115,7 +111,7 @@ public class SysUserController extends BaseCrudRestController { * @throws Exception */ @GetMapping("/{id}") - public JsonResult getModel(@PathVariable("id")Long id, HttpServletRequest request, ModelMap modelMap) + public JsonResult getModel(@PathVariable("id")Long id, HttpServletRequest request) throws Exception{ SysUserVO sysUserVO = sysUserService.getSysUser(id); return new JsonResult(sysUserVO); diff --git a/diboot-shiro/src/main/java/com/diboot/shiro/controller/PermissionController.java b/diboot-shiro/src/main/java/com/diboot/shiro/controller/PermissionController.java index 9bef114..0a76f2d 100644 --- a/diboot-shiro/src/main/java/com/diboot/shiro/controller/PermissionController.java +++ b/diboot-shiro/src/main/java/com/diboot/shiro/controller/PermissionController.java @@ -47,7 +47,7 @@ public class PermissionController extends BaseCrudRestController { */ @GetMapping("/{id}") @AuthorizationWrapper(value = @RequiresPermissions("get"), name = "查看") - public JsonResult getModel(@PathVariable("id")Long id, HttpServletRequest request, ModelMap modelMap) + public JsonResult getModel(@PathVariable("id")Long id, HttpServletRequest request) throws Exception{ PermissionVO vo = permissionService.getViewObject(id, PermissionVO.class); return new JsonResult(vo); diff --git a/diboot-shiro/src/main/java/com/diboot/shiro/controller/RoleController.java b/diboot-shiro/src/main/java/com/diboot/shiro/controller/RoleController.java index 1a694b8..9c334ec 100644 --- a/diboot-shiro/src/main/java/com/diboot/shiro/controller/RoleController.java +++ b/diboot-shiro/src/main/java/com/diboot/shiro/controller/RoleController.java @@ -71,7 +71,7 @@ public class RoleController extends BaseCrudRestController { * @throws Exception */ @PostMapping("/") - public JsonResult createEntity(@RequestBody Role entity, BindingResult result, HttpServletRequest request, ModelMap modelMap) + public JsonResult createEntity(@RequestBody Role entity, BindingResult result, HttpServletRequest request) throws Exception{ // 创建 boolean success = roleService.createRole(entity); @@ -88,7 +88,7 @@ public class RoleController extends BaseCrudRestController { * @throws Exception */ @GetMapping("/toUpdatePage/{id}") - public JsonResult toUpdatePage(@PathVariable("id")Long id, HttpServletRequest request, ModelMap modelMap) + public JsonResult toUpdatePage(@PathVariable("id")Long id, HttpServletRequest request) throws Exception{ RoleVO roleVO = roleService.toUpdatePage(id); return new JsonResult(roleVO); @@ -103,14 +103,11 @@ public class RoleController extends BaseCrudRestController { */ @PutMapping("/{id}") public JsonResult updateModel(@PathVariable("id")Long id, @RequestBody Role entity, BindingResult result, - HttpServletRequest request, ModelMap modelMap) throws Exception{ + HttpServletRequest request) throws Exception{ // Model属性值验证结果 if(result.hasErrors()) { return new JsonResult(Status.FAIL_INVALID_PARAM, super.getBindingError(result)); } - if(modelMap.get(ERROR) != null){ - return new JsonResult(Status.FAIL_VALIDATION, (String) modelMap.get(ERROR)); - } entity.setId(id); boolean success = roleService.updateRole(entity); @@ -129,7 +126,7 @@ public class RoleController extends BaseCrudRestController { * @throws Exception */ @GetMapping("/{id}") - public JsonResult getModel(@PathVariable("id")Long id, HttpServletRequest request, ModelMap modelMap) + public JsonResult getModel(@PathVariable("id")Long id, HttpServletRequest request) throws Exception{ RoleVO roleVO = roleService.getRole(id); return new JsonResult(roleVO); @@ -157,7 +154,7 @@ public class RoleController extends BaseCrudRestController { * @throws Exception */ @GetMapping("/getAllMenu") - public JsonResult getAllMenu(HttpServletRequest request, ModelMap modelMap) + public JsonResult getAllMenu(HttpServletRequest request) throws Exception{ List list = roleService.getAllMenu(); return new JsonResult(list);