|
@@ -92,6 +92,10 @@ public class PrivilegeController extends ControllerSupport {
|
|
|
@PostMapping("addPrivilege")
|
|
|
public Privilege addPrivilege(@RequestBody Privilege privilege) {
|
|
|
|
|
|
+ privilege.setName(privilege.getName().trim());
|
|
|
+ privilege.setCode(privilege.getCode().trim());
|
|
|
+ privilege.setDescription(privilege.getDescription());
|
|
|
+
|
|
|
PrivilegeGroup group = privilegeGroupRepo.findOne(privilege.getGroupId());
|
|
|
if (null == group) {
|
|
|
throw new StatusException("B-020001", "权限组不存在");
|
|
@@ -116,6 +120,9 @@ public class PrivilegeController extends ControllerSupport {
|
|
|
@PutMapping("updatePrivilege")
|
|
|
public Privilege updatePrivilege(@RequestBody Privilege privilege) {
|
|
|
|
|
|
+ privilege.setName(privilege.getName().trim());
|
|
|
+ privilege.setCode(privilege.getCode().trim());
|
|
|
+ privilege.setDescription(privilege.getDescription());
|
|
|
PrivilegeGroup group = privilegeGroupRepo.findOne(privilege.getGroupId());
|
|
|
if (null == group) {
|
|
|
throw new StatusException("B-020001", "权限组不存在");
|