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
6f2e87b6
Commit
6f2e87b6
authored
Jul 08, 2018
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加获取服务列表接口
parent
b67c57ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
discovery-plugin-router-center/src/main/java/com/nepxion/discovery/plugin/routercenter/controller/RouterController.java
+10
-0
No files found.
discovery-plugin-router-center/src/main/java/com/nepxion/discovery/plugin/routercenter/controller/RouterController.java
View file @
6f2e87b6
...
@@ -57,6 +57,12 @@ public class RouterController {
...
@@ -57,6 +57,12 @@ public class RouterController {
@Autowired
@Autowired
private
DiscoveryClient
discoveryClient
;
private
DiscoveryClient
discoveryClient
;
@RequestMapping
(
path
=
"/services"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
value
=
"获取服务注册中心所有服务列表"
,
notes
=
""
,
response
=
List
.
class
,
httpMethod
=
"GET"
)
public
List
<
String
>
services
()
{
return
getServices
();
}
@RequestMapping
(
path
=
"/instances/{serviceId}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
path
=
"/instances/{serviceId}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
value
=
"获取本地节点可访问其他节点(根据服务名)的实例列表"
,
notes
=
""
,
response
=
List
.
class
,
httpMethod
=
"GET"
)
@ApiOperation
(
value
=
"获取本地节点可访问其他节点(根据服务名)的实例列表"
,
notes
=
""
,
response
=
List
.
class
,
httpMethod
=
"GET"
)
public
List
<
ServiceInstance
>
instances
(
@PathVariable
(
value
=
"serviceId"
)
@ApiParam
(
value
=
"目标服务名"
,
required
=
true
)
String
serviceId
)
{
public
List
<
ServiceInstance
>
instances
(
@PathVariable
(
value
=
"serviceId"
)
@ApiParam
(
value
=
"目标服务名"
,
required
=
true
)
String
serviceId
)
{
...
@@ -87,6 +93,10 @@ public class RouterController {
...
@@ -87,6 +93,10 @@ public class RouterController {
return
routeTree
(
routeServiceIds
);
return
routeTree
(
routeServiceIds
);
}
}
public
List
<
String
>
getServices
()
{
return
discoveryClient
.
getServices
();
}
public
List
<
ServiceInstance
>
getInstanceList
(
String
serviceId
)
{
public
List
<
ServiceInstance
>
getInstanceList
(
String
serviceId
)
{
return
discoveryClient
.
getInstances
(
serviceId
);
return
discoveryClient
.
getInstances
(
serviceId
);
}
}
...
...
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