Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
sso
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
曲欣亮
sso
Commits
d2a3aa6e
Commit
d2a3aa6e
authored
Jul 05, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
6df9c8e2
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
93 additions
and
6 deletions
+93
-6
pom.xml
pom.xml
+8
-0
SSOApplication.java
src/main/java/com/egolm/sso/SSOApplication.java
+3
-2
DataSourceConfig.java
src/main/java/com/egolm/sso/config/DataSourceConfig.java
+40
-0
application-dev.properties
src/main/resources/application-dev.properties
+0
-2
application-dev.yml
src/main/resources/application-dev.yml
+21
-0
application-pro.properties
src/main/resources/application-pro.properties
+0
-2
application-pro.yml
src/main/resources/application-pro.yml
+21
-0
No files found.
pom.xml
View file @
d2a3aa6e
...
...
@@ -38,6 +38,10 @@
<artifactId>
cxf-spring-boot-starter-jaxws
</artifactId>
<version>
3.3.2
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-jdbc
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-devtools
</artifactId>
...
...
@@ -83,6 +87,10 @@
<artifactId>
javax.ws.rs-api
</artifactId>
<version>
2.1.1
</version>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
...
...
src/main/java/com/egolm/sso/SSOApplication.java
View file @
d2a3aa6e
...
...
@@ -2,10 +2,11 @@ package com.egolm.sso;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
@SpringBootApplication
(
exclude
=
{
DataSourceAutoConfiguration
.
class
})
@SpringBootApplication
@EnableTransactionManagement
public
class
SSOApplication
{
private
static
ApplicationContext
applicationContext
;
...
...
src/main/java/com/egolm/sso/config/DataSourceConfig.java
0 → 100644
View file @
d2a3aa6e
package
com
.
egolm
.
sso
.
config
;
import
javax.sql.DataSource
;
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.core.JdbcTemplate
;
import
org.springframework.jdbc.datasource.DataSourceTransactionManager
;
import
org.springframework.transaction.PlatformTransactionManager
;
import
com.alibaba.druid.pool.DruidDataSource
;
@Configuration
public
class
DataSourceConfig
{
@Bean
@Primary
@ConfigurationProperties
(
prefix
=
"spring.datasource"
)
public
DataSource
getDataSource
()
{
return
DataSourceBuilder
.
create
().
type
(
DruidDataSource
.
class
).
build
();
}
@Bean
@Primary
public
PlatformTransactionManager
getTransactionManager
(
DataSource
dataSource
)
{
return
new
DataSourceTransactionManager
(
dataSource
);
}
@Bean
@Primary
public
JdbcTemplate
getJdbcTemplate
(
DataSource
dataSource
)
{
JdbcTemplate
jdbcTemplate
=
new
JdbcTemplate
();
jdbcTemplate
.
setDataSource
(
dataSource
);
return
jdbcTemplate
;
}
}
\ No newline at end of file
src/main/resources/application-dev.properties
deleted
100644 → 0
View file @
6df9c8e2
wsUsername
=
test
wsPassword
=
78258c537d6e4d5fb210a57d05619fb6
\ No newline at end of file
src/main/resources/application-dev.yml
0 → 100644
View file @
d2a3aa6e
wsUsername
:
test
wsPassword
:
78258c537d6e4d5fb210a57d05619fb6
spring
:
datasource
:
type
:
com.alibaba.druid.pool.DruidDataSource
driverClassName
:
com.mysql.jdbc.Driver
url
:
jdbc:mysql://10.10.0.111:3306/sso?useSSL=false&useUnicode=true&characterEncoding=utf8
username
:
root
password
:
'
egolm#2018'
maxActive
:
20
initialSize
:
1
maxWait
:
60000
minIdle
:
1
timeBetweenEvictionRunsMillis
:
60000
minEvictableIdleTimeMillis
:
300000
validationQuery
:
SELECT 1 FROM DUAL
testWhileIdle
:
true
testOnBorrow
:
true
testOnReturn
:
true
poolPreparedStatements
:
true
maxOpenPreparedStatements
:
20
\ No newline at end of file
src/main/resources/application-pro.properties
deleted
100644 → 0
View file @
6df9c8e2
wsUsername
=
schneider
wsPassword
=
f14d4a80f823438a875b1924384c944c
\ No newline at end of file
src/main/resources/application-pro.yml
0 → 100644
View file @
d2a3aa6e
wsUsername
:
schneider
wsPassword
:
f14d4a80f823438a875b1924384c944c
spring
:
datasource
:
type
:
com.alibaba.druid.pool.DruidDataSource
driverClassName
:
com.mysql.jdbc.Driver
url
:
jdbc:mysql://10.10.0.111:3306/sso?useSSL=false&useUnicode=true&characterEncoding=utf8
username
:
root
password
:
'
egolm#2018'
maxActive
:
20
initialSize
:
1
maxWait
:
60000
minIdle
:
1
timeBetweenEvictionRunsMillis
:
60000
minEvictableIdleTimeMillis
:
300000
validationQuery
:
SELECT 1 FROM DUAL
testWhileIdle
:
true
testOnBorrow
:
true
testOnReturn
:
true
poolPreparedStatements
:
true
maxOpenPreparedStatements
:
20
\ 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