package cn.lihu.jh.module.system.api.dept; import cn.lihu.jh.framework.common.enums.CommonStatusEnum; import cn.lihu.jh.framework.common.util.object.BeanUtils; import cn.lihu.jh.module.system.api.dept.dto.DeptRespDTO; import cn.lihu.jh.module.system.dal.dataobject.dept.DeptDO; import cn.lihu.jh.module.system.service.dept.DeptService; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.Collection; import java.util.List; import static cn.lihu.jh.framework.common.pojo.CommonResult.success; /** * 部门 API 实现类 * * @author 芋道源码 */ @Service public class DeptApiImpl implements DeptApi { @Resource private DeptService deptService; @Override public DeptRespDTO getDept(Long id) { DeptDO dept = deptService.getDept(id); return BeanUtils.toBean(dept, DeptRespDTO.class); } @Override public List getDeptList(Collection ids) { List depts = deptService.getDeptList(ids); return BeanUtils.toBean(depts, DeptRespDTO.class); } @Override public void validateDeptList(Collection ids) { deptService.validateDeptList(ids); } @Override public List getChildDeptList(Long id) { List childDeptList = deptService.getChildDeptList(id); return BeanUtils.toBean(childDeptList, DeptRespDTO.class); } @Override public List getSimpleDeptList() { List depts = deptService.getSimpleDeptList(); return BeanUtils.toBean(depts, DeptRespDTO.class); } }