package cn.estsh.i3plus.ext.mes.pcn.apiservice.config;

import cn.estsh.i3plus.platform.common.util.CommonConstWords;
import cn.estsh.i3plus.pojo.base.jpa.factory.BaseRepositoryFactoryBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

/**
 * @Description : 需要扫描其他包的配置文件
 * 此类专门添加需要单独加载的其他模块的包
 * @Reference :
 * @Author : alwaysfrin
 * @CreateDate : 2018-12-12 20:49
 * @Modify:
 **/
@Configuration
//扫描需要单独处理的包
@EntityScan(basePackages = {
        "cn.estsh.i3plus.**.platbean",
        "${impp.app.ext.pojo-packages:}.**"
})

//需要单独处理的其他模块包
@EnableJpaRepositories(basePackages = {
        "cn.estsh.i3plus.**.platrepository",
        "${impp.app.ext.pojo-dao:}.**",
        "${impp.app.ext.pojo-repository:}.**"
}, repositoryFactoryBeanClass = BaseRepositoryFactoryBean.class)

@ComponentScan(basePackages = {
        // 扩展包
        "${impp.app.ext.base-packages:}.**"
})
//cn.estsh.i3plus.app.ext
public class ScanExtPackageConfiguration {
    public static final Logger LOGGER = LoggerFactory.getLogger(CommonConstWords.SYSTEM_LOG);

    public ScanExtPackageConfiguration() {
        LOGGER.info("【扫描插件关联包...】");
    }
}
