Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yanxuan-qc-change-system
Overview
Overview
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
yx-qc-change-flow
yanxuan-qc-change-system
Commits
a892494d
Commit
a892494d
authored
May 07, 2025
by
韩兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: 调整配置
parent
65cab804
Pipeline
#75077
failed with stages
in 9 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
35 deletions
+12
-35
pom.xml
pom.xml
+5
-29
DataSourceConfiguration.java
...il/yanxuan/change/dal/config/DataSourceConfiguration.java
+7
-6
No files found.
pom.xml
View file @
a892494d
...
@@ -44,7 +44,6 @@
...
@@ -44,7 +44,6 @@
<!-- store-db -->
<!-- store-db -->
<mysql.version>
5.1.34
</mysql.version>
<mysql.version>
5.1.34
</mysql.version>
<mybatis.spring.boot.starter.version>
1.1.1
</mybatis.spring.boot.starter.version>
<mybatis.spring.boot.starter.version>
1.1.1
</mybatis.spring.boot.starter.version>
<druid.version>
1.0.21
</druid.version>
<!-- store-redis -->
<!-- store-redis -->
<redis.clients.version>
2.9.0
</redis.clients.version>
<redis.clients.version>
2.9.0
</redis.clients.version>
...
@@ -186,11 +185,6 @@
...
@@ -186,11 +185,6 @@
<artifactId>
mybatis-spring-boot-starter
</artifactId>
<artifactId>
mybatis-spring-boot-starter
</artifactId>
<version>
${mybatis.spring.boot.starter.version}
</version>
<version>
${mybatis.spring.boot.starter.version}
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
druid
</artifactId>
<version>
${druid.version}
</version>
</dependency>
<!--引入潘多拉-->
<!--引入潘多拉-->
<dependency>
<dependency>
<groupId>
com.netease.yanxuan
</groupId>
<groupId>
com.netease.yanxuan
</groupId>
...
@@ -209,12 +203,6 @@
...
@@ -209,12 +203,6 @@
<artifactId>
spring-data-redis
</artifactId>
<artifactId>
spring-data-redis
</artifactId>
<version>
${spring.data.redis.version}
</version>
<version>
${spring.data.redis.version}
</version>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-redis
</artifactId>
<version>
${spring.boot.version}
</version>
</dependency>
<dependency>
<dependency>
<groupId>
com.netease.yanxuan
</groupId>
<groupId>
com.netease.yanxuan
</groupId>
...
@@ -228,23 +216,6 @@
...
@@ -228,23 +216,6 @@
<version>
${user-info-client.version}
</version>
<version>
${user-info-client.version}
</version>
</dependency>
</dependency>
<dependency>
<groupId>
tk.mybatis
</groupId>
<artifactId>
mapper-spring-boot-starter
</artifactId>
<version>
2.1.5
</version>
<exclusions>
<exclusion>
<groupId>
tk.mybatis
</groupId>
<artifactId>
mapper-base
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
tk.mybatis
</groupId>
<artifactId>
mapper-base
</artifactId>
<version>
4.1.5
</version>
</dependency>
</dependencies>
</dependencies>
</dependencyManagement>
</dependencyManagement>
...
@@ -411,6 +382,11 @@
...
@@ -411,6 +382,11 @@
<artifactId>
guava
</artifactId>
<artifactId>
guava
</artifactId>
<version>
${guava.version}
</version>
<version>
${guava.version}
</version>
</dependency>
</dependency>
<dependency>
<groupId>
tk.mybatis
</groupId>
<artifactId>
mapper-spring-boot-starter
</artifactId>
<version>
2.1.5
</version>
</dependency>
<!--mybatis 分页插件-->
<!--mybatis 分页插件-->
<dependency>
<dependency>
<groupId>
com.github.pagehelper
</groupId>
<groupId>
com.github.pagehelper
</groupId>
...
...
yanxuan-qc-change-system-dal/src/main/java/com/netease/mail/yanxuan/change/dal/config/DataSourceConfiguration.java
View file @
a892494d
...
@@ -8,6 +8,7 @@ import com.google.common.collect.ImmutableSet;
...
@@ -8,6 +8,7 @@ import com.google.common.collect.ImmutableSet;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.netease.yanxuan.pandora.DataSourceRefresher
;
import
com.netease.yanxuan.pandora.DataSourceRefresher
;
import
com.netease.yanxuan.pandora.spring.annotation.EnableDataSourceRefresh
;
import
com.netease.yanxuan.pandora.spring.annotation.EnableDataSourceRefresh
;
import
org.apache.commons.dbcp.BasicDataSource
;
import
org.apache.ibatis.session.SqlSessionFactory
;
import
org.apache.ibatis.session.SqlSessionFactory
;
import
org.mybatis.spring.SqlSessionFactoryBean
;
import
org.mybatis.spring.SqlSessionFactoryBean
;
import
org.mybatis.spring.SqlSessionTemplate
;
import
org.mybatis.spring.SqlSessionTemplate
;
...
@@ -55,7 +56,7 @@ public class DataSourceConfiguration {
...
@@ -55,7 +56,7 @@ public class DataSourceConfiguration {
@Bean
(
name
=
"dataSource"
)
@Bean
(
name
=
"dataSource"
)
@Primary
@Primary
public
DataSource
dataSource
()
{
public
DataSource
dataSource
()
{
DruidDataSource
dataSource
=
new
Druid
DataSource
();
BasicDataSource
dataSource
=
new
Basic
DataSource
();
dataSource
.
setDriverClassName
(
drmDBConfig
.
getDriverClassName
());
dataSource
.
setDriverClassName
(
drmDBConfig
.
getDriverClassName
());
dataSource
.
setUrl
(
drmDBConfig
.
getUrl
());
dataSource
.
setUrl
(
drmDBConfig
.
getUrl
());
dataSource
.
setUsername
(
drmDBConfig
.
getUserName
());
dataSource
.
setUsername
(
drmDBConfig
.
getUserName
());
...
@@ -75,11 +76,11 @@ public class DataSourceConfiguration {
...
@@ -75,11 +76,11 @@ public class DataSourceConfiguration {
// 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
// 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
dataSource
.
setTimeBetweenEvictionRunsMillis
(
60000
);
dataSource
.
setTimeBetweenEvictionRunsMillis
(
60000
);
dataSource
.
setMinEvictableIdleTimeMillis
(
300000
);
dataSource
.
setMinEvictableIdleTimeMillis
(
300000
);
StatFilter
filter
=
new
StatFilter
();
//
StatFilter filter = new StatFilter();
filter
.
setSlowSqlMillis
(
5000
);
//
filter.setSlowSqlMillis(5000);
filter
.
setLogSlowSql
(
true
);
//
filter.setLogSlowSql(true);
filter
.
setMergeSql
(
true
);
//
filter.setMergeSql(true);
dataSource
.
setProxyFilters
(
Lists
.
newArrayList
(
filter
));
//
dataSource.setProxyFilters(Lists.newArrayList(filter));
return
dataSource
;
return
dataSource
;
}
}
...
...
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