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
4ed4a6b4
Commit
4ed4a6b4
authored
Apr 27, 2021
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增test2,test3环境
parent
570812f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
SwitchDataSource.java
src/main/java/cn/qg/qaplatform/config/SwitchDataSource.java
+28
-0
Namespace.java
src/main/java/cn/qg/qaplatform/enums/Namespace.java
+2
-0
No files found.
src/main/java/cn/qg/qaplatform/config/SwitchDataSource.java
View file @
4ed4a6b4
...
...
@@ -98,6 +98,34 @@ public class SwitchDataSource {
DynamicDataSource
.
setDataSource
(
dbKey
);
}
/**
* test2 环境
*/
if
(
namespace
.
equals
(
"test2"
))
{
DruidDataSource
druidDataSource
=
new
DruidDataSource
();
String
url
=
Namespace
.
TEST2
.
getUrl
()
+
database
+
SUFFIX
;
String
dbKey
=
Namespace
.
TEST2
.
getKey
();
druidDataSource
.
setUrl
(
url
);
druidDataSource
.
setUsername
(
Namespace
.
TEST2
.
getUsername
());
druidDataSource
.
setPassword
(
Namespace
.
TEST2
.
getPassword
());
DynamicDataSource
.
dataSourcesMap
.
put
(
dbKey
,
druidDataSource
);
DynamicDataSource
.
setDataSource
(
dbKey
);
}
/**
* test3 环境
*/
if
(
namespace
.
equals
(
"test3"
))
{
DruidDataSource
druidDataSource
=
new
DruidDataSource
();
String
url
=
Namespace
.
TEST3
.
getUrl
()
+
database
+
SUFFIX
;
String
dbKey
=
Namespace
.
TEST3
.
getKey
();
druidDataSource
.
setUrl
(
url
);
druidDataSource
.
setUsername
(
Namespace
.
TEST3
.
getUsername
());
druidDataSource
.
setPassword
(
Namespace
.
TEST3
.
getPassword
());
DynamicDataSource
.
dataSourcesMap
.
put
(
dbKey
,
druidDataSource
);
DynamicDataSource
.
setDataSource
(
dbKey
);
}
/**
* xjfq 环境
*/
...
...
src/main/java/cn/qg/qaplatform/enums/Namespace.java
View file @
4ed4a6b4
...
...
@@ -8,6 +8,8 @@ public enum Namespace {
QA2
(
"qa2"
,
"qa2"
,
"jdbc:mysql://172.17.5.5:31905/"
,
"qa"
,
"qatest"
),
QA3
(
"qa3"
,
"qa3"
,
"jdbc:mysql://172.17.5.14:32659/"
,
"qa"
,
"qatest"
),
TEST1
(
"test1"
,
"test1"
,
"jdbc:mysql://172.17.5.14:31548/"
,
"qa"
,
"qatest"
),
TEST2
(
"test2"
,
"test2"
,
"jdbc:mysql://172.17.5.13:30190/"
,
"qa"
,
"qatest"
),
TEST3
(
"test3"
,
"test3"
,
"jdbc:mysql://172.17.5.23:31381/"
,
"qa"
,
"qatest"
),
XJFQ
(
"xjfq"
,
"xjfq"
,
"jdbc:mysql://172.17.5.8:32188/"
,
"qa"
,
"qatest"
),
XYQB
(
"xyqb"
,
"xyqb"
,
"jdbc:mysql://172.17.5.5:32556/"
,
"qa"
,
"qatest"
),
FE
(
"fe"
,
"fe"
,
"jdbc:mysql://172.17.5.9:31024/"
,
"qa"
,
"qatest"
),
...
...
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