package cd.casic.module.system.api.dept;

import cd.casic.framework.commons.util.object.BeanUtils;
import cd.casic.module.system.api.dept.dto.PostRespDTO;
import cd.casic.framework.commons.dataobject.dept.PostDO;
import cd.casic.framework.datapermission.service.dept.PostService;
import org.springframework.stereotype.Service;

import jakarta.annotation.Resource;
import java.util.Collection;
import java.util.List;

/**
 * 岗位 API 实现类
 *
 * @author mianbin modified from yudao
 */
@Service
public class PostApiImpl implements PostApi {

    @Resource
    private PostService postService;

    @Override
    public void validPostList(Collection<Long> ids) {
        postService.validatePostList(ids);
    }

    @Override
    public List<PostRespDTO> getPostList(Collection<Long> ids) {
        List<PostDO> list = postService.getPostList(ids);
        return BeanUtils.toBean(list, PostRespDTO.class);
    }

}
