【新增】增加获取用户列表(排除当前用户)接口

pull/229/MERGE
俞宝山 2024-08-26 00:40:35 +08:00
parent d1e6fd8575
commit 93111a8490
2 changed files with 17 additions and 0 deletions

View File

@ -112,4 +112,12 @@ public interface SysUserApi {
* @date 2022/4/24 20:08
*/
Page<JSONObject> userSelector(String orgId, String searchKey);
/**
*
*
* @author chengchuanyao
* @date 2024/7/19 9:54
*/
List<JSONObject> listUserWithoutCurrent();
}

View File

@ -12,6 +12,7 @@
*/
package vip.xiaonuo.sys.modular.user.provider;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.convert.Convert;
@ -228,4 +229,12 @@ public class SysUserApiProvider implements SysUserApi {
sysUserSelectorUserParam.setSearchKey(searchKey);
return BeanUtil.toBean(sysUserService.userSelector(sysUserSelectorUserParam), Page.class);
}
@Override
public List<JSONObject> listUserWithoutCurrent() {
return sysUserService.list(new LambdaQueryWrapper<SysUser>()
.select(SysUser::getId, SysUser::getAccount, SysUser::getName, SysUser::getAvatar)
.ne(SysUser::getId, StpUtil.getLoginId()))
.stream().map(JSONUtil::parseObj).collect(Collectors.toList());
}
}