Commit a9bde971 by huangjinxin

fix:调整删除角色入参

1 parent 1a45eacb
...@@ -46,7 +46,7 @@ public interface IRole { ...@@ -46,7 +46,7 @@ public interface IRole {
* @return * @return
*/ */
@RequestMapping(value = "/pea-user/role/delete", method = RequestMethod.POST) @RequestMapping(value = "/pea-user/role/delete", method = RequestMethod.POST)
Result<Boolean> deleteRole(@RequestParam("id") String roleId); Result<Boolean> deleteRole(@RequestBody RoleInfo roleInfo);
/** /**
* 添加用户角色 * 添加用户角色
......
...@@ -46,11 +46,11 @@ public class RoleController implements IRole { ...@@ -46,11 +46,11 @@ public class RoleController implements IRole {
} }
@Override @Override
public Result<Boolean> deleteRole(String roleId) { public Result<Boolean> deleteRole(RoleInfo roleInfo) {
if (StringUtils.isBlank(roleId)) { if (StringUtils.isBlank(roleInfo.getId())) {
return Result.failed(StatusCodeEnum.COMMON_PARAM_EMPTY, false); return Result.failed(StatusCodeEnum.COMMON_PARAM_EMPTY, false);
} }
roleService.deleteRole(roleId); roleService.deleteRole(roleInfo.getId());
return Result.success(true); return Result.success(true);
} }
......
...@@ -66,13 +66,13 @@ public class RoleService { ...@@ -66,13 +66,13 @@ public class RoleService {
public RoleInfo addRole(RoleInfo roleInfo) { public RoleInfo addRole(RoleInfo roleInfo) {
RoleEntity roleEntity = BeanUtil.copyProperties(roleInfo, RoleEntity.class); RoleEntity roleEntity = BeanUtil.copyProperties(roleInfo, RoleEntity.class);
roleEntity = roleDao.save(roleEntity); roleEntity = roleDao.save(roleEntity);
List<RoleResourceInfo> resourceInfos = roleInfo.getResourceInfos(); // List<RoleResourceInfo> resourceInfos = roleInfo.getResourceInfos();
if (CollectionUtils.isNotEmpty(resourceInfos)) { // if (CollectionUtils.isNotEmpty(resourceInfos)) {
for (RoleResourceInfo resourceInfo : resourceInfos) { // for (RoleResourceInfo resourceInfo : resourceInfos) {
RoleResourceEntity roleResourceEntity = assembleRoleResource(roleEntity.getId(), resourceInfo.getResourceId()); // RoleResourceEntity roleResourceEntity = assembleRoleResource(roleEntity.getId(), resourceInfo.getResourceId());
roleResourceDao.save(roleResourceEntity); // roleResourceDao.save(roleResourceEntity);
} // }
} // }
roleInfo = BeanUtil.copyProperties(roleEntity, RoleInfo.class); roleInfo = BeanUtil.copyProperties(roleEntity, RoleInfo.class);
return roleInfo; return roleInfo;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!