mirror of https://gitee.com/xiaonuobase/snowy
【新增】增加获取用户列表(排除当前用户)接口
parent
d1e6fd8575
commit
93111a8490
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue