新增角色名称列表接口
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);
|
||||
}
|
||||
}
|
|
@ -11,21 +11,29 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* 角色
|
||||
*
|
||||
*
|
||||
* @author 阿沐 babamu@126.com
|
||||
* <a href="https://maku.net">MAKU</a>
|
||||
*/
|
||||
public interface SysRoleService extends BaseService<SysRoleEntity> {
|
||||
|
||||
PageResult<SysRoleVO> page(SysRoleQuery query);
|
||||
PageResult<SysRoleVO> page(SysRoleQuery query);
|
||||
|
||||
List<SysRoleVO> getList(SysRoleQuery query);
|
||||
List<SysRoleVO> getList(SysRoleQuery query);
|
||||
|
||||
void save(SysRoleVO vo);
|
||||
void save(SysRoleVO vo);
|
||||
|
||||
void update(SysRoleVO vo);
|
||||
void update(SysRoleVO vo);
|
||||
|
||||
void dataScope(SysRoleDataScopeVO vo);
|
||||
void dataScope(SysRoleDataScopeVO vo);
|
||||
|
||||
void delete(List<Long> idList);
|
||||
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