All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.rexsheng.springboot.faster.system.auth.domain.DeptDomainService Maven / Gradle / Ivy

The newest version!
package com.github.rexsheng.springboot.faster.system.auth.domain;

import com.github.rexsheng.springboot.faster.system.dept.application.DeptService;
import jakarta.annotation.Resource;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

@Service("authDept")
@ConditionalOnClass(SqlSessionFactoryBean.class)
public class DeptDomainService {

    @Resource
    private DeptService deptService;

    public List queryDeptAndChildrenIds(Integer deptId){
        if(deptId==null){
            return new ArrayList<>();
        }
        return deptService.queryWithChildren(deptId).stream().map(a->a.getDeptId()).collect(Collectors.toList());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy