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
e370702d
Commit
e370702d
authored
Aug 20, 2021
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify namespace
parent
0cd4a0f6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
8 deletions
+24
-8
SwitchDataSource.java
src/main/java/cn/qg/qaplatform/config/SwitchDataSource.java
+21
-6
Namespace.java
src/main/java/cn/qg/qaplatform/enums/Namespace.java
+3
-2
No files found.
src/main/java/cn/qg/qaplatform/config/SwitchDataSource.java
View file @
e370702d
...
@@ -113,15 +113,15 @@ public class SwitchDataSource {
...
@@ -113,15 +113,15 @@ public class SwitchDataSource {
}
}
/**
/**
* test
3
环境
* test
4
环境
*/
*/
if
(
namespace
.
equals
(
"test
3
"
))
{
if
(
namespace
.
equals
(
"test
4
"
))
{
DruidDataSource
druidDataSource
=
new
DruidDataSource
();
DruidDataSource
druidDataSource
=
new
DruidDataSource
();
String
url
=
Namespace
.
TEST
3
.
getUrl
()
+
database
+
SUFFIX
;
String
url
=
Namespace
.
TEST
4
.
getUrl
()
+
database
+
SUFFIX
;
String
dbKey
=
Namespace
.
TEST
3
.
getKey
();
String
dbKey
=
Namespace
.
TEST
4
.
getKey
();
druidDataSource
.
setUrl
(
url
);
druidDataSource
.
setUrl
(
url
);
druidDataSource
.
setUsername
(
Namespace
.
TEST
3
.
getUsername
());
druidDataSource
.
setUsername
(
Namespace
.
TEST
4
.
getUsername
());
druidDataSource
.
setPassword
(
Namespace
.
TEST
3
.
getPassword
());
druidDataSource
.
setPassword
(
Namespace
.
TEST
4
.
getPassword
());
DynamicDataSource
.
dataSourcesMap
.
put
(
dbKey
,
druidDataSource
);
DynamicDataSource
.
dataSourcesMap
.
put
(
dbKey
,
druidDataSource
);
DynamicDataSource
.
setDataSource
(
dbKey
);
DynamicDataSource
.
setDataSource
(
dbKey
);
}
}
...
@@ -237,5 +237,20 @@ public class SwitchDataSource {
...
@@ -237,5 +237,20 @@ public class SwitchDataSource {
DynamicDataSource
.
dataSourcesMap
.
put
(
dbKey
,
druidDataSource
);
DynamicDataSource
.
dataSourcesMap
.
put
(
dbKey
,
druidDataSource
);
DynamicDataSource
.
setDataSource
(
dbKey
);
DynamicDataSource
.
setDataSource
(
dbKey
);
}
}
/**
* k8s 环境
*/
if
(
namespace
.
equals
(
"k8s"
))
{
DruidDataSource
druidDataSource
=
new
DruidDataSource
();
String
url
=
Namespace
.
K8S
.
getUrl
()
+
database
+
SUFFIX
;
String
dbKey
=
Namespace
.
K8S
.
getKey
();
druidDataSource
.
setUrl
(
url
);
druidDataSource
.
setUsername
(
Namespace
.
K8S
.
getUsername
());
druidDataSource
.
setPassword
(
Namespace
.
K8S
.
getPassword
());
DynamicDataSource
.
dataSourcesMap
.
put
(
dbKey
,
druidDataSource
);
DynamicDataSource
.
setDataSource
(
dbKey
);
}
}
}
}
}
src/main/java/cn/qg/qaplatform/enums/Namespace.java
View file @
e370702d
...
@@ -9,7 +9,7 @@ public enum Namespace {
...
@@ -9,7 +9,7 @@ public enum Namespace {
QA3
(
"qa3"
,
"qa3"
,
"jdbc:mysql://172.17.5.14:32659/"
,
"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"
),
TEST1
(
"test1"
,
"test1"
,
"jdbc:mysql://172.17.5.14:31548/"
,
"qa"
,
"qatest"
),
TEST2
(
"test2"
,
"test2"
,
"jdbc:mysql://172.17.5.33:30249/"
,
"qa"
,
"qatest"
),
TEST2
(
"test2"
,
"test2"
,
"jdbc:mysql://172.17.5.33:30249/"
,
"qa"
,
"qatest"
),
TEST
3
(
"test3"
,
"test3
"
,
"jdbc:mysql://172.17.5.23:31381/"
,
"qa"
,
"qatest"
),
TEST
4
(
"test4"
,
"test4
"
,
"jdbc:mysql://172.17.5.23:31381/"
,
"qa"
,
"qatest"
),
TEST5
(
"test5"
,
"test5"
,
"jdbc:mysql://172.17.5.33:32032/"
,
"qa"
,
"qatest"
),
TEST5
(
"test5"
,
"test5"
,
"jdbc:mysql://172.17.5.33:32032/"
,
"qa"
,
"qatest"
),
XJFQ
(
"xjfq"
,
"xjfq"
,
"jdbc:mysql://172.17.5.8:32188/"
,
"qa"
,
"qatest"
),
XJFQ
(
"xjfq"
,
"xjfq"
,
"jdbc:mysql://172.17.5.8:32188/"
,
"qa"
,
"qatest"
),
XYQB
(
"xyqb"
,
"xyqb"
,
"jdbc:mysql://172.17.5.12:31679/"
,
"qa"
,
"qatest"
),
XYQB
(
"xyqb"
,
"xyqb"
,
"jdbc:mysql://172.17.5.12:31679/"
,
"qa"
,
"qatest"
),
...
@@ -17,7 +17,8 @@ public enum Namespace {
...
@@ -17,7 +17,8 @@ public enum Namespace {
VCC
(
"vcc"
,
"vcc"
,
"jdbc:mysql://172.17.5.8:31110/"
,
"qa"
,
"qatest"
),
VCC
(
"vcc"
,
"vcc"
,
"jdbc:mysql://172.17.5.8:31110/"
,
"qa"
,
"qatest"
),
VCC2
(
"vcc2"
,
"vcc2"
,
"jdbc:mysql://172.17.5.12:30977/"
,
"qa"
,
"qatest"
),
VCC2
(
"vcc2"
,
"vcc2"
,
"jdbc:mysql://172.17.5.12:30977/"
,
"qa"
,
"qatest"
),
VCC3
(
"vcc3"
,
"vcc3"
,
"jdbc:mysql://172.17.5.17:31393/"
,
"qa"
,
"qatest"
),
VCC3
(
"vcc3"
,
"vcc3"
,
"jdbc:mysql://172.17.5.17:31393/"
,
"qa"
,
"qatest"
),
TOB
(
"tob"
,
"tob"
,
"jdbc:mysql://172.17.6.15:32374/"
,
"qa"
,
"qatest"
);
TOB
(
"tob"
,
"tob"
,
"jdbc:mysql://172.17.6.15:32374/"
,
"qa"
,
"qatest"
),
K8S
(
"k8s"
,
"k8s"
,
"jdbc:mysql://172.17.5.23:31381/"
,
"qa"
,
"qatest"
);
private
String
key
;
private
String
key
;
private
String
desc
;
private
String
desc
;
...
...
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