package cn.estsh.i3plus.core.apiservice.configuration;

import cn.estsh.i3plus.platform.common.util.CommonConstWords;
import cn.estsh.i3plus.pojo.base.jpa.factory.BaseMongoRepositoryFactoryBean;
import cn.estsh.i3plus.pojo.base.jpa.factory.BaseRepositoryFactoryBean;
import cn.estsh.i3plus.pojo.platform.platbean.SysLogException;
import cn.estsh.i3plus.pojo.platform.platbean.SysLogOperate;
import cn.estsh.i3plus.pojo.platform.platbean.SysLogSystem;
import cn.estsh.i3plus.pojo.platform.platrepositorymongo.SysLogExceptionRepository;
import cn.estsh.i3plus.pojo.platform.platrepositorymongo.SysLogOperateRepository;
import cn.estsh.i3plus.pojo.platform.platrepositorymongo.SysLogSystemRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;

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

//需要单独处理的其他模块包
@EnableJpaRepositories(basePackages = {
        "cn.estsh.i3plus.**.platrepository"
}, repositoryFactoryBeanClass = BaseRepositoryFactoryBean.class)

//扫描需要单独处理的持久化包
@EnableMongoRepositories(basePackages = {
        "cn.estsh.i3plus.**.platrepositorymongo"
},repositoryFactoryBeanClass = BaseMongoRepositoryFactoryBean.class)
public class ScanPackageConfiguration {
    public static final Logger LOGGER = LoggerFactory.getLogger(CommonConstWords.SYSTEM_LOG);

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