Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
matrix
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
mall
arch
matrix
Commits
05d6a4c9
Commit
05d6a4c9
authored
Dec 09, 2019
by
李秋伟
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix_datasource' into 'master'
Fix datasource See merge request mall/arch/matrix!30
parents
bac5a040
0f1a81d8
Hide whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
165 additions
and
217 deletions
+165
-217
pom.xml
common-core/pom.xml
+1
-1
pom.xml
common-util/pom.xml
+1
-1
pom.xml
config-starter/pom.xml
+1
-1
pom.xml
elasticsearch-starter/pom.xml
+1
-1
pom.xml
logger-starter/pom.xml
+1
-1
pom.xml
matrix-datasource/matrix-datasource-core/pom.xml
+1
-16
MatrixDataSource.java
matrix-datasource/matrix-datasource-core/src/main/java/com/secoo/mall/datasource/bean/MatrixDataSource.java
+5
-3
MatrixDataSourceConfig.java
matrix-datasource/matrix-datasource-core/src/main/java/com/secoo/mall/datasource/config/MatrixDataSourceConfig.java
+1
-0
DataSourceConstant.java
matrix-datasource/matrix-datasource-core/src/main/java/com/secoo/mall/datasource/constant/DataSourceConstant.java
+1
-1
DataSourceTypeEnum.java
matrix-datasource/matrix-datasource-core/src/main/java/com/secoo/mall/datasource/constant/DataSourceTypeEnum.java
+0
-36
DataSourceError.java
matrix-datasource/matrix-datasource-core/src/main/java/com/secoo/mall/datasource/errorcode/DataSourceError.java
+2
-1
AbsDataSourceFactory.java
matrix-datasource/matrix-datasource-core/src/main/java/com/secoo/mall/datasource/factory/AbsDataSourceFactory.java
+3
-4
DataSourceFactory.java
matrix-datasource/matrix-datasource-core/src/main/java/com/secoo/mall/datasource/factory/DataSourceFactory.java
+2
-2
HikariDataSourceFactory.java
matrix-datasource/matrix-datasource-core/src/main/java/com/secoo/mall/datasource/factory/HikariDataSourceFactory.java
+0
-26
MatrixDataSourceProperties.java
matrix-datasource/matrix-datasource-core/src/main/java/com/secoo/mall/datasource/properties/MatrixDataSourceProperties.java
+1
-13
AbsDataSourceProvider.java
matrix-datasource/matrix-datasource-core/src/main/java/com/secoo/mall/datasource/provider/AbsDataSourceProvider.java
+19
-4
ApolloDataSourceProvider.java
matrix-datasource/matrix-datasource-core/src/main/java/com/secoo/mall/datasource/provider/ApolloDataSourceProvider.java
+10
-5
DataSourceTest.java
matrix-datasource/matrix-datasource-core/src/test/java/com/secoo/mall/mybatis/datasouce/DataSourceTest.java
+0
-21
application.yml
matrix-datasource/matrix-datasource-core/src/test/resources/application.yml
+0
-2
pom.xml
matrix-datasource/matrix-datasource-druid/pom.xml
+26
-0
DruidDataSourceFactory.java
matrix-datasource/matrix-datasource-druid/src/main/java/com/secoo/mall/datasource/factory/DruidDataSourceFactory.java
+14
-2
MatrixDruidDataSourceProperties.java
matrix-datasource/matrix-datasource-druid/src/main/java/com/secoo/mall/datasource/properties/MatrixDruidDataSourceProperties.java
+11
-0
ApolloDruidDataSourceProvider.java
matrix-datasource/matrix-datasource-druid/src/main/java/com/secoo/mall/datasource/provider/ApolloDruidDataSourceProvider.java
+7
-0
pom.xml
matrix-datasource/pom.xml
+6
-14
pom.xml
matrix-mybatis/matrix-mybatis-core/pom.xml
+2
-2
pom.xml
matrix-mybatis/matrix-mybatis-starter/pom.xml
+1
-1
MatrixMybatisConfiguration.java
matrix-mybatis/matrix-mybatis-starter/src/main/java/com/secoo/mall/mybatis/config/MatrixMybatisConfiguration.java
+0
-26
MatrixMybatisAutoConfiguration.java
matrix-mybatis/matrix-mybatis-starter/src/main/java/com/secoo/mall/mybatis/spring/boot/autoconfigure/MatrixMybatisAutoConfiguration.java
+17
-8
pom.xml
matrix-mybatis/pom.xml
+11
-5
pom.xml
mongodb-starter/pom.xml
+1
-1
pom.xml
monitor-starter/pom.xml
+1
-1
pom.xml
openfeign-starter/pom.xml
+1
-1
pom.xml
pom.xml
+14
-14
pom.xml
protocol-starter/pom.xml
+1
-1
pom.xml
redis-starter/pom.xml
+1
-1
pom.xml
rocketmq-starter/pom.xml
+1
-1
No files found.
common-core/pom.xml
View file @
05d6a4c9
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
common-util/pom.xml
View file @
05d6a4c9
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
config-starter/pom.xml
View file @
05d6a4c9
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
elasticsearch-starter/pom.xml
View file @
05d6a4c9
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
logger-starter/pom.xml
View file @
05d6a4c9
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-datasource/matrix-datasource-core/pom.xml
View file @
05d6a4c9
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix-datasource
</artifactId>
<artifactId>
matrix-datasource
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
@@ -28,15 +28,6 @@
...
@@ -28,15 +28,6 @@
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
app-security-algo
</artifactId>
<artifactId>
app-security-algo
</artifactId>
</dependency>
</dependency>
<!--所依赖的数据源-->
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
druid
</artifactId>
</dependency>
<dependency>
<groupId>
com.zaxxer
</groupId>
<artifactId>
HikariCP
</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>
mysql
</groupId>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<artifactId>
mysql-connector-java
</artifactId>
...
@@ -57,11 +48,6 @@
...
@@ -57,11 +48,6 @@
<groupId>
org.projectlombok
</groupId>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<artifactId>
lombok
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
</dependencies>
</project>
</project>
\ No newline at end of file
matrix-datasource/matrix-datasource-core/src/main/java/com/secoo/mall/datasource/bean/MatrixDataSource.java
View file @
05d6a4c9
package
com
.
secoo
.
mall
.
datasource
.
bean
;
package
com
.
secoo
.
mall
.
datasource
.
bean
;
import
com.secoo.mall.datasource.config.MatrixDataSourceConfig
;
import
com.secoo.mall.datasource.config.MatrixDataSourceConfig
;
import
com.secoo.mall.datasource.constant.DataSourceTypeEnum
;
import
com.secoo.mall.datasource.factory.DataSourceFactory
;
import
lombok.Setter
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.reflect.MethodUtils
;
import
org.apache.commons.lang3.reflect.MethodUtils
;
import
javax.annotation.Resource
;
import
javax.sql.DataSource
;
import
javax.sql.DataSource
;
import
java.io.Closeable
;
import
java.io.Closeable
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -23,8 +25,8 @@ public class MatrixDataSource implements DataSource, Closeable {
...
@@ -23,8 +25,8 @@ public class MatrixDataSource implements DataSource, Closeable {
}
}
public
MatrixDataSource
(
DataSource
TypeEnum
dataSourceTypeEnum
,
MatrixDataSourceConfig
config
)
{
public
MatrixDataSource
(
DataSource
Factory
dataSourceFactory
,
MatrixDataSourceConfig
config
)
{
dataSource
=
dataSource
TypeEnum
.
getDataSourceFactory
()
.
createDataSouce
(
config
);
dataSource
=
dataSource
Factory
.
createDataSouce
(
config
);
}
}
...
...
matrix-datasource/matrix-datasource-core/src/main/java/com/secoo/mall/datasource/config/MatrixDataSourceConfig.java
View file @
05d6a4c9
package
com
.
secoo
.
mall
.
datasource
.
config
;
package
com
.
secoo
.
mall
.
datasource
.
config
;
import
com.secoo.mall.datasource.factory.DataSourceFactory
;
import
lombok.Data
;
import
lombok.Data
;
@Data
@Data
...
...
matrix-datasource/matrix-datasource-core/src/main/java/com/secoo/mall/datasource/constant/DataSourceConstant.java
View file @
05d6a4c9
...
@@ -6,7 +6,7 @@ public interface DataSourceConstant {
...
@@ -6,7 +6,7 @@ public interface DataSourceConstant {
/**
/**
* 解密服务
* 解密服务
*/
*/
String
APP_SECURITY_SERVER_HOST
=
"http://
localhost:9080
"
;
String
APP_SECURITY_SERVER_HOST
=
"http://
app-security.secoolocal.com
"
;
/**
/**
* 解密文件
* 解密文件
*/
*/
...
...
matrix-datasource/matrix-datasource-core/src/main/java/com/secoo/mall/datasource/constant/DataSourceTypeEnum.java
deleted
100644 → 0
View file @
bac5a040
package
com
.
secoo
.
mall
.
datasource
.
constant
;
import
com.secoo.mall.datasource.factory.DataSourceFactory
;
import
com.secoo.mall.datasource.factory.DruidDataSourceFactory
;
import
com.secoo.mall.datasource.factory.HikariDataSourceFactory
;
public
enum
DataSourceTypeEnum
{
DRUID
(
"druid"
,
new
DruidDataSourceFactory
()),
HIKARI
(
"hikari"
,
new
HikariDataSourceFactory
());
private
String
name
;
private
DataSourceFactory
dataSourceFactory
;
DataSourceTypeEnum
(
String
name
,
DataSourceFactory
dataSourceFactory
)
{
this
.
name
=
name
;
this
.
dataSourceFactory
=
dataSourceFactory
;
}
public
String
getName
()
{
return
name
;
}
public
DataSourceFactory
getDataSourceFactory
()
{
return
dataSourceFactory
;
}
public
static
DataSourceTypeEnum
getByName
(
String
name
)
{
for
(
DataSourceTypeEnum
typeEnum
:
DataSourceTypeEnum
.
values
())
{
if
(
typeEnum
.
getName
().
equals
(
name
))
{
return
typeEnum
;
}
}
return
null
;
}
}
matrix-datasource/matrix-datasource-core/src/main/java/com/secoo/mall/datasource/errorcode/DataSourceError.java
View file @
05d6a4c9
...
@@ -4,7 +4,8 @@ import com.secoo.mall.common.core.errorcode.ErrorCode;
...
@@ -4,7 +4,8 @@ import com.secoo.mall.common.core.errorcode.ErrorCode;
public
interface
DataSourceError
{
public
interface
DataSourceError
{
ErrorCode
APOLLO_CONFIG_NOT_EXIST
=
new
ErrorCode
(
1
,
"appollo config not exits"
);
ErrorCode
APOLLO_CONFIG_NOT_EXIST
=
new
ErrorCode
(
1
,
"appollo config not exits"
);
ErrorCode
PRIVATE_KEY_NOT_EXIST
=
new
ErrorCode
(
2
,
"http get privatekey fail
"
);
ErrorCode
SOUCE_FACTORY_NOT_EXIST
=
new
ErrorCode
(
2
,
"data source factory bean not config
"
);
ErrorCode
APP_ID_NOT_EXIST
=
new
ErrorCode
(
3
,
"please config -Dappp.id"
);
ErrorCode
APP_ID_NOT_EXIST
=
new
ErrorCode
(
3
,
"please config -Dappp.id"
);
ErrorCode
DATA_SOURCE_NOT_EXIST
=
new
ErrorCode
(
4
,
"could not find a datasource named %s"
);
ErrorCode
DATA_SOURCE_NOT_EXIST
=
new
ErrorCode
(
4
,
"could not find a datasource named %s"
);
}
}
matrix-datasource/matrix-datasource-core/src/main/java/com/secoo/mall/datasource/factory/AbsDataSourceFactory.java
View file @
05d6a4c9
...
@@ -4,16 +4,15 @@ import com.secoo.mall.datasource.config.MatrixDataSourceConfig;
...
@@ -4,16 +4,15 @@ import com.secoo.mall.datasource.config.MatrixDataSourceConfig;
import
javax.sql.DataSource
;
import
javax.sql.DataSource
;
public
abstract
class
AbsDataSourceFactory
<
T
>
implements
DataSourceFactory
<
T
>
{
public
abstract
class
AbsDataSourceFactory
<
T
extends
DataSource
,
CONFIG
extends
MatrixDataSourceConfig
>
implements
DataSourceFactory
<
T
,
CONFIG
>
{
@Override
public
T
createDataSouce
(
CONFIG
config
)
{
public
<
T
extends
DataSource
>
T
createDataSouce
(
MatrixDataSourceConfig
config
)
{
return
convertAndCreate
(
config
);
return
convertAndCreate
(
config
);
}
}
protected
abstract
<
T
extends
DataSource
>
T
convertAndCreate
(
MatrixDataSourceConfig
config
);
protected
abstract
<
T
extends
DataSource
>
T
convertAndCreate
(
CONFIG
config
);
}
}
...
...
matrix-datasource/matrix-datasource-core/src/main/java/com/secoo/mall/datasource/factory/DataSourceFactory.java
View file @
05d6a4c9
...
@@ -4,8 +4,8 @@ import com.secoo.mall.datasource.config.MatrixDataSourceConfig;
...
@@ -4,8 +4,8 @@ import com.secoo.mall.datasource.config.MatrixDataSourceConfig;
import
javax.sql.DataSource
;
import
javax.sql.DataSource
;
public
interface
DataSourceFactory
<
T
>
{
public
interface
DataSourceFactory
<
T
extends
DataSource
,
CONFIG
extends
MatrixDataSourceConfig
>
{
<
T
extends
DataSource
>
T
createDataSouce
(
MatrixDataSourceConfig
config
);
T
createDataSouce
(
CONFIG
config
);
}
}
matrix-datasource/matrix-datasource-core/src/main/java/com/secoo/mall/datasource/factory/HikariDataSourceFactory.java
deleted
100644 → 0
View file @
bac5a040
package
com
.
secoo
.
mall
.
datasource
.
factory
;
import
com.secoo.mall.datasource.config.MatrixDataSourceConfig
;
import
com.zaxxer.hikari.HikariConfig
;
import
com.zaxxer.hikari.HikariDataSource
;
public
class
HikariDataSourceFactory
extends
AbsDataSourceFactory
<
HikariDataSource
>
{
@Override
protected
HikariDataSource
convertAndCreate
(
MatrixDataSourceConfig
config
)
{
//基础配置
HikariConfig
hikariConfig
=
new
HikariConfig
();
hikariConfig
.
setJdbcUrl
(
config
.
getUrl
());
hikariConfig
.
setPoolName
(
config
.
getName
());
hikariConfig
.
setUsername
(
config
.
getUsername
());
hikariConfig
.
setPassword
(
config
.
getPassword
());
//连接相关配置
hikariConfig
.
setMinimumIdle
(
config
.
getMinimumIdle
());
hikariConfig
.
setMinimumIdle
(
config
.
getMinimumIdle
());
hikariConfig
.
setMaximumPoolSize
(
config
.
getMaximumPoolSize
());
hikariConfig
.
setIdleTimeout
(
config
.
getIdleTimeout
());
hikariConfig
.
setMaxLifetime
(
config
.
getMaxLifetime
());
hikariConfig
.
setConnectionTimeout
(
config
.
getConnectionTimeout
());
return
new
HikariDataSource
(
hikariConfig
);
}
}
matrix-datasource/matrix-datasource-core/src/main/java/com/secoo/mall/datasource/properties/MatrixDataSourceProperties.java
View file @
05d6a4c9
package
com
.
secoo
.
mall
.
datasource
.
properties
;
package
com
.
secoo
.
mall
.
datasource
.
properties
;
import
com.secoo.mall.datasource.config.MatrixDataSourceConfig
;
import
com.secoo.mall.datasource.config.MatrixDataSourceConfig
;
import
com.secoo.mall.datasource.constant.DataSourceTypeEnum
;
import
lombok.Data
;
import
lombok.Data
;
@Data
@Data
public
class
MatrixDataSourceProperties
extends
MatrixDataSourceConfig
{
public
class
MatrixDataSourceProperties
extends
MatrixDataSourceConfig
{
public
static
final
String
PREFIX
=
"spring.datasource.matrix"
;
public
static
final
String
PREFIX
=
"spring.datasource.matrix"
;
public
static
final
DataSourceTypeEnum
DEFAULT_DATASOURCE_TYPE
=
DataSourceTypeEnum
.
HIKARI
;
public
MatrixDataSourceProperties
()
{
public
MatrixDataSourceProperties
()
{
}
}
}
/**
* SourceType DRUID or HIKARI.
* Default value HIKARI.
*/
private
DataSourceTypeEnum
type
=
DEFAULT_DATASOURCE_TYPE
;
public
void
setType
(
String
type
)
{
this
.
type
=
DataSourceTypeEnum
.
getByName
(
type
);
}
}
matrix-datasource/matrix-datasource-core/src/main/java/com/secoo/mall/datasource/provider/AbsDataSourceProvider.java
View file @
05d6a4c9
...
@@ -2,26 +2,37 @@ package com.secoo.mall.datasource.provider;
...
@@ -2,26 +2,37 @@ package com.secoo.mall.datasource.provider;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.secoo.mall.app.security.encryptor.Encryptor
;
import
com.secoo.mall.app.security.encryptor.Encryptor
;
import
com.secoo.mall.datasource.bean.MatrixDataSource
;
import
com.secoo.mall.datasource.config.DataSourceConfig
;
import
com.secoo.mall.datasource.config.DataSourceConfig
;
import
com.secoo.mall.datasource.config.MatrixDataSourceConfig
;
import
com.secoo.mall.datasource.constant.DataSourceConstant
;
import
com.secoo.mall.datasource.constant.DataSourceConstant
;
import
com.secoo.mall.datasource.factory.DataSourceFactory
;
import
com.secoo.mall.datasource.factory.EncryptorFactory
;
import
com.secoo.mall.datasource.factory.EncryptorFactory
;
import
com.secoo.mall.datasource.properties.MatrixDataSourceProperties
;
import
javax.annotation.Resource
;
import
javax.sql.DataSource
;
import
javax.sql.DataSource
;
import
java.lang.reflect.ParameterizedType
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
public
abstract
class
AbsDataSourceProvider
<
T
extends
MatrixDataSource
Properties
>
implements
DataSourceProvider
{
public
abstract
class
AbsDataSourceProvider
<
T
extends
MatrixDataSource
Config
>
implements
DataSourceProvider
{
private
Encryptor
<
String
>
encryptor
=
EncryptorFactory
.
getInstance
().
getEncryptor
();
private
Encryptor
<
String
>
encryptor
=
EncryptorFactory
.
getInstance
().
getEncryptor
();
@Resource
private
DataSourceFactory
dataSourceFactory
;
private
Class
<
T
>
entryClass
;
public
AbsDataSourceProvider
()
{
entryClass
=
(
Class
<
T
>)
((
ParameterizedType
)
getClass
().
getGenericSuperclass
()).
getActualTypeArguments
()[
0
];
}
@Override
@Override
public
Map
<
String
,
DataSource
>
loadDataSources
()
{
public
Map
<
String
,
DataSource
>
loadDataSources
()
{
List
<
T
>
list
=
getDataSourceProperties
();
List
<
T
>
list
=
getDataSourceProperties
();
Map
<
String
,
DataSource
>
dataSourceMap
=
Maps
.
newHashMapWithExpectedSize
(
list
.
size
());
Map
<
String
,
DataSource
>
dataSourceMap
=
Maps
.
newHashMapWithExpectedSize
(
list
.
size
());
for
(
T
properties
:
list
)
{
for
(
T
properties
:
list
)
{
DataSource
dataSource
=
new
MatrixDataSource
(
properties
.
getType
(),
properties
);
DataSource
dataSource
=
dataSourceFactory
.
createDataSouce
(
properties
);
//取得原数据源名称
//取得原数据源名称
String
dsName
=
properties
.
getName
().
replace
(
DataSourceConfig
.
POOL_NAME_PRIFIX
,
""
);
String
dsName
=
properties
.
getName
().
replace
(
DataSourceConfig
.
POOL_NAME_PRIFIX
,
""
);
dataSourceMap
.
put
(
dsName
,
dataSource
);
dataSourceMap
.
put
(
dsName
,
dataSource
);
...
@@ -40,6 +51,10 @@ public abstract class AbsDataSourceProvider<T extends MatrixDataSourceProperties
...
@@ -40,6 +51,10 @@ public abstract class AbsDataSourceProvider<T extends MatrixDataSourceProperties
}
}
public
Class
<
T
>
getEntryClass
()
{
return
entryClass
;
}
protected
abstract
List
<
T
>
getDataSourceProperties
();
protected
abstract
List
<
T
>
getDataSourceProperties
();
...
...
matrix-datasource/matrix-datasource-core/src/main/java/com/secoo/mall/datasource/provider/ApolloDataSourceProvider.java
View file @
05d6a4c9
...
@@ -6,6 +6,7 @@ import com.google.common.collect.Lists;
...
@@ -6,6 +6,7 @@ import com.google.common.collect.Lists;
import
com.secoo.mall.common.core.exception.BusinessException
;
import
com.secoo.mall.common.core.exception.BusinessException
;
import
com.secoo.mall.common.util.colletion.CollectionUtil
;
import
com.secoo.mall.common.util.colletion.CollectionUtil
;
import
com.secoo.mall.common.util.string.StringUtil
;
import
com.secoo.mall.common.util.string.StringUtil
;
import
com.secoo.mall.datasource.config.MatrixDataSourceConfig
;
import
com.secoo.mall.datasource.constant.DataSourceConstant
;
import
com.secoo.mall.datasource.constant.DataSourceConstant
;
import
com.secoo.mall.datasource.errorcode.DataSourceError
;
import
com.secoo.mall.datasource.errorcode.DataSourceError
;
import
com.secoo.mall.datasource.properties.MatrixDataSourceProperties
;
import
com.secoo.mall.datasource.properties.MatrixDataSourceProperties
;
...
@@ -13,6 +14,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -13,6 +14,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.lang3.reflect.MethodUtils
;
import
org.apache.commons.lang3.reflect.MethodUtils
;
import
javax.sql.DataSource
;
import
javax.sql.DataSource
;
import
java.lang.reflect.ParameterizedType
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -23,8 +25,10 @@ import java.util.stream.Collectors;
...
@@ -23,8 +25,10 @@ import java.util.stream.Collectors;
* 从Apollo配置中心进行加载
* 从Apollo配置中心进行加载
*/
*/
@Slf4j
@Slf4j
public
class
ApolloDataSourceProvider
extends
AbsDataSourceProvider
<
MatrixDataSourceProperties
>
{
public
class
ApolloDataSourceProvider
<
T
extends
MatrixDataSourceConfig
>
extends
AbsDataSourceProvider
<
T
>
{
/*
*/
/**
/**
* 从appollo加载配置信息
* 从appollo加载配置信息
...
@@ -32,10 +36,12 @@ public class ApolloDataSourceProvider extends AbsDataSourceProvider<MatrixDataSo
...
@@ -32,10 +36,12 @@ public class ApolloDataSourceProvider extends AbsDataSourceProvider<MatrixDataSo
* @return
* @return
*/
*/
@Override
@Override
protected
List
<
MatrixDataSourceProperties
>
getDataSourceProperties
()
{
protected
List
<
T
>
getDataSourceProperties
()
{
Config
appConfig
=
ConfigService
.
getConfig
(
DataSourceConstant
.
DB_NAMESPACE
);
Config
appConfig
=
ConfigService
.
getConfig
(
DataSourceConstant
.
DB_NAMESPACE
);
Set
<
String
>
propertyNames
=
appConfig
.
getPropertyNames
();
Set
<
String
>
propertyNames
=
appConfig
.
getPropertyNames
();
List
<
MatrixDataSourceProperties
>
list
=
Lists
.
newArrayList
();
List
<
T
>
list
=
Lists
.
newArrayList
();
Map
<
String
,
DataSource
>
dataSourceMap
=
new
HashMap
<>();
Map
<
String
,
DataSource
>
dataSourceMap
=
new
HashMap
<>();
if
(
CollectionUtil
.
isEmpty
(
propertyNames
))
{
if
(
CollectionUtil
.
isEmpty
(
propertyNames
))
{
throw
new
BusinessException
(
DataSourceError
.
APOLLO_CONFIG_NOT_EXIST
);
throw
new
BusinessException
(
DataSourceError
.
APOLLO_CONFIG_NOT_EXIST
);
...
@@ -47,8 +53,7 @@ public class ApolloDataSourceProvider extends AbsDataSourceProvider<MatrixDataSo
...
@@ -47,8 +53,7 @@ public class ApolloDataSourceProvider extends AbsDataSourceProvider<MatrixDataSo
try
{
try
{
for
(
Map
.
Entry
<
String
,
List
<
String
>>
entry
:
propertyMap
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
List
<
String
>>
entry
:
propertyMap
.
entrySet
())
{
String
dsName
=
entry
.
getKey
();
String
dsName
=
entry
.
getKey
();
MatrixDataSourceProperties
matrixDataSourceProperties
=
new
MatrixDataSourceProperties
();
T
matrixDataSourceProperties
=
getEntryClass
().
newInstance
();
matrixDataSourceProperties
.
setName
(
dsName
);
matrixDataSourceProperties
.
setName
(
dsName
);
for
(
String
property
:
entry
.
getValue
())
{
for
(
String
property
:
entry
.
getValue
())
{
String
propertyFullPath
=
MatrixDataSourceProperties
.
PREFIX
+
property
;
String
propertyFullPath
=
MatrixDataSourceProperties
.
PREFIX
+
property
;
...
...
matrix-datasource/matrix-datasource-core/src/test/java/com/secoo/mall/mybatis/datasouce/DataSourceTest.java
deleted
100644 → 0
View file @
bac5a040
package
com
.
secoo
.
mall
.
mybatis
.
datasouce
;
import
com.secoo.mall.datasource.bean.MatrixDataSource
;
import
com.secoo.mall.datasource.config.MatrixDataSourceConfig
;
import
com.secoo.mall.datasource.constant.DataSourceTypeEnum
;
import
org.junit.Test
;
public
class
DataSourceTest
{
@Test
public
void
testCreateDataSource
()
{
MatrixDataSourceConfig
config
=
new
MatrixDataSourceConfig
();
config
.
setName
(
"01"
);
// config.setType(DataSourceType.HIKARI);
config
.
setUrl
(
"jdbc:mysql://127.0.0.1:3306/appmsdb?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false"
);
config
.
setPassword
(
"mysql"
);
config
.
setUsername
(
"root"
);
MatrixDataSource
dataSource
=
new
MatrixDataSource
(
DataSourceTypeEnum
.
HIKARI
,
config
);
System
.
out
.
println
(
dataSource
);
}
}
matrix-datasource/matrix-datasource-core/src/test/resources/application.yml
deleted
100644 → 0
View file @
bac5a040
mat
\ No newline at end of file
matrix-datasource/matrix-datasource-druid/pom.xml
0 → 100644
View file @
05d6a4c9
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
matrix-datasource
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.10.RELEASE
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
matrix-datasource-druid
</artifactId>
<dependencies>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-datasource-core
</artifactId>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
druid
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
matrix-datasource/matrix-datasource-
core
/src/main/java/com/secoo/mall/datasource/factory/DruidDataSourceFactory.java
→
matrix-datasource/matrix-datasource-
druid
/src/main/java/com/secoo/mall/datasource/factory/DruidDataSourceFactory.java
View file @
05d6a4c9
...
@@ -2,14 +2,19 @@ package com.secoo.mall.datasource.factory;
...
@@ -2,14 +2,19 @@ package com.secoo.mall.datasource.factory;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.secoo.mall.datasource.config.MatrixDataSourceConfig
;
import
com.secoo.mall.datasource.config.MatrixDataSourceConfig
;
import
com.secoo.mall.datasource.properties.MatrixDruidDataSourceProperties
;
import
lombok.extern.slf4j.Slf4j
;
import
javax.sql.DataSource
;
import
java.sql.SQLException
;
import
java.util.Properties
;
import
java.util.Properties
;
public
class
DruidDataSourceFactory
extends
AbsDataSourceFactory
<
DruidDataSource
>
{
@Slf4j
public
class
DruidDataSourceFactory
extends
AbsDataSourceFactory
<
DruidDataSource
,
MatrixDruidDataSourceProperties
>
{
private
final
String
duridPreFix
=
"druid."
;
private
final
String
duridPreFix
=
"druid."
;
@Override
@Override
protected
DruidDataSource
convertAndCreate
(
MatrixDataSourceConfig
config
)
{
protected
DruidDataSource
convertAndCreate
(
MatrixDruidDataSourceProperties
config
)
{
Properties
properties
=
new
Properties
();
Properties
properties
=
new
Properties
();
properties
.
setProperty
(
duridPreFix
+
"name"
,
config
.
getName
());
properties
.
setProperty
(
duridPreFix
+
"name"
,
config
.
getName
());
...
@@ -25,7 +30,14 @@ public class DruidDataSourceFactory extends AbsDataSourceFactory<DruidDataSource
...
@@ -25,7 +30,14 @@ public class DruidDataSourceFactory extends AbsDataSourceFactory<DruidDataSource
DruidDataSource
dataSource
=
new
DruidDataSource
();
DruidDataSource
dataSource
=
new
DruidDataSource
();
dataSource
.
configFromPropety
(
properties
);
dataSource
.
configFromPropety
(
properties
);
try
{
dataSource
.
init
();
}
catch
(
SQLException
e
)
{
log
.
error
(
"sql error:"
,
e
);
}
return
dataSource
;
return
dataSource
;
}
}
}
}
matrix-datasource/matrix-datasource-druid/src/main/java/com/secoo/mall/datasource/properties/MatrixDruidDataSourceProperties.java
0 → 100644
View file @
05d6a4c9
package
com
.
secoo
.
mall
.
datasource
.
properties
;
import
com.secoo.mall.datasource.config.MatrixDataSourceConfig
;
import
lombok.Data
;
@Data
public
class
MatrixDruidDataSourceProperties
extends
MatrixDataSourceProperties
{
public
static
final
String
PREFIX
=
MatrixDataSourceProperties
.
PREFIX
+
".druid"
;
}
matrix-datasource/matrix-datasource-druid/src/main/java/com/secoo/mall/datasource/provider/ApolloDruidDataSourceProvider.java
0 → 100644
View file @
05d6a4c9
package
com
.
secoo
.
mall
.
datasource
.
provider
;
import
com.secoo.mall.datasource.properties.MatrixDruidDataSourceProperties
;
public
class
ApolloDruidDataSourceProvider
extends
ApolloDataSourceProvider
<
MatrixDruidDataSourceProperties
>
{
}
matrix-datasource/pom.xml
View file @
05d6a4c9
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
@@ -13,28 +13,20 @@
...
@@ -13,28 +13,20 @@
<packaging>
pom
</packaging>
<packaging>
pom
</packaging>
<modules>
<modules>
<module>
matrix-datasource-core
</module>
<module>
matrix-datasource-core
</module>
<module>
matrix-datasource-druid
</module>
</modules>
</modules>
<dependencyManagement>
<dependencyManagement>
<dependencies>
<dependencies>
<dependency>
<dependency>
<groupId>
com.zaxxer
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
HikariCP
</artifactId>
<artifactId>
matrix-datasource-core
</artifactId>
<version>
3.2.0
</version>
<version>
1.1.10.RELEASE
</version>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
druid-spring-boot-starter
</artifactId>
<version>
1.1.20
</version>
<scope>
provided
</scope>
<optional>
true
</optional>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<groupId>
com.alibaba
</groupId>
<artifactId>
druid
</artifactId>
<artifactId>
druid
</artifactId>
<version>
1.1.20
</version>
<version>
1.1.20
</version>
<scope>
provided
</scope>
<optional>
true
</optional>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
...
...
matrix-mybatis/matrix-mybatis-core/pom.xml
View file @
05d6a4c9
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix-mybatis
</artifactId>
<artifactId>
matrix-mybatis
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-datasource-
core
</artifactId>
<artifactId>
matrix-datasource-
druid
</artifactId>
</dependency>
</dependency>
</dependencies>
</dependencies>
...
...
matrix-mybatis/matrix-mybatis-starter/pom.xml
View file @
05d6a4c9
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix-mybatis
</artifactId>
<artifactId>
matrix-mybatis
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
matrix-mybatis/matrix-mybatis-starter/src/main/java/com/secoo/mall/mybatis/config/MatrixMybatisConfiguration.java
deleted
100644 → 0
View file @
bac5a040
package
com
.
secoo
.
mall
.
mybatis
.
config
;
import
com.secoo.mall.mybatis.bean.MatrixMybatisSqlSessionFactoryBean
;
import
com.secoo.mall.mybatis.spring.boot.autoconfigure.MatrixMybatisAutoConfiguration
;
import
org.apache.ibatis.session.SqlSessionFactory
;
import
org.springframework.boot.autoconfigure.AutoConfigureAfter
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Import
;
import
javax.sql.DataSource
;
//@Configuration
//@AutoConfigureAfter(MatrixMybatisAutoConfiguration.class)
public
class
MatrixMybatisConfiguration
{
/* @Bean
@ConditionalOnMissingBean(SqlSessionFactory.class)
public SqlSessionFactory sqlSessionFactory(DataSource dataSource,MatrixMybatisConfig matrixMybatisConfig,MatrixMybatisGlobalConfig matrixMybatisGlobalConfig) throws Exception {
MatrixMybatisSqlSessionFactoryBean sqlSessionFactory = new MatrixMybatisSqlSessionFactoryBean(matrixMybatisConfig,matrixMybatisGlobalConfig);
*//* sqlSessionFactory.setGlobalConfig(matrixMybatisGlobalConfig());
sqlSessionFactory.setConfiguration(matrixMybatisConfig());*//*
sqlSessionFactory.setDataSource(dataSource);
return sqlSessionFactory.getObject();
}*/
}
matrix-mybatis/matrix-mybatis-starter/src/main/java/com/secoo/mall/mybatis/spring/boot/autoconfigure/MatrixMybatisAutoConfiguration.java
View file @
05d6a4c9
package
com
.
secoo
.
mall
.
mybatis
.
spring
.
boot
.
autoconfigure
;
package
com
.
secoo
.
mall
.
mybatis
.
spring
.
boot
.
autoconfigure
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration
;
import
com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration
;
import
com.baomidou.mybatisplus.extension.toolkit.PackageHelper
;
import
com.ctrip.framework.apollo.spring.boot.ApolloAutoConfiguration
;
import
com.ctrip.framework.apollo.spring.boot.ApolloAutoConfiguration
;
import
com.secoo.mall.common.util.string.StringUtil
;
import
com.secoo.mall.datasource.bean.MatrixDataSource
;
import
com.secoo.mall.datasource.bean.MatrixDataSource
;
import
com.secoo.mall.datasource.bean.MatrixDynamicDataSource
;
import
com.secoo.mall.datasource.bean.MatrixDynamicDataSource
;
import
com.secoo.mall.datasource.provider.ApolloDataSourceProvider
;
import
com.secoo.mall.datasource.factory.DataSourceFactory
;
import
com.secoo.mall.datasource.factory.DruidDataSourceFactory
;
import
com.secoo.mall.datasource.provider.ApolloDruidDataSourceProvider
;
import
com.secoo.mall.datasource.provider.DataSourceProvider
;
import
com.secoo.mall.datasource.provider.DataSourceProvider
;
import
com.secoo.mall.datasource.util.SysUtil
;
import
com.secoo.mall.datasource.util.SysUtil
;
import
com.secoo.mall.mybatis.bean.MatrixMybatisSqlSessionFactoryBean
;
import
com.secoo.mall.mybatis.bean.MatrixMybatisSqlSessionFactoryBean
;
...
@@ -21,10 +22,11 @@ import org.springframework.boot.autoconfigure.AutoConfigureBefore;
...
@@ -21,10 +22,11 @@ import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jdbc.DataSourceProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.co
re.io.support.PathMatchingResourcePatternResolver
;
import
org.springframework.co
ntext.annotation.Primary
;
import
javax.sql.DataSource
;
import
javax.sql.DataSource
;
...
@@ -33,7 +35,6 @@ import javax.sql.DataSource;
...
@@ -33,7 +35,6 @@ import javax.sql.DataSource;
@AutoConfigureBefore
({
DataSourceAutoConfiguration
.
class
,
MybatisPlusAutoConfiguration
.
class
})
@AutoConfigureBefore
({
DataSourceAutoConfiguration
.
class
,
MybatisPlusAutoConfiguration
.
class
})
@AutoConfigureAfter
(
ApolloAutoConfiguration
.
class
)
@AutoConfigureAfter
(
ApolloAutoConfiguration
.
class
)
@EnableConfigurationProperties
({
MatrixDefaultDataSourceProperties
.
class
})
@EnableConfigurationProperties
({
MatrixDefaultDataSourceProperties
.
class
})
//@Import(MatrixMybatisAutoConfiguration.class)
@Slf4j
@Slf4j
public
class
MatrixMybatisAutoConfiguration
{
public
class
MatrixMybatisAutoConfiguration
{
@Setter
@Setter
...
@@ -46,11 +47,12 @@ public class MatrixMybatisAutoConfiguration {
...
@@ -46,11 +47,12 @@ public class MatrixMybatisAutoConfiguration {
@Value
(
"${config.app.security.accessToken}"
)
@Value
(
"${config.app.security.accessToken}"
)
private
String
acccessToken
;
private
String
acccessToken
;
@Bean
@Bean
@ConditionalOnMissingBean
(
DataSourceProvider
.
class
)
@ConditionalOnMissingBean
(
DataSourceProvider
.
class
)
public
DataSourceProvider
dataSourceProvider
()
{
public
DataSourceProvider
dataSourceProvider
()
{
SysUtil
.
setProperty
(
"accessToken"
,
acccessToken
);
SysUtil
.
setProperty
(
"accessToken"
,
acccessToken
);
return
new
ApolloDataSourceProvider
();
return
new
ApolloD
ruidD
ataSourceProvider
();
}
}
/**
/**
...
@@ -65,10 +67,17 @@ public class MatrixMybatisAutoConfiguration {
...
@@ -65,10 +67,17 @@ public class MatrixMybatisAutoConfiguration {
}
}
@Bean
@Bean
@ConditionalOnMissingBean
(
DataSourceFactory
.
class
)
public
DataSourceFactory
dataSourceFactory
()
{
return
new
DruidDataSourceFactory
();
}
@Bean
@ConditionalOnMissingBean
(
SqlSessionFactory
.
class
)
@ConditionalOnMissingBean
(
SqlSessionFactory
.
class
)
public
SqlSessionFactory
sqlSessionFactory
(
DataSource
dataSource
,
MatrixMybatisConfig
matrixMybatisConfig
,
MatrixMybatisGlobalConfig
matrixMybatisGlobalConfig
)
throws
Exception
{
public
SqlSessionFactory
sqlSessionFactory
(
DataSource
dataSource
,
MatrixMybatisConfig
matrixMybatisConfig
,
MatrixMybatisGlobalConfig
matrixMybatisGlobalConfig
)
throws
Exception
{
MatrixMybatisSqlSessionFactoryBean
sqlSessionFactory
=
new
MatrixMybatisSqlSessionFactoryBean
(
matrixMybatisConfig
,
matrixMybatisGlobalConfig
);
MatrixMybatisSqlSessionFactoryBean
sqlSessionFactory
=
new
MatrixMybatisSqlSessionFactoryBean
(
matrixMybatisConfig
,
matrixMybatisGlobalConfig
);
sqlSessionFactory
.
setDataSource
(
dataSource
);
sqlSessionFactory
.
setDataSource
(
dataSource
);
return
sqlSessionFactory
.
getObject
();
return
sqlSessionFactory
.
getObject
();
}
}
...
...
matrix-mybatis/pom.xml
View file @
05d6a4c9
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
@@ -25,22 +25,28 @@
...
@@ -25,22 +25,28 @@
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-mybatis-core
</artifactId>
<artifactId>
matrix-mybatis-core
</artifactId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-mybatis-starter
</artifactId>
<artifactId>
matrix-mybatis-starter
</artifactId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
<version>
${mybatis-plus.version}
</version>
<version>
${mybatis-plus.version}
</version>
<exclusions>
<exclusion>
<artifactId>
HikariCP
</artifactId>
<groupId>
com.zaxxer
</groupId>
</exclusion>
</exclusions>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-datasource-
core
</artifactId>
<artifactId>
matrix-datasource-
druid
</artifactId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</dependency>
</dependency>
</dependencies>
</dependencies>
</dependencyManagement>
</dependencyManagement>
...
...
mongodb-starter/pom.xml
View file @
05d6a4c9
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
monitor-starter/pom.xml
View file @
05d6a4c9
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
openfeign-starter/pom.xml
View file @
05d6a4c9
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
pom.xml
View file @
05d6a4c9
...
@@ -6,13 +6,14 @@
...
@@ -6,13 +6,14 @@
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
<packaging>
pom
</packaging>
<packaging>
pom
</packaging>
<modules>
<modules>
<module>
common-core
</module>
<module>
common-core
</module>
<module>
common-util
</module>
<module>
common-util
</module>
<module>
logger-starter
</module>
<module>
redis-starter
</module>
<module>
redis-starter
</module>
<module>
matrix-mybatis
</module>
<module>
matrix-mybatis
</module>
<module>
mongodb-starter
</module>
<module>
mongodb-starter
</module>
...
@@ -22,7 +23,6 @@
...
@@ -22,7 +23,6 @@
<module>
monitor-starter
</module>
<module>
monitor-starter
</module>
<module>
config-starter
</module>
<module>
config-starter
</module>
<module>
protocol-starter
</module>
<module>
protocol-starter
</module>
<module>
logger-starter
</module>
<module>
matrix-datasource
</module>
<module>
matrix-datasource
</module>
</modules>
</modules>
...
@@ -48,62 +48,62 @@
...
@@ -48,62 +48,62 @@
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
logger-starter
</artifactId>
<artifactId>
logger-starter
</artifactId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
monitor-starter
</artifactId>
<artifactId>
monitor-starter
</artifactId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
common-core
</artifactId>
<artifactId>
common-core
</artifactId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
config-starter
</artifactId>
<artifactId>
config-starter
</artifactId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
common-util
</artifactId>
<artifactId>
common-util
</artifactId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
redis-starter
</artifactId>
<artifactId>
redis-starter
</artifactId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-mybatis-starter
</artifactId>
<artifactId>
matrix-mybatis-starter
</artifactId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
mongodb-starter
</artifactId>
<artifactId>
mongodb-starter
</artifactId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
elasticsearch-starter
</artifactId>
<artifactId>
elasticsearch-starter
</artifactId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
protocol-starter
</artifactId>
<artifactId>
protocol-starter
</artifactId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
rocketmq-starter
</artifactId>
<artifactId>
rocketmq-starter
</artifactId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
openfeign-starter
</artifactId>
<artifactId>
openfeign-starter
</artifactId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
...
...
protocol-starter/pom.xml
View file @
05d6a4c9
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
redis-starter/pom.xml
View file @
05d6a4c9
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
rocketmq-starter/pom.xml
View file @
05d6a4c9
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
matrix
</artifactId>
<artifactId>
matrix
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.1.
9
.RELEASE
</version>
<version>
1.1.
10
.RELEASE
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment