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
ef092562
Commit
ef092562
authored
Jun 27, 2018
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改成功返回信息
parent
2e01c90b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
discovery-plugin-admin-center/src/main/java/com/nepxion/discovery/plugin/admincenter/endpoint/AdminEndpoint.java
+12
-11
No files found.
discovery-plugin-admin-center/src/main/java/com/nepxion/discovery/plugin/admincenter/endpoint/AdminEndpoint.java
View file @
ef092562
...
@@ -84,7 +84,7 @@ public class AdminEndpoint extends AbstractMvcEndpoint {
...
@@ -84,7 +84,7 @@ public class AdminEndpoint extends AbstractMvcEndpoint {
throw
new
PluginException
(
"To input stream failed"
,
e
);
throw
new
PluginException
(
"To input stream failed"
,
e
);
}
}
return
"
success
"
;
return
"
Send config successfully
"
;
}
}
@RequestMapping
(
path
=
"view"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
path
=
"view"
,
method
=
RequestMethod
.
GET
)
...
@@ -98,10 +98,10 @@ public class AdminEndpoint extends AbstractMvcEndpoint {
...
@@ -98,10 +98,10 @@ public class AdminEndpoint extends AbstractMvcEndpoint {
return
ruleEntity
.
getContent
();
return
ruleEntity
.
getContent
();
}
}
@RequestMapping
(
path
=
"
status
"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
path
=
"
deregister
"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ResponseBody
@ManagedOperation
@ManagedOperation
public
Object
status
(
@RequestBody
String
status
)
{
public
Object
deregister
(
)
{
Boolean
discoveryControlEnabled
=
pluginContextAware
.
isDiscoveryControlEnabled
();
Boolean
discoveryControlEnabled
=
pluginContextAware
.
isDiscoveryControlEnabled
();
if
(!
discoveryControlEnabled
)
{
if
(!
discoveryControlEnabled
)
{
return
new
ResponseEntity
<>(
Collections
.
singletonMap
(
"Message"
,
"Discovery control is disabled"
),
HttpStatus
.
NOT_FOUND
);
return
new
ResponseEntity
<>(
Collections
.
singletonMap
(
"Message"
,
"Discovery control is disabled"
),
HttpStatus
.
NOT_FOUND
);
...
@@ -111,17 +111,17 @@ public class AdminEndpoint extends AbstractMvcEndpoint {
...
@@ -111,17 +111,17 @@ public class AdminEndpoint extends AbstractMvcEndpoint {
throw
new
PluginException
(
"No registration found"
);
throw
new
PluginException
(
"No registration found"
);
}
}
serviceRegistry
.
setStatus
(
registration
,
status
);
serviceRegistry
.
deregister
(
registration
);
LOG
.
info
(
"
Set status for serviceId={} status={} successfully"
,
registration
.
getServiceId
(),
status
);
LOG
.
info
(
"
Deregister for serviceId={} successfully"
,
registration
.
getServiceId
()
);
return
"
success
"
;
return
"
Deregister successfully
"
;
}
}
@RequestMapping
(
path
=
"
deregister
"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
path
=
"
status
"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ResponseBody
@ManagedOperation
@ManagedOperation
public
Object
deregister
(
)
{
public
Object
status
(
@RequestBody
String
status
)
{
Boolean
discoveryControlEnabled
=
pluginContextAware
.
isDiscoveryControlEnabled
();
Boolean
discoveryControlEnabled
=
pluginContextAware
.
isDiscoveryControlEnabled
();
if
(!
discoveryControlEnabled
)
{
if
(!
discoveryControlEnabled
)
{
return
new
ResponseEntity
<>(
Collections
.
singletonMap
(
"Message"
,
"Discovery control is disabled"
),
HttpStatus
.
NOT_FOUND
);
return
new
ResponseEntity
<>(
Collections
.
singletonMap
(
"Message"
,
"Discovery control is disabled"
),
HttpStatus
.
NOT_FOUND
);
...
@@ -131,10 +131,10 @@ public class AdminEndpoint extends AbstractMvcEndpoint {
...
@@ -131,10 +131,10 @@ public class AdminEndpoint extends AbstractMvcEndpoint {
throw
new
PluginException
(
"No registration found"
);
throw
new
PluginException
(
"No registration found"
);
}
}
serviceRegistry
.
deregister
(
registration
);
serviceRegistry
.
setStatus
(
registration
,
status
);
LOG
.
info
(
"
Deregister for serviceId={} successfully"
,
registration
.
getServiceId
()
);
LOG
.
info
(
"
Set status for serviceId={} status={} successfully"
,
registration
.
getServiceId
(),
status
);
return
"
success
"
;
return
"
Set status successfully
"
;
}
}
}
}
\ No newline at end of file
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