Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qa-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
QA
qa-platform
Commits
38a83471
Commit
38a83471
authored
Aug 17, 2020
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改配置
parent
ecbcce34
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
SwitchDataSource.java
src/main/java/cn/qg/qaplatform/common/SwitchDataSource.java
+15
-1
application.yml
src/main/resources/application.yml
+1
-1
No files found.
src/main/java/cn/qg/qaplatform/common/SwitchDataSource.java
View file @
38a83471
...
...
@@ -16,7 +16,7 @@ public class SwitchDataSource {
public
static
void
dataSourceSwitch
(
String
namespace
,
String
database
)
{
/**
*
PRE
环境
*
pre
环境
*/
if
(
namespace
.
equals
(
"pre"
))
{
DruidDataSource
druidDataSource
=
new
DruidDataSource
();
...
...
@@ -126,5 +126,19 @@ public class SwitchDataSource {
DynamicDataSource
.
dataSourcesMap
.
put
(
dbKey
,
druidDataSource
);
DynamicDataSource
.
setDataSource
(
dbKey
);
}
/**
* vcc环境
*/
if
(
namespace
.
equals
(
"vcc"
))
{
DruidDataSource
druidDataSource
=
new
DruidDataSource
();
String
url
=
Namespace
.
VCC
.
getUrl
()
+
database
+
SUFFIX
;
String
dbKey
=
Namespace
.
VCC
.
getKey
();
druidDataSource
.
setUrl
(
url
);
druidDataSource
.
setUsername
(
Namespace
.
VCC
.
getUsername
());
druidDataSource
.
setPassword
(
Namespace
.
VCC
.
getPassword
());
DynamicDataSource
.
dataSourcesMap
.
put
(
dbKey
,
druidDataSource
);
DynamicDataSource
.
setDataSource
(
dbKey
);
}
}
}
src/main/resources/application.yml
View file @
38a83471
...
...
@@ -41,6 +41,6 @@ pagehelper:
logging
:
level
:
root
:
info
cn.qg.qaplatform
:
debug
cn.qg.qaplatform
:
info
file
:
name
:
/home/quant_group/logs/qa-platform.log
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