Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
admin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
admin
Commits
952ea90d
Commit
952ea90d
authored
Aug 27, 2019
by
张永
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
升个版本
parent
278be934
Pipeline
#166
canceled with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
199 additions
and
199 deletions
+199
-199
pom.xml
pom.xml
+111
-111
ConfigDataSourceConfig.java
...egolm/admin/config/datasource/ConfigDataSourceConfig.java
+46
-46
ShopDataSourceConfig.java
...m/egolm/admin/config/datasource/ShopDataSourceConfig.java
+42
-42
No files found.
pom.xml
View file @
952ea90d
<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"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.egolm
</groupId>
<artifactId>
admin
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<description>
B2B后台管理模块
</description>
<properties>
<start-class>
com.egolm.admin.AdminApplication
</start-class>
</properties>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
1.5.9.RELEASE
</version>
</parent>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-devtools
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
</dependency>
<dependency>
<groupId>
com.microsoft.sqlserver
</groupId>
<artifactId>
sqljdbc4
</artifactId>
<version>
4.0
</version>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
1.2.38
</version>
</dependency>
<dependency>
<groupId>
com.egolm
</groupId>
<artifactId>
common
</artifactId>
<version>
0.0.1-RELEASE
</version>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
druid
</artifactId>
<version>
1.1.6
</version>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
<version>
2.6.1
</version>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger-ui
</artifactId>
<version>
2.6.1
</version>
</dependency>
<dependency>
<groupId>
net.sf.ehcache
</groupId>
<artifactId>
ehcache
</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>
maven-compiler-plugin
</artifactId>
<configuration>
<source>
1.8
</source>
<target>
1.8
</target>
</configuration>
</plugin>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<configuration>
<mainClass>
${start-class}
</mainClass>
<layout>
ZIP
</layout>
</configuration>
<executions>
<execution>
<goals>
<goal>
repackage
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>
my
</id>
<name>
my
</name>
<url>
http://git.egolm.com:9003/nexus/content/groups/public/
</url>
</repository>
<repository>
<id>
repo1
</id>
<name>
repo1
</name>
<url>
http://repo1.maven.org/maven2/
</url>
</repository>
<repository>
<id>
mvnrepository
</id>
<name>
mvnrepository
</name>
<url>
http://mvnrepository.com/
</url>
</repository>
</repositories>
<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"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.egolm
</groupId>
<artifactId>
admin
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<description>
B2B后台管理模块
</description>
<properties>
<start-class>
com.egolm.admin.AdminApplication
</start-class>
</properties>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
2.1.0.RELEASE
</version>
</parent>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-devtools
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
</dependency>
<dependency>
<groupId>
com.microsoft.sqlserver
</groupId>
<artifactId>
sqljdbc4
</artifactId>
<version>
4.0
</version>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
1.2.38
</version>
</dependency>
<dependency>
<groupId>
com.egolm
</groupId>
<artifactId>
common
</artifactId>
<version>
0.0.1-RELEASE
</version>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
druid
</artifactId>
<version>
1.1.6
</version>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
<version>
2.6.1
</version>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger-ui
</artifactId>
<version>
2.6.1
</version>
</dependency>
<dependency>
<groupId>
net.sf.ehcache
</groupId>
<artifactId>
ehcache
</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>
maven-compiler-plugin
</artifactId>
<configuration>
<source>
1.8
</source>
<target>
1.8
</target>
</configuration>
</plugin>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<configuration>
<mainClass>
${start-class}
</mainClass>
<layout>
ZIP
</layout>
</configuration>
<executions>
<execution>
<goals>
<goal>
repackage
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>
my
</id>
<name>
my
</name>
<url>
http://git.egolm.com:9003/nexus/content/groups/public/
</url>
</repository>
<repository>
<id>
repo1
</id>
<name>
repo1
</name>
<url>
http://repo1.maven.org/maven2/
</url>
</repository>
<repository>
<id>
mvnrepository
</id>
<name>
mvnrepository
</name>
<url>
http://mvnrepository.com/
</url>
</repository>
</repositories>
</project>
\ No newline at end of file
src/main/java/com/egolm/admin/config/datasource/ConfigDataSourceConfig.java
View file @
952ea90d
package
com
.
egolm
.
admin
.
config
.
datasource
;
import
javax.sql.DataSource
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.boot.
autoconfigure.jdbc.DataSourceBuilder
;
import
org.springframework.boot.
context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.jdbc.datasource.DataSourceTransactionManager
;
import
org.springframework.transaction.PlatformTransactionManager
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.dialect.MySqlDialect
;
@Configuration
public
class
ConfigDataSourceConfig
{
@Bean
@Primary
@Qualifier
(
"configDataSource"
)
@ConfigurationProperties
(
prefix
=
"spring.datasource.config"
)
public
DataSource
getDataSource
()
{
return
DataSourceBuilder
.
create
().
type
(
DruidDataSource
.
class
).
build
();
}
@Bean
@Primary
@Qualifier
(
"configTxManager"
)
public
PlatformTransactionManager
getTransactionManager
(
@Qualifier
(
"configDataSource"
)
DataSource
dataSource
)
{
return
new
DataSourceTransactionManager
(
dataSource
);
}
@Bean
@Primary
@Qualifier
(
"configJdbcTemplate"
)
public
JdbcTemplate
getJdbcTemplate
(
@Qualifier
(
"configDataSource"
)
DataSource
dataSource
)
{
JdbcTemplate
jdbcTemplate
=
new
JdbcTemplate
();
jdbcTemplate
.
setDataSource
(
dataSource
);
jdbcTemplate
.
setDialect
(
new
MySqlDialect
());
jdbcTemplate
.
setSql_level
(
3
);
return
jdbcTemplate
;
}
package
com
.
egolm
.
admin
.
config
.
datasource
;
import
javax.sql.DataSource
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.boot.
context.properties.ConfigurationProperties
;
import
org.springframework.boot.
jdbc.DataSourceBuilder
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.jdbc.datasource.DataSourceTransactionManager
;
import
org.springframework.transaction.PlatformTransactionManager
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.dialect.MySqlDialect
;
@Configuration
public
class
ConfigDataSourceConfig
{
@Bean
@Primary
@Qualifier
(
"configDataSource"
)
@ConfigurationProperties
(
prefix
=
"spring.datasource.config"
)
public
DataSource
getDataSource
()
{
return
DataSourceBuilder
.
create
().
type
(
DruidDataSource
.
class
).
build
();
}
@Bean
@Primary
@Qualifier
(
"configTxManager"
)
public
PlatformTransactionManager
getTransactionManager
(
@Qualifier
(
"configDataSource"
)
DataSource
dataSource
)
{
return
new
DataSourceTransactionManager
(
dataSource
);
}
@Bean
@Primary
@Qualifier
(
"configJdbcTemplate"
)
public
JdbcTemplate
getJdbcTemplate
(
@Qualifier
(
"configDataSource"
)
DataSource
dataSource
)
{
JdbcTemplate
jdbcTemplate
=
new
JdbcTemplate
();
jdbcTemplate
.
setDataSource
(
dataSource
);
jdbcTemplate
.
setDialect
(
new
MySqlDialect
());
jdbcTemplate
.
setSql_level
(
3
);
return
jdbcTemplate
;
}
}
\ No newline at end of file
src/main/java/com/egolm/admin/config/datasource/ShopDataSourceConfig.java
View file @
952ea90d
package
com
.
egolm
.
admin
.
config
.
datasource
;
import
javax.sql.DataSource
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.boot.
autoconfigure.jdbc.DataSourceBuilder
;
import
org.springframework.boot.
context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.jdbc.datasource.DataSourceTransactionManager
;
import
org.springframework.transaction.PlatformTransactionManager
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.dialect.SqlServerDialect
;
@Configuration
public
class
ShopDataSourceConfig
{
@Bean
@Qualifier
(
"shopDataSource"
)
@ConfigurationProperties
(
prefix
=
"spring.datasource.shop"
)
public
DataSource
getDataSource
()
{
return
DataSourceBuilder
.
create
().
type
(
DruidDataSource
.
class
).
build
();
}
@Bean
@Qualifier
(
"shopTxManager"
)
public
PlatformTransactionManager
getTransactionManager
(
@Qualifier
(
"shopDataSource"
)
DataSource
dataSource
)
{
return
new
DataSourceTransactionManager
(
dataSource
);
}
@Bean
@Qualifier
(
"shopJdbcTemplate"
)
public
JdbcTemplate
getJdbcTemplate
(
@Qualifier
(
"shopDataSource"
)
DataSource
dataSource
)
{
JdbcTemplate
jdbcTemplate
=
new
JdbcTemplate
();
jdbcTemplate
.
setDataSource
(
dataSource
);
jdbcTemplate
.
setDialect
(
new
SqlServerDialect
());
jdbcTemplate
.
setSql_level
(
3
);
return
jdbcTemplate
;
}
package
com
.
egolm
.
admin
.
config
.
datasource
;
import
javax.sql.DataSource
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.boot.
context.properties.ConfigurationProperties
;
import
org.springframework.boot.
jdbc.DataSourceBuilder
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.jdbc.datasource.DataSourceTransactionManager
;
import
org.springframework.transaction.PlatformTransactionManager
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.dialect.SqlServerDialect
;
@Configuration
public
class
ShopDataSourceConfig
{
@Bean
@Qualifier
(
"shopDataSource"
)
@ConfigurationProperties
(
prefix
=
"spring.datasource.shop"
)
public
DataSource
getDataSource
()
{
return
DataSourceBuilder
.
create
().
type
(
DruidDataSource
.
class
).
build
();
}
@Bean
@Qualifier
(
"shopTxManager"
)
public
PlatformTransactionManager
getTransactionManager
(
@Qualifier
(
"shopDataSource"
)
DataSource
dataSource
)
{
return
new
DataSourceTransactionManager
(
dataSource
);
}
@Bean
@Qualifier
(
"shopJdbcTemplate"
)
public
JdbcTemplate
getJdbcTemplate
(
@Qualifier
(
"shopDataSource"
)
DataSource
dataSource
)
{
JdbcTemplate
jdbcTemplate
=
new
JdbcTemplate
();
jdbcTemplate
.
setDataSource
(
dataSource
);
jdbcTemplate
.
setDialect
(
new
SqlServerDialect
());
jdbcTemplate
.
setSql_level
(
3
);
return
jdbcTemplate
;
}
}
\ No newline at end of file
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