新增用户姓名列表接口
This commit is contained in:
parent
9c90e9bb83
commit
32f29e286c
|
@ -177,6 +177,14 @@ public class SysUserController {
|
|||
return Result.ok();
|
||||
}
|
||||
|
||||
@PostMapping("nameList")
|
||||
@Operation(summary = "用户姓名列表")
|
||||
public Result<List<String>> nameList(@RequestBody List<Long> idList) {
|
||||
List<String> list = sysUserService.getRealNameList(idList);
|
||||
|
||||
return Result.ok(list);
|
||||
}
|
||||
|
||||
@PostMapping("import")
|
||||
@Operation(summary = "导入用户")
|
||||
@OperateLog(type = OperateTypeEnum.IMPORT)
|
||||
|
|
|
@ -32,6 +32,14 @@ public interface SysUserService extends BaseService<SysUserEntity> {
|
|||
|
||||
void delete(List<Long> idList);
|
||||
|
||||
/**
|
||||
* 获取用户姓名列表
|
||||
*
|
||||
* @param idList 用户ID列表
|
||||
* @return 用户姓名列表
|
||||
*/
|
||||
List<String> getRealNameList(List<Long> idList);
|
||||
|
||||
SysUserVO getByMobile(String mobile);
|
||||
|
||||
/**
|
||||
|
|
|
@ -59,7 +59,7 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit
|
|||
// 分页查询
|
||||
IPage<SysUserEntity> page = getPage(query);
|
||||
params.put(Constant.PAGE, page);
|
||||
|
||||
|
||||
// 数据列表
|
||||
List<SysUserEntity> list = baseMapper.getList(params);
|
||||
|
||||
|
@ -186,6 +186,15 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<String> getRealNameList(List<Long> idList) {
|
||||
if (idList.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return baseMapper.selectBatchIds(idList).stream().map(SysUserEntity::getRealName).toList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysUserVO getByMobile(String mobile) {
|
||||
SysUserEntity user = baseMapper.getByMobile(mobile);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user