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
1cf1a67b
Commit
1cf1a67b
authored
May 07, 2025
by
韩兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: 调整配置值
parent
fac36c9e
Pipeline
#75037
passed with stages
in 32 minutes 17 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
29 deletions
+24
-29
pom.xml
pom.xml
+7
-7
pom.xml
yanxuan-qc-change-system-dal/pom.xml
+4
-4
DataSourceConfiguration.java
...il/yanxuan/change/dal/config/DataSourceConfiguration.java
+13
-18
No files found.
pom.xml
View file @
1cf1a67b
...
...
@@ -63,7 +63,7 @@
<commons.lang.version>
2.4
</commons.lang.version>
<des.version>
1.0.2-SNAPSHOT
</des.version>
<mapstruct.version>
1.3.1.Final
</mapstruct.version>
<
pandora.version>
1.1.0-SNAPSHOT
</pandora.version
>
<
!--<pandora.version>1.1.0-SNAPSHOT</pandora.version>--
>
</properties>
<!-- 子模块可选依赖 -->
...
...
@@ -191,12 +191,12 @@
<artifactId>
druid
</artifactId>
<version>
${druid.version}
</version>
</dependency>
<!--
引入潘多拉
-->
<
dependency
>
<
groupId>
com.netease.yanxuan
</groupId
>
<
artifactId>
pandora
</artifactId
>
<
version>
${pandora.version}
</version
>
<
/dependency
>
<!--
<!–引入潘多拉–>
-->
<
!--<dependency>--
>
<
!--<groupId>com.netease.yanxuan</groupId>--
>
<
!--<artifactId>pandora</artifactId>--
>
<
!--<version>${pandora.version}</version>--
>
<
!--</dependency>--
>
<!-- store-redis -->
<dependency>
...
...
yanxuan-qc-change-system-dal/pom.xml
View file @
1cf1a67b
...
...
@@ -30,10 +30,10 @@
<groupId>
com.alibaba
</groupId>
<artifactId>
druid
</artifactId>
</dependency>
<
dependency
>
<
groupId>
com.netease.yanxuan
</groupId
>
<
artifactId>
pandora
</artifactId
>
<
/dependency
>
<
!--<dependency>--
>
<
!--<groupId>com.netease.yanxuan</groupId>--
>
<
!--<artifactId>pandora</artifactId>--
>
<
!--</dependency>--
>
<!--store-redis-->
<dependency>
...
...
yanxuan-qc-change-system-dal/src/main/java/com/netease/mail/yanxuan/change/dal/config/DataSourceConfiguration.java
View file @
1cf1a67b
...
...
@@ -3,11 +3,7 @@ package com.netease.mail.yanxuan.change.dal.config;
import
com.alibaba.druid.filter.stat.StatFilter
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig
;
import
com.google.common.collect.ImmutableSet
;
import
com.google.common.collect.Lists
;
import
com.netease.yanxuan.pandora.DataSourceRefresher
;
import
com.netease.yanxuan.pandora.spring.annotation.EnableDataSourceRefresh
;
import
org.apache.ibatis.session.SqlSessionFactory
;
import
org.mybatis.spring.SqlSessionFactoryBean
;
import
org.mybatis.spring.SqlSessionTemplate
;
...
...
@@ -23,34 +19,33 @@ import org.springframework.transaction.PlatformTransactionManager;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
javax.sql.DataSource
;
import
java.util.Set
;
/**
* @author hzfengyuexin@corp.netease.com
*/
@Configuration
@EnableTransactionManagement
@EnableApolloConfig
(
"db-public"
)
@EnableDataSourceRefresh
//
@EnableApolloConfig("db-public")
//
@EnableDataSourceRefresh
@MapperScan
(
basePackages
=
"com.netease.mail.yanxuan.change.dal.mapper"
,
sqlSessionFactoryRef
=
"sqlSessionFactoryBean"
)
public
class
DataSourceConfiguration
{
@Autowired
private
DrmDBConfig
drmDBConfig
;
/**
* pandora热切换数据源
* */
@Bean
public
DataSourceRefresher
dataSourceRefresher
()
{
DataSourceRefresher
dataSourceRefresher
=
new
DataSourceRefresher
(
"db-public"
);
Set
<
String
>
dataSource
=
ImmutableSet
.
of
(
"db.url"
,
"db.driverClassName"
,
"db.username"
,
"db.password"
);
dataSourceRefresher
.
bindDataSourceWithPropertyKey
(
"dataSource"
,
dataSource
);
return
dataSourceRefresher
;
}
//
/**
////
* pandora热切换数据源
////
* */
////
@Bean
////
public DataSourceRefresher dataSourceRefresher() {
////
DataSourceRefresher dataSourceRefresher = new DataSourceRefresher("db-public");
////
Set<String> dataSource = ImmutableSet.of("db.url", "db.driverClassName", "db.username", "db.password");
////
dataSourceRefresher.bindDataSourceWithPropertyKey("dataSource", dataSource);
////
return dataSourceRefresher;
////
}
/**
*
merchant-order-db
数据源
* 数据源
*/
@Bean
(
name
=
"dataSource"
)
@Primary
...
...
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