新增角色名称列表接口
This commit is contained in:
parent
bbcdb0f450
commit
9c90e9bb83
|
@ -159,4 +159,12 @@ public class SysRoleController {
|
|||
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@PostMapping("nameList")
|
||||
@Operation(summary = "名称列表")
|
||||
public Result<List<String>> nameList(@RequestBody List<Long> idList) {
|
||||
List<String> list = sysRoleService.getNameList(idList);
|
||||
|
||||
return Result.ok(list);
|
||||
}
|
||||
}
|
|
@ -28,4 +28,12 @@ public interface SysRoleService extends BaseService<SysRoleEntity> {
|
|||
void dataScope(SysRoleDataScopeVO vo);
|
||||
|
||||
void delete(List<Long> idList);
|
||||
|
||||
/**
|
||||
* 获取角色名称列表
|
||||
*
|
||||
* @param idList 角色ID列表
|
||||
* @return 角色名称列表
|
||||
*/
|
||||
List<String> getNameList(List<Long> idList);
|
||||
}
|
||||
|
|
|
@ -125,4 +125,13 @@ public class SysRoleServiceImpl extends BaseServiceImpl<SysRoleDao, SysRoleEntit
|
|||
idList.forEach(sysUserTokenService::updateCacheAuthByRoleId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getNameList(List<Long> idList) {
|
||||
if (idList.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return baseMapper.selectBatchIds(idList).stream().map(SysRoleEntity::getName).toList();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user