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
10afa777
Commit
10afa777
authored
Nov 05, 2018
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提供测试接口
parent
42bfc93d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
4 deletions
+22
-4
discovery-springcloud-example-service/src/main/java/com/nepxion/discovery/plugin/example/service/rest/ARestImpl.java
+8
-2
discovery-springcloud-example-service/src/main/java/com/nepxion/discovery/plugin/example/service/rest/BRestImpl.java
+8
-2
discovery-springcloud-example-service/src/main/java/com/nepxion/discovery/plugin/example/service/rest/CRestImpl.java
+6
-0
No files found.
discovery-springcloud-example-service/src/main/java/com/nepxion/discovery/plugin/example/service/rest/ARestImpl.java
View file @
10afa777
...
...
@@ -31,13 +31,18 @@ public class ARestImpl extends AbstractRestImpl {
private
RestTemplate
restTemplate
;
@RequestMapping
(
path
=
"/rest"
,
method
=
RequestMethod
.
POST
)
@SentinelResource
(
"sentinel-resource"
)
@SentinelResource
(
"sentinel-resource"
)
public
String
rest
(
@RequestBody
String
value
)
{
value
=
doRest
(
value
);
value
=
restTemplate
.
postForEntity
(
"http://discovery-springcloud-example-b/rest"
,
value
,
String
.
class
).
getBody
();
value
=
restTemplate
.
postForEntity
(
"http://discovery-springcloud-example-b/rest"
,
value
,
String
.
class
).
getBody
();
LOG
.
info
(
"调用路径:{}"
,
value
);
return
value
;
}
@RequestMapping
(
path
=
"/test"
,
method
=
RequestMethod
.
POST
)
public
String
test
(
@RequestBody
String
value
)
{
return
value
;
}
}
\ No newline at end of file
discovery-springcloud-example-service/src/main/java/com/nepxion/discovery/plugin/example/service/rest/BRestImpl.java
View file @
10afa777
...
...
@@ -31,13 +31,18 @@ public class BRestImpl extends AbstractRestImpl {
private
RestTemplate
restTemplate
;
@RequestMapping
(
path
=
"/rest"
,
method
=
RequestMethod
.
POST
)
@SentinelResource
(
"sentinel-resource"
)
@SentinelResource
(
"sentinel-resource"
)
public
String
rest
(
@RequestBody
String
value
)
{
value
=
doRest
(
value
);
value
=
restTemplate
.
postForEntity
(
"http://discovery-springcloud-example-c/rest"
,
value
,
String
.
class
).
getBody
();
value
=
restTemplate
.
postForEntity
(
"http://discovery-springcloud-example-c/rest"
,
value
,
String
.
class
).
getBody
();
LOG
.
info
(
"调用路径:{}"
,
value
);
return
value
;
}
@RequestMapping
(
path
=
"/test"
,
method
=
RequestMethod
.
POST
)
public
String
test
(
@RequestBody
String
value
)
{
return
value
;
}
}
\ No newline at end of file
discovery-springcloud-example-service/src/main/java/com/nepxion/discovery/plugin/example/service/rest/CRestImpl.java
View file @
10afa777
...
...
@@ -34,4 +34,9 @@ public class CRestImpl extends AbstractRestImpl {
return
value
;
}
@RequestMapping
(
path
=
"/test"
,
method
=
RequestMethod
.
POST
)
public
String
test
(
@RequestBody
String
value
)
{
return
value
;
}
}
\ 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