Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
discovery
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
谢捷峰
discovery
Commits
9d0feadb
Commit
9d0feadb
authored
Jul 02, 2018
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改变量名
parent
6beb247a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
discovery-plugin-router-center/src/main/java/com/nepxion/discovery/plugin/routercenter/controller/RouterController.java
+10
-10
No files found.
discovery-plugin-router-center/src/main/java/com/nepxion/discovery/plugin/routercenter/controller/RouterController.java
View file @
9d0feadb
...
...
@@ -76,10 +76,10 @@ public class RouterController {
return
getRouterEntityList
(
routeServiceId
,
routeHost
,
routePort
);
}
// 获取全路径的路由信息(
s
erviceIds按调用服务名的前后次序排列,起始节点的服务名不能加上去。如果多个用“;”分隔,不允许出现空格)
// 获取全路径的路由信息(
routeS
erviceIds按调用服务名的前后次序排列,起始节点的服务名不能加上去。如果多个用“;”分隔,不允许出现空格)
@RequestMapping
(
path
=
"/routeAll"
,
method
=
RequestMethod
.
POST
)
public
RouterEntity
routeAll
(
@RequestBody
String
s
erviceIds
)
{
return
executeRouteAll
(
s
erviceIds
);
public
RouterEntity
routeAll
(
@RequestBody
String
routeS
erviceIds
)
{
return
executeRouteAll
(
routeS
erviceIds
);
}
public
List
<
ServiceInstance
>
getInstanceList
(
String
serviceId
)
{
...
...
@@ -107,7 +107,7 @@ public class RouterController {
try
{
instanceList
=
getInstanceList
(
routeServiceId
);
}
catch
(
Exception
e
)
{
throw
new
PluginException
(
"Get instance list for serviceId="
+
routeServiceId
+
" failed"
,
e
);
throw
new
PluginException
(
"Get instance list for
route
serviceId="
+
routeServiceId
+
" failed"
,
e
);
}
if
(
CollectionUtils
.
isEmpty
(
instanceList
))
{
...
...
@@ -141,7 +141,7 @@ public class RouterController {
try
{
instanceList
=
routerRestTemplate
.
getForEntity
(
url
,
List
.
class
).
getBody
();
}
catch
(
RestClientException
e
)
{
throw
new
PluginException
(
"Get instance list for serviceId="
+
routeServiceId
+
" with url="
+
url
+
" failed"
,
e
);
throw
new
PluginException
(
"Get instance list for
route
serviceId="
+
routeServiceId
+
" with url="
+
url
+
" failed"
,
e
);
}
if
(
CollectionUtils
.
isEmpty
(
instanceList
))
{
...
...
@@ -167,16 +167,16 @@ public class RouterController {
return
routerEntityList
;
}
public
RouterEntity
executeRouteAll
(
String
s
erviceIds
)
{
if
(
StringUtils
.
isEmpty
(
s
erviceIds
))
{
throw
new
PluginException
(
"
Service i
ds is empty"
);
public
RouterEntity
executeRouteAll
(
String
routeS
erviceIds
)
{
if
(
StringUtils
.
isEmpty
(
routeS
erviceIds
))
{
throw
new
PluginException
(
"
Route serviceI
ds is empty"
);
}
String
[]
serviceIdArray
=
null
;
try
{
serviceIdArray
=
StringUtils
.
split
(
s
erviceIds
,
PluginConstant
.
SEPARATE
);
serviceIdArray
=
StringUtils
.
split
(
routeS
erviceIds
,
PluginConstant
.
SEPARATE
);
}
catch
(
Exception
e
)
{
throw
new
PluginException
(
"
Service i
ds must be separated with '"
+
PluginConstant
.
SEPARATE
+
"'"
,
e
);
throw
new
PluginException
(
"
Route serviceI
ds must be separated with '"
+
PluginConstant
.
SEPARATE
+
"'"
,
e
);
}
RouterEntity
firstRouterEntity
=
getRouterEntity
();
...
...
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