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
b1ccd7a7
Commit
b1ccd7a7
authored
Aug 12, 2018
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构类结构
parent
8a90fbe2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
27 deletions
+36
-27
discovery-plugin-admin-center/src/main/java/com/nepxion/discovery/plugin/admincenter/endpoint/ConfigEndpoint.java
+22
-18
discovery-plugin-admin-center/src/main/java/com/nepxion/discovery/plugin/admincenter/endpoint/VersionEndpoint.java
+14
-9
No files found.
discovery-plugin-admin-center/src/main/java/com/nepxion/discovery/plugin/admincenter/endpoint/ConfigEndpoint.java
View file @
b1ccd7a7
...
@@ -89,24 +89,7 @@ public class ConfigEndpoint {
...
@@ -89,24 +89,7 @@ public class ConfigEndpoint {
@ResponseBody
@ResponseBody
@ManagedOperation
@ManagedOperation
public
ResponseEntity
<
List
<
String
>>
view
()
{
public
ResponseEntity
<
List
<
String
>>
view
()
{
List
<
String
>
ruleList
=
new
ArrayList
<
String
>(
2
);
return
view
(
false
);
String
localRuleContent
=
StringUtils
.
EMPTY
;
RuleEntity
localRuleEntity
=
pluginAdapter
.
getLocalRule
();
if
(
localRuleEntity
!=
null
&&
StringUtils
.
isNotEmpty
(
localRuleEntity
.
getContent
()))
{
localRuleContent
=
localRuleEntity
.
getContent
();
}
String
dynamicRuleContent
=
StringUtils
.
EMPTY
;
RuleEntity
dynamicRuleEntity
=
pluginAdapter
.
getDynamicRule
();
if
(
dynamicRuleEntity
!=
null
&&
StringUtils
.
isNotEmpty
(
dynamicRuleEntity
.
getContent
()))
{
dynamicRuleContent
=
dynamicRuleEntity
.
getContent
();
}
ruleList
.
add
(
localRuleContent
);
ruleList
.
add
(
dynamicRuleContent
);
return
ResponseEntity
.
ok
().
body
(
ruleList
);
}
}
private
ResponseEntity
<?>
update
(
String
config
,
boolean
async
)
{
private
ResponseEntity
<?>
update
(
String
config
,
boolean
async
)
{
...
@@ -145,6 +128,27 @@ public class ConfigEndpoint {
...
@@ -145,6 +128,27 @@ public class ConfigEndpoint {
return
ResponseEntity
.
ok
().
body
(
"OK"
);
return
ResponseEntity
.
ok
().
body
(
"OK"
);
}
}
private
ResponseEntity
<
List
<
String
>>
view
(
boolean
async
)
{
List
<
String
>
ruleList
=
new
ArrayList
<
String
>(
2
);
String
localRuleContent
=
StringUtils
.
EMPTY
;
RuleEntity
localRuleEntity
=
pluginAdapter
.
getLocalRule
();
if
(
localRuleEntity
!=
null
&&
StringUtils
.
isNotEmpty
(
localRuleEntity
.
getContent
()))
{
localRuleContent
=
localRuleEntity
.
getContent
();
}
String
dynamicRuleContent
=
StringUtils
.
EMPTY
;
RuleEntity
dynamicRuleEntity
=
pluginAdapter
.
getDynamicRule
();
if
(
dynamicRuleEntity
!=
null
&&
StringUtils
.
isNotEmpty
(
dynamicRuleEntity
.
getContent
()))
{
dynamicRuleContent
=
dynamicRuleEntity
.
getContent
();
}
ruleList
.
add
(
localRuleContent
);
ruleList
.
add
(
dynamicRuleContent
);
return
ResponseEntity
.
ok
().
body
(
ruleList
);
}
protected
ResponseEntity
<
String
>
toExceptionResponseEntity
(
Exception
e
,
boolean
showDetail
)
{
protected
ResponseEntity
<
String
>
toExceptionResponseEntity
(
Exception
e
,
boolean
showDetail
)
{
String
message
=
null
;
String
message
=
null
;
if
(
showDetail
)
{
if
(
showDetail
)
{
...
...
discovery-plugin-admin-center/src/main/java/com/nepxion/discovery/plugin/admincenter/endpoint/VersionEndpoint.java
View file @
b1ccd7a7
...
@@ -88,15 +88,7 @@ public class VersionEndpoint {
...
@@ -88,15 +88,7 @@ public class VersionEndpoint {
@ResponseBody
@ResponseBody
@ManagedOperation
@ManagedOperation
public
ResponseEntity
<
List
<
String
>>
view
()
{
public
ResponseEntity
<
List
<
String
>>
view
()
{
List
<
String
>
versionList
=
new
ArrayList
<
String
>(
2
);
return
view
(
false
);
String
localVersion
=
pluginAdapter
.
getLocalVersion
();
String
dynamicVersion
=
pluginAdapter
.
getDynamicVersion
();
versionList
.
add
(
StringUtils
.
isNotEmpty
(
localVersion
)
?
localVersion
:
StringUtils
.
EMPTY
);
versionList
.
add
(
StringUtils
.
isNotEmpty
(
dynamicVersion
)
?
dynamicVersion
:
StringUtils
.
EMPTY
);
return
ResponseEntity
.
ok
().
body
(
versionList
);
}
}
private
ResponseEntity
<?>
update
(
String
version
,
boolean
async
)
{
private
ResponseEntity
<?>
update
(
String
version
,
boolean
async
)
{
...
@@ -141,4 +133,16 @@ public class VersionEndpoint {
...
@@ -141,4 +133,16 @@ public class VersionEndpoint {
return
ResponseEntity
.
ok
().
body
(
"OK"
);
return
ResponseEntity
.
ok
().
body
(
"OK"
);
}
}
private
ResponseEntity
<
List
<
String
>>
view
(
boolean
async
)
{
List
<
String
>
versionList
=
new
ArrayList
<
String
>(
2
);
String
localVersion
=
pluginAdapter
.
getLocalVersion
();
String
dynamicVersion
=
pluginAdapter
.
getDynamicVersion
();
versionList
.
add
(
StringUtils
.
isNotEmpty
(
localVersion
)
?
localVersion
:
StringUtils
.
EMPTY
);
versionList
.
add
(
StringUtils
.
isNotEmpty
(
dynamicVersion
)
?
dynamicVersion
:
StringUtils
.
EMPTY
);
return
ResponseEntity
.
ok
().
body
(
versionList
);
}
}
}
\ 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