package cn.lihu.jh.module.system.api.dept;
|
|
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.map.MapUtil;
|
import cn.lihu.jh.framework.common.util.collection.CollectionUtils;
|
import cn.lihu.jh.module.system.api.dept.dto.PostRespDTO;
|
|
import java.util.Collection;
|
import java.util.List;
|
import java.util.Map;
|
|
/**
|
* 岗位 API 接口
|
*
|
* @author 芋道源码
|
*/
|
public interface PostApi {
|
|
/**
|
* 校验岗位们是否有效。如下情况,视为无效:
|
* 1. 岗位编号不存在
|
* 2. 岗位被禁用
|
*
|
* @param ids 岗位编号数组
|
*/
|
void validPostList(Collection<Long> ids);
|
|
List<PostRespDTO> getPostList(Collection<Long> ids);
|
|
default Map<Long, PostRespDTO> getPostMap(Collection<Long> ids) {
|
if (CollUtil.isEmpty(ids)) {
|
return MapUtil.empty();
|
}
|
|
List<PostRespDTO> list = getPostList(ids);
|
return CollectionUtils.convertMap(list, PostRespDTO::getId);
|
}
|
|
}
|