mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-15 19:45:06 +08:00
优化 AdminUserApi 的实现,和 Cloud 保持一致
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.system.api.user;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
|
||||
import java.util.Collection;
|
||||
@ -22,6 +23,14 @@ public interface AdminUserApi {
|
||||
*/
|
||||
AdminUserRespDTO getUser(Long id);
|
||||
|
||||
/**
|
||||
* 通过用户 ID 查询用户们
|
||||
*
|
||||
* @param ids 用户 ID 们
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
List<AdminUserRespDTO> getUsers(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得指定部门的用户数组
|
||||
*
|
||||
@ -44,7 +53,10 @@ public interface AdminUserApi {
|
||||
* @param ids 用户编号数组
|
||||
* @return 用户 Map
|
||||
*/
|
||||
Map<Long, AdminUserRespDTO> getUserMap(Collection<Long> ids);
|
||||
default Map<Long, AdminUserRespDTO> getUserMap(Collection<Long> ids) {
|
||||
List<AdminUserRespDTO> users = getUsers(ids);
|
||||
return CollectionUtils.convertMap(users, AdminUserRespDTO::getId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验用户们是否有效。如下情况,视为无效:
|
||||
|
Reference in New Issue
Block a user