Guest User

Untitled

a guest
Jan 20th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. @RestController
  2. public class ControllerA {
  3.  
  4. @RequestMapping(value = "/methodA", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
  5. public ResponseEntity<String> methodA(@RequestBody String something) {
  6. // some process
  7. return null;
  8. }
  9.  
  10. @RestController
  11. public class ControllerB {
  12.  
  13. @RequestMapping(value = "/methodB", consumes = org.springframework.http.MediaType.APPLICATION_JSON_VALUE)
  14. public ResponseEntity<String> methodA(@RequestBody String something) {
  15. // some process
  16. return null;
  17. }
  18.  
  19. @RestController
  20. public class ControllerC {
  21.  
  22. public ResponseEntity<String> methodC(@RequestBody String someReq) {
  23. if (checkPam(someReq)) {
  24. **// I want to call the ControllerA in serverA.**
  25. }else {
  26. **// I want to call the ControllerB in serverB.**
  27. }
  28. return null;
  29. }
Add Comment
Please, Sign In to add comment