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
e38c7baf
Commit
e38c7baf
authored
Jun 28, 2018
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化逻辑
parent
42297028
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
19 deletions
+3
-19
discovery-plugin-admin-center/src/main/java/com/nepxion/discovery/plugin/admincenter/endpoint/AdminEndpoint.java
+3
-19
No files found.
discovery-plugin-admin-center/src/main/java/com/nepxion/discovery/plugin/admincenter/endpoint/AdminEndpoint.java
View file @
e38c7baf
...
...
@@ -64,6 +64,7 @@ public class AdminEndpoint extends AbstractMvcEndpoint {
this
.
registration
=
registration
;
}
// 发送规则配置信息
@RequestMapping
(
path
=
"config"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ManagedOperation
...
...
@@ -73,10 +74,6 @@ public class AdminEndpoint extends AbstractMvcEndpoint {
return
new
ResponseEntity
<>(
Collections
.
singletonMap
(
"Message"
,
"Discovery control is disabled"
),
HttpStatus
.
NOT_FOUND
);
}
if
(
registration
==
null
)
{
throw
new
PluginException
(
"No registration found"
);
}
try
{
InputStream
inputStream
=
IOUtils
.
toInputStream
(
config
,
PluginConstant
.
ENCODING_UTF_8
);
pluginPublisher
.
asyncPublish
(
inputStream
);
...
...
@@ -87,14 +84,11 @@ public class AdminEndpoint extends AbstractMvcEndpoint {
return
"success"
;
}
// 查看当前生效的规则配置信息
@RequestMapping
(
path
=
"view"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ManagedOperation
public
Object
view
()
{
if
(
registration
==
null
)
{
throw
new
PluginException
(
"No registration found"
);
}
public
String
view
()
{
return
ruleEntity
.
getContent
();
}
...
...
@@ -102,11 +96,6 @@ public class AdminEndpoint extends AbstractMvcEndpoint {
@ResponseBody
@ManagedOperation
public
Object
deregister
()
{
Boolean
discoveryControlEnabled
=
pluginContextAware
.
isDiscoveryControlEnabled
();
if
(!
discoveryControlEnabled
)
{
return
new
ResponseEntity
<>(
Collections
.
singletonMap
(
"Message"
,
"Discovery control is disabled"
),
HttpStatus
.
NOT_FOUND
);
}
if
(
registration
==
null
)
{
throw
new
PluginException
(
"No registration found"
);
}
...
...
@@ -122,11 +111,6 @@ public class AdminEndpoint extends AbstractMvcEndpoint {
@ResponseBody
@ManagedOperation
public
Object
status
(
@RequestBody
String
status
)
{
Boolean
discoveryControlEnabled
=
pluginContextAware
.
isDiscoveryControlEnabled
();
if
(!
discoveryControlEnabled
)
{
return
new
ResponseEntity
<>(
Collections
.
singletonMap
(
"Message"
,
"Discovery control is disabled"
),
HttpStatus
.
NOT_FOUND
);
}
if
(
registration
==
null
)
{
throw
new
PluginException
(
"No registration found"
);
}
...
...
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