fix(admin): 修正角色ID参数类型为Long
- 将AdminUserRoleMapServiceImpl中getAuthorizeUser方法的roleId类型由Integer改为Long - 修改IAdminUserRoleMapService接口中对应方法的roleId参数类型为Long - 更新RoleController中getAuthorizeUser接口的roleId参数类型为Long,确保前后端一致 - 解决了不同类型可能导致的类型转换异常与潜在错误问题
This commit is contained in:
parent
08fa8e8084
commit
3cc0019d98
|
|
@ -145,7 +145,7 @@ public class RoleController extends ControllerBase {
|
||||||
*/
|
*/
|
||||||
@GetMapping("getAuthorizeUser")
|
@GetMapping("getAuthorizeUser")
|
||||||
@ApiMark(moduleName = "角色管理", apiName = "获取已授权人员")
|
@ApiMark(moduleName = "角色管理", apiName = "获取已授权人员")
|
||||||
public ApiResult<List<AdminUserVO>> getAuthorizeUser(@RequestParam Integer roleId) {
|
public ApiResult<List<AdminUserVO>> getAuthorizeUser(@RequestParam Long roleId) {
|
||||||
return ApiResult.success(adminUserRoleMapService.getAuthorizeUser(roleId));
|
return ApiResult.success(adminUserRoleMapService.getAuthorizeUser(roleId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ public interface IAdminUserRoleMapService extends IService<AdminUserRoleMap> {
|
||||||
|
|
||||||
void authorize(AuthorizeUserRequest request);
|
void authorize(AuthorizeUserRequest request);
|
||||||
|
|
||||||
List<AdminUserVO> getAuthorizeUser(Integer roleId);
|
List<AdminUserVO> getAuthorizeUser(Long roleId);
|
||||||
|
|
||||||
List<RoleVO> getRoleList(Integer id);
|
List<RoleVO> getRoleList(Integer id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ public class AdminUserRoleMapServiceImpl extends ServiceImpl<AdminUserRoleMapMap
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AdminUserVO> getAuthorizeUser(Integer roleId) {
|
public List<AdminUserVO> getAuthorizeUser(Long roleId) {
|
||||||
List<Integer> userIds = lambdaQuery().eq(AdminUserRoleMap::getRoleId, roleId).list().stream().map(AdminUserRoleMap::getUserId).collect(Collectors.toList());
|
List<Integer> userIds = lambdaQuery().eq(AdminUserRoleMap::getRoleId, roleId).list().stream().map(AdminUserRoleMap::getUserId).collect(Collectors.toList());
|
||||||
if (CollectionUtil.isEmpty(userIds)) {
|
if (CollectionUtil.isEmpty(userIds)) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue