用户数据同步

master
wj 2 years ago
parent 21c2df58bd
commit 1096001a22

@ -1,5 +1,9 @@
package com.glxp.sale.admin.config;
import com.baomidou.mybatisplus.core.MybatisConfiguration;
import com.baomidou.mybatisplus.core.config.GlobalConfig;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.BlockAttackInnerInterceptor;
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
@ -36,14 +40,36 @@ public class MasterDataSourceConfig {//TODO Mapper
return new DataSourceTransactionManager(masterDataSource());
}
@Configuration
@ConfigurationProperties(prefix = "mybatis-plus.configuration")
public class CusMybatisConfiguration extends MybatisConfiguration{
}
@Configuration
@ConfigurationProperties(prefix = "mybatis-plus.global-config")
public class CusGlobalConfig extends GlobalConfig {
}
@Bean(name = "masterSqlSessionFactory")
@Primary
public SqlSessionFactory masterSqlSessionFactory(@Qualifier("masterDataSource") DataSource masterDataSource)
public SqlSessionFactory masterSqlSessionFactory(@Qualifier("masterDataSource") DataSource masterDataSource, CusMybatisConfiguration configuration, CusGlobalConfig globalConfig)
throws Exception {
final MybatisSqlSessionFactoryBean sessionFactory = new MybatisSqlSessionFactoryBean();
sessionFactory.setDataSource(masterDataSource);
sessionFactory.setConfiguration((MybatisConfiguration) configuration);
sessionFactory.setGlobalConfig(globalConfig);
sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver()
.getResources(MasterDataSourceConfig.MAPPER_LOCATION));
return sessionFactory.getObject();
}
/**
*
*/
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new BlockAttackInnerInterceptor());
return interceptor;
}
}

@ -26,6 +26,11 @@ public enum BasicExportTypeEnum {
*
*/
OTHER_DATA("other_data", "其他数据"),
/**
*
*/
USER_DATA("user_data", "用户数据"),
;
private String key;

Loading…
Cancel
Save