Commit aa2e1889 by 李秋伟

Merge branch 'feature_protocol' into 'master'

Feature protocol

See merge request mall/arch/matrix!33
parents 947c8673 39723345
......@@ -5,7 +5,7 @@
<parent>
<artifactId>matrix</artifactId>
<groupId>com.secoo.mall</groupId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>matrix</artifactId>
<groupId>com.secoo.mall</groupId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>matrix</artifactId>
<groupId>com.secoo.mall</groupId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>matrix</artifactId>
<groupId>com.secoo.mall</groupId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>matrix</artifactId>
<groupId>com.secoo.mall</groupId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>matrix-datasource</artifactId>
<groupId>com.secoo.mall</groupId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......@@ -26,7 +26,7 @@
</dependency>
<dependency>
<groupId>com.secoo.mall</groupId>
<artifactId>app-security-algo</artifactId>
<artifactId>app-security-api</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
......
......@@ -9,6 +9,7 @@ import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.jdbc.datasource.AbstractDataSource;
import javax.annotation.Resource;
import javax.sql.DataSource;
import java.lang.reflect.Method;
import java.sql.Connection;
......@@ -24,14 +25,9 @@ public abstract class AbsDataSource extends AbstractDataSource implements Initia
private Map<String, DataSource> dataSourceMap = new HashMap<>();
private static Lock lock = new ReentrantLock();
public AbsDataSource(DataSourceProvider dataSourceProvider) {
this.dataSourceProvider = dataSourceProvider;
}
@Resource
private DataSourceProvider dataSourceProvider;
@Override
public Connection getConnection() throws SQLException {
return getDataSource().getConnection();
......@@ -86,7 +82,6 @@ public abstract class AbsDataSource extends AbstractDataSource implements Initia
*/
@Override
public void afterPropertiesSet() throws Exception {
Map<String, DataSource> dataSourceMap = dataSourceProvider.loadDataSources();
for (Map.Entry<String, DataSource> dataSourceEntry : dataSourceMap.entrySet()) {
addDataSource(dataSourceEntry.getKey(), dataSourceEntry.getValue());
......
package com.secoo.mall.datasource.bean;
import com.secoo.mall.datasource.provider.DataSourceProvider;
import lombok.extern.slf4j.Slf4j;
import javax.sql.DataSource;
......@@ -14,13 +13,7 @@ public class MatrixDataSource extends AbsDataSource {
private String dsName;
public MatrixDataSource(DataSourceProvider dataSourceProvider) {
super(dataSourceProvider);
}
public MatrixDataSource(String dsName, DataSourceProvider dataSourceProvider) {
super(dataSourceProvider);
public MatrixDataSource(String dsName) {
this.dsName = dsName;
}
......
package com.secoo.mall.datasource.bean;
import com.secoo.mall.datasource.holder.DataSourceContextHolder;
import com.secoo.mall.datasource.provider.DataSourceProvider;
import lombok.extern.slf4j.Slf4j;
import javax.sql.DataSource;
......@@ -12,11 +11,6 @@ import javax.sql.DataSource;
@Slf4j
public class MatrixDynamicDataSource extends AbsDataSource {
public MatrixDynamicDataSource(DataSourceProvider dataSourceProvider) {
super(dataSourceProvider);
}
@Override
/**
* 获取数据源有两种途径:
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>matrix-datasource</artifactId>
<groupId>com.secoo.mall</groupId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -5,29 +5,24 @@ import com.secoo.mall.datasource.properties.MatrixDruidDataSourceProperties;
import lombok.extern.slf4j.Slf4j;
import java.sql.SQLException;
import java.util.Properties;
@Slf4j
public class DruidDataSourceFactory extends AbsDataSourceFactory<DruidDataSource, MatrixDruidDataSourceProperties> {
private final String duridPreFix = "druid.";
private final String FREFIX = "druid.";
@Override
protected DruidDataSource convertAndCreate(MatrixDruidDataSourceProperties config) {
Properties properties = new Properties();
properties.setProperty(duridPreFix + "name", config.getName());
properties.setProperty(duridPreFix + "url", config.getUrl());
properties.setProperty(duridPreFix + "username", config.getUsername());
properties.setProperty(duridPreFix + "password", config.getPassword());
//连接相关信息
properties.setProperty(duridPreFix + "minIdle", String.valueOf(config.getMinimumIdle()));
properties.setProperty(duridPreFix + "maxActive", String.valueOf(config.getMaximumPoolSize()));
properties.setProperty(duridPreFix + "phyTimeoutMillis", String.valueOf(config.getConnectionTimeout()));
properties.setProperty(duridPreFix + "timeBetweenEvictionRunsMillis", String.valueOf(config.getIdleTimeout()));
properties.setProperty(duridPreFix + "maxEvictableIdleTimeMillis", String.valueOf(config.getMaxLifetime()));
DruidDataSource dataSource = new DruidDataSource();
dataSource.configFromPropety(properties);
dataSource.setName(config.getName());
dataSource.setUrl(config.getUrl());
dataSource.setUsername(config.getUsername());
dataSource.setPassword(config.getPassword());
dataSource.setMinIdle(config.getMinimumIdle());
dataSource.setMaxActive(config.getMaximumPoolSize());
dataSource.setPhyTimeoutMillis(config.getConnectionTimeout());
dataSource.setTimeBetweenEvictionRunsMillis(config.getIdleTimeout());
dataSource.setMaxEvictableIdleTimeMillis(config.getMaxLifetime());
try {
dataSource.init();
} catch (SQLException e) {
......
package PACKAGE_NAME;
public class TestDuridInit {
}
......@@ -5,7 +5,7 @@
<parent>
<artifactId>matrix</artifactId>
<groupId>com.secoo.mall</groupId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......@@ -21,7 +21,7 @@
<dependency>
<groupId>com.secoo.mall</groupId>
<artifactId>matrix-datasource-core</artifactId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
......@@ -30,7 +30,7 @@
</dependency>
<dependency>
<groupId>com.secoo.mall</groupId>
<artifactId>app-security-algo</artifactId>
<artifactId>app-security-api</artifactId>
<version>1.0.4.RELEASE</version>
</dependency>
<dependency>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>matrix-mybatis</artifactId>
<groupId>com.secoo.mall</groupId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
package com.secoo.mall.mybatis.bean;
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
import com.secoo.mall.common.util.string.StringUtil;
import com.secoo.mall.mybatis.config.MatrixMybatisConfig;
import com.secoo.mall.mybatis.config.MatrixMybatisGlobalConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import java.io.IOException;
@Slf4j
public class MatrixMybatisSqlSessionFactoryBean extends MybatisSqlSessionFactoryBean {
public MatrixMybatisSqlSessionFactoryBean() {
}
public MatrixMybatisSqlSessionFactoryBean(MatrixMybatisConfig matrixMybatisConfig, MatrixMybatisGlobalConfig matrixMybatisGlobalConfig) {
this.setConfiguration(matrixMybatisConfig);
this.setGlobalConfig(matrixMybatisGlobalConfig);
this.setTypeAliasesPackage(matrixMybatisConfig.getBeanAliasPackages());
String resourceClassPath = matrixMybatisConfig.getResourceClassPath();
/**
* 存在此配置
*/
if (StringUtil.isNotEmpty(resourceClassPath)) {
/**
* 仅仅判断根classpath是否存在
*/
String rootPath = resourceClassPath.split("/")[1];
ClassPathResource resource = new ClassPathResource(rootPath);
if (resource.exists()) {
try {
this.setMapperLocations(new PathMatchingResourcePatternResolver().getResources(resourceClassPath));
} catch (IOException e) {
log.error("load resourceClassPath error ", e);
}
}
public MatrixMybatisSqlSessionFactoryBean() {
}
}
}
......@@ -2,24 +2,15 @@ package com.secoo.mall.mybatis.config;
import com.baomidou.mybatisplus.core.MybatisConfiguration;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.baomidou.mybatisplus.extension.toolkit.PackageHelper;
import com.secoo.mall.common.constant.CommonConstant;
import com.secoo.mall.common.util.string.StringUtil;
import com.secoo.mall.common.util.sys.SystemUtil;
import com.secoo.mall.mybatis.interceptor.MatrixPerformanceInterceptor;
import lombok.Data;
import org.apache.ibatis.type.JdbcType;
@Data
public class MatrixMybatisConfig extends MybatisConfiguration {
private static final String DEFAULT_BEAN_ALIAS_PACKAGES = StringUtil.join(PackageHelper.convertTypeAliasesPackage("com.secoo.mall.**.bean.domain"), ",");
private static final String DEFAULT_RESOURCE_CLASSPATH = "/mybatis/*.xml";
private String beanAliasPackages = DEFAULT_BEAN_ALIAS_PACKAGES;
private String resourceClassPath = DEFAULT_RESOURCE_CLASSPATH;
public MatrixMybatisConfig() {
public class MatrixMybatisConfiguration extends MybatisConfiguration {
public MatrixMybatisConfiguration() {
if (!SystemUtil.ENV.equals(CommonConstant.Env.PRO)) {
this.addInterceptor(new MatrixPerformanceInterceptor());
}
......@@ -29,14 +20,6 @@ public class MatrixMybatisConfig extends MybatisConfiguration {
this.setMapUnderscoreToCamelCase(true);
//分页插件
this.addInterceptor(new PaginationInterceptor());
this.setBeanAliasPackages(beanAliasPackages);
this.setResourceClassPath(resourceClassPath);
}
public MatrixMybatisConfig(String beanAliasPackages, String resourceClassPath) {
this.setBeanAliasPackages(beanAliasPackages);
this.setResourceClassPath(resourceClassPath);
}
}
......@@ -17,7 +17,7 @@ public class MatrixMybatisGlobalConfig extends GlobalConfig {
*/
public MatrixMybatisGlobalConfig() {
this.setMetaObjectHandler(getFillDefaultValueHandler());
this.setDbConfig(getDbConfig());
this.setDbConfig(getDefaultDbConfig());
}
public DbConfig getDefaultDbConfig() {
......
package com.secoo.mall.mybatis.properties;
import com.baomidou.mybatisplus.extension.toolkit.PackageHelper;
import com.secoo.mall.common.util.string.StringUtil;
import com.secoo.mall.mybatis.config.MatrixMybatisConfiguration;
import com.secoo.mall.mybatis.config.MatrixMybatisGlobalConfig;
import org.apache.ibatis.session.ExecutorType;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.io.support.ResourcePatternResolver;
import java.io.IOException;
import java.util.Optional;
import java.util.Properties;
import java.util.stream.Stream;
public class MatrixMybatisProperties {
public static final String DEFAULT_ALIAS_PACKAGES = StringUtil.join(PackageHelper.convertTypeAliasesPackage("com.secoo.mall.**.bean.domain"), ",");
public static final String[] DEFAULT_MAPPER_LOCATIONS = new String[]{"/mybatis/*.xml"};
private static final ResourcePatternResolver RESOLVER = new PathMatchingResourcePatternResolver();
/**
* Location of MyBatis xml config file.
*/
private String configLocation;
/**
* Locations of MyBatis mapper files.
*/
private String[] mapperLocations;
/**
* Packages to search type aliases. (Package delimiters are ",; \t\n")
*/
private String typeAliasesPackage;
/**
* The super class for filtering type alias.
* If this not specifies, the MyBatis deal as type alias all classes that searched from typeAliasesPackage.
*/
private Class<?> typeAliasesSuperType;
/**
* Packages to search for type handlers. (Package delimiters are ",; \t\n")
*/
private String typeHandlersPackage;
/**
* 枚举包扫描
*/
private String typeEnumsPackage;
/**
* Indicates whether perform presence check of the MyBatis xml config file.
*/
private boolean checkConfigLocation = false;
/**
* Execution mode for {@link org.mybatis.spring.SqlSessionTemplate}.
*/
private ExecutorType executorType;
/**
* Externalized properties for MyBatis configuration.
*/
private Properties configurationProperties;
/**
* A Configuration object for customize default settings. If {@link #configLocation}
* is specified, this property is not used.
*/
private MatrixMybatisConfiguration configuration;
/**
* 全局配置
*/
private MatrixMybatisGlobalConfig globalConfig;
/**
* @since 1.1.0
*/
public String getConfigLocation() {
return this.configLocation;
}
/**
* @since 1.1.0
*/
public void setConfigLocation(String configLocation) {
this.configLocation = configLocation;
}
public String[] getMapperLocations() {
return this.mapperLocations;
}
public void setMapperLocations(String[] mapperLocations) {
this.mapperLocations = mapperLocations;
}
public String getTypeHandlersPackage() {
return this.typeHandlersPackage;
}
public void setTypeHandlersPackage(String typeHandlersPackage) {
this.typeHandlersPackage = typeHandlersPackage;
}
public String getTypeEnumsPackage() {
return typeEnumsPackage;
}
public void setTypeEnumsPackage(String typeEnumsPackage) {
this.typeEnumsPackage = typeEnumsPackage;
}
public String getTypeAliasesPackage() {
return this.typeAliasesPackage;
}
public void setTypeAliasesPackage(String typeAliasesPackage) {
this.typeAliasesPackage = typeAliasesPackage;
}
public Class<?> getTypeAliasesSuperType() {
return typeAliasesSuperType;
}
public void setTypeAliasesSuperType(Class<?> typeAliasesSuperType) {
this.typeAliasesSuperType = typeAliasesSuperType;
}
public boolean isCheckConfigLocation() {
return this.checkConfigLocation;
}
public void setCheckConfigLocation(boolean checkConfigLocation) {
this.checkConfigLocation = checkConfigLocation;
}
public ExecutorType getExecutorType() {
return this.executorType;
}
public void setExecutorType(ExecutorType executorType) {
this.executorType = executorType;
}
public Properties getConfigurationProperties() {
return configurationProperties;
}
public void setConfigurationProperties(Properties configurationProperties) {
this.configurationProperties = configurationProperties;
}
public MatrixMybatisConfiguration getConfiguration() {
return configuration;
}
public void setConfiguration(MatrixMybatisConfiguration configuration) {
this.configuration = configuration;
}
public MatrixMybatisGlobalConfig getGlobalConfig() {
return globalConfig;
}
public void setGlobalConfig(MatrixMybatisGlobalConfig globalConfig) {
this.globalConfig = globalConfig;
}
public Resource[] resolveMapperLocations() {
return Stream.of(Optional.ofNullable(this.mapperLocations).orElse(new String[0]))
.flatMap(location -> Stream.of(getResources(location)))
.toArray(Resource[]::new);
}
private Resource[] getResources(String location) {
try {
return RESOLVER.getResources(location);
} catch (IOException e) {
return new Resource[0];
}
}
}
......@@ -5,7 +5,7 @@
<parent>
<artifactId>matrix-mybatis</artifactId>
<groupId>com.secoo.mall</groupId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
package com.secoo.mall.mybatis.spring.boot.autoconfigure;
import com.secoo.mall.datasource.properties.MatrixDataSourceProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = MatrixDataSourceBootProperties.PREFIX)
public class MatrixDataSourceBootProperties extends MatrixDataSourceProperties {
public static final String PREFIX = MatrixDataSourceProperties.PREFIX + ".default";
}
package com.secoo.mall.mybatis.spring.boot.autoconfigure;
import com.secoo.mall.datasource.properties.MatrixDataSourceProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = MatrixDefaultDataSourceProperties.PREFIX)
public class MatrixDefaultDataSourceProperties extends MatrixDataSourceProperties {
public static final String PREFIX = MatrixDataSourceProperties.PREFIX + ".default";
}
package com.secoo.mall.mybatis.spring.boot.autoconfigure;
import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration;
import com.baomidou.mybatisplus.core.MybatisConfiguration;
import com.ctrip.framework.apollo.spring.boot.ApolloAutoConfiguration;
import com.secoo.mall.datasource.bean.MatrixDataSource;
import com.secoo.mall.datasource.factory.DataSourceFactory;
......@@ -9,11 +10,13 @@ import com.secoo.mall.datasource.provider.ApolloDruidDataSourceProvider;
import com.secoo.mall.datasource.provider.DataSourceProvider;
import com.secoo.mall.datasource.util.SysUtil;
import com.secoo.mall.mybatis.bean.MatrixMybatisSqlSessionFactoryBean;
import com.secoo.mall.mybatis.config.MatrixMybatisConfig;
import com.secoo.mall.mybatis.config.MatrixMybatisConfiguration;
import com.secoo.mall.mybatis.config.MatrixMybatisGlobalConfig;
import com.secoo.mall.mybatis.properties.MatrixMybatisProperties;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
......@@ -23,18 +26,25 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import javax.sql.DataSource;
import java.util.Optional;
@Configuration
@EnableConfigurationProperties({MatrixMybatisBootProperties.class})
@ConditionalOnClass(MatrixDataSource.class)
@AutoConfigureBefore({DataSourceAutoConfiguration.class, MybatisPlusAutoConfiguration.class})
@AutoConfigureAfter(ApolloAutoConfiguration.class)
@EnableConfigurationProperties({MatrixDefaultDataSourceProperties.class})
@Slf4j
public class MatrixMybatisAutoConfiguration {
@Setter
private MatrixDefaultDataSourceProperties matrixDefaultDataSourceProperties;
private MatrixDataSourceBootProperties matrixDataSourceBootProperties;
@Autowired
private MatrixMybatisBootProperties properties;
public MatrixMybatisAutoConfiguration() {
log.info("Init MatrixDataSouceAutoConfiguration");
......@@ -59,7 +69,7 @@ public class MatrixMybatisAutoConfiguration {
@Bean
@ConditionalOnMissingBean(DataSource.class)
public DataSource dataSource(DataSourceProvider dataSourceProvider) {
return new MatrixDataSource("default", dataSourceProvider);
return new MatrixDataSource("default");
}
@Bean
......@@ -71,25 +81,52 @@ public class MatrixMybatisAutoConfiguration {
@Bean
@ConditionalOnMissingBean(SqlSessionFactory.class)
public SqlSessionFactory sqlSessionFactory(DataSource dataSource, MatrixMybatisConfig matrixMybatisConfig, MatrixMybatisGlobalConfig matrixMybatisGlobalConfig) throws Exception {
MatrixMybatisSqlSessionFactoryBean sqlSessionFactory = new MatrixMybatisSqlSessionFactoryBean(matrixMybatisConfig, matrixMybatisGlobalConfig);
sqlSessionFactory.setDataSource(dataSource);
return sqlSessionFactory.getObject();
public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception {
MybatisConfiguration mybatisConfiguration = Optional.ofNullable(properties.getConfiguration()).orElse(matrixMybatisConfig());
MatrixMybatisGlobalConfig globalConfig = Optional.ofNullable(properties.getGlobalConfig()).orElse(matrixMybatisGlobalConfig());
MatrixMybatisSqlSessionFactoryBean factory = new MatrixMybatisSqlSessionFactoryBean();
String aliasesPackage = Optional.ofNullable(this.properties.getTypeAliasesPackage()).orElse(MatrixMybatisProperties.DEFAULT_ALIAS_PACKAGES);
String[] mapperLocations = Optional.ofNullable(this.properties.getMapperLocations()).orElse(MatrixMybatisProperties.DEFAULT_MAPPER_LOCATIONS);
this.properties.setTypeAliasesPackage(aliasesPackage);
this.properties.setMapperLocations(mapperLocations);
if (this.properties.getConfigurationProperties() != null) {
factory.setConfigurationProperties(this.properties.getConfigurationProperties());
}
if (StringUtils.hasLength(this.properties.getTypeAliasesPackage())) {
factory.setTypeAliasesPackage(this.properties.getTypeAliasesPackage());
}
if (StringUtils.hasLength(this.properties.getTypeEnumsPackage())) {
factory.setTypeEnumsPackage(this.properties.getTypeEnumsPackage());
}
if (this.properties.getTypeAliasesSuperType() != null) {
factory.setTypeAliasesSuperType(this.properties.getTypeAliasesSuperType());
}
if (StringUtils.hasLength(this.properties.getTypeHandlersPackage())) {
factory.setTypeHandlersPackage(this.properties.getTypeHandlersPackage());
}
if (!ObjectUtils.isEmpty(this.properties.resolveMapperLocations())) {
factory.setMapperLocations(this.properties.resolveMapperLocations());
}
factory.setConfiguration(mybatisConfiguration);
factory.setGlobalConfig(globalConfig);
factory.setDataSource(dataSource);
return factory.getObject();
}
@Bean
@ConditionalOnMissingBean(MatrixMybatisGlobalConfig.class)
public MatrixMybatisGlobalConfig matrixMybatisGlobalConfig() {
MatrixMybatisGlobalConfig globalConfig = new MatrixMybatisGlobalConfig();
return globalConfig;
}
@Bean
@ConditionalOnMissingBean(MatrixMybatisConfig.class)
public MatrixMybatisConfig matrixMybatisConfig() {
MatrixMybatisConfig config = new MatrixMybatisConfig();
public MatrixMybatisConfiguration matrixMybatisConfig() {
MatrixMybatisConfiguration config = new MatrixMybatisConfiguration();
return config;
}
......
package com.secoo.mall.mybatis.spring.boot.autoconfigure;
import com.secoo.mall.mybatis.config.MatrixMybatisConfiguration;
import com.secoo.mall.mybatis.config.MatrixMybatisGlobalConfig;
import com.secoo.mall.mybatis.properties.MatrixMybatisProperties;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
@Data
@ConfigurationProperties(prefix = MatrixMybatisBootProperties.PREFIX)
public class MatrixMybatisBootProperties extends MatrixMybatisProperties {
public static final String PREFIX = "matrix.mybatis";
@NestedConfigurationProperty
private MatrixMybatisConfiguration configuration;
/**
* 全局配置
*/
@NestedConfigurationProperty
private MatrixMybatisGlobalConfig globalConfig;
}
......@@ -5,7 +5,7 @@
<parent>
<artifactId>matrix</artifactId>
<groupId>com.secoo.mall</groupId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......@@ -25,12 +25,17 @@
<dependency>
<groupId>com.secoo.mall</groupId>
<artifactId>matrix-mybatis-core</artifactId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>com.secoo.mall</groupId>
<artifactId>matrix-datasource-druid</artifactId>
<version>1.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>com.secoo.mall</groupId>
<artifactId>matrix-mybatis-starter</artifactId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
......@@ -43,11 +48,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.secoo.mall</groupId>
<artifactId>matrix-datasource-druid</artifactId>
<version>1.2.0.RELEASE</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>matrix</artifactId>
<groupId>com.secoo.mall</groupId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>matrix</artifactId>
<groupId>com.secoo.mall</groupId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>matrix</artifactId>
<groupId>com.secoo.mall</groupId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -6,7 +6,7 @@
<groupId>com.secoo.mall</groupId>
<artifactId>matrix</artifactId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
<packaging>pom</packaging>
......@@ -48,62 +48,62 @@
<dependency>
<groupId>com.secoo.mall</groupId>
<artifactId>logger-starter</artifactId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>com.secoo.mall</groupId>
<artifactId>monitor-starter</artifactId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>com.secoo.mall</groupId>
<artifactId>common-core</artifactId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>com.secoo.mall</groupId>
<artifactId>config-starter</artifactId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>com.secoo.mall</groupId>
<artifactId>common-util</artifactId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>com.secoo.mall</groupId>
<artifactId>redis-starter</artifactId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>com.secoo.mall</groupId>
<artifactId>matrix-mybatis-starter</artifactId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>com.secoo.mall</groupId>
<artifactId>mongodb-starter</artifactId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>com.secoo.mall</groupId>
<artifactId>elasticsearch-starter</artifactId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>com.secoo.mall</groupId>
<artifactId>protocol-starter</artifactId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>com.secoo.mall</groupId>
<artifactId>rocketmq-starter</artifactId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>com.secoo.mall</groupId>
<artifactId>openfeign-starter</artifactId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</dependency>
<dependency>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>matrix</artifactId>
<groupId>com.secoo.mall</groupId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>matrix</artifactId>
<groupId>com.secoo.mall</groupId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>matrix</artifactId>
<groupId>com.secoo.mall</groupId>
<version>1.2.0.RELEASE</version>
<version>1.2.1.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment