Skip to content

Commit

Permalink
feat:optimize quickstart feign examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyeBeFreeman committed Oct 19, 2023
1 parent af1134a commit 9b295cf
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ public class QuickstartCalleeController {
* @return sum
*/
@GetMapping("/sum")
public int sum(@RequestParam int value1, @RequestParam int value2) {
public String sum(@RequestParam int value1, @RequestParam int value2) {
LOG.info("Quickstart Callee Service [{}:{}] is called and sum is [{}].", ip, port, value1 + value2);
return value1 + value2;
return String.format("Quickstart Callee Service [%s:%s] is called and sum is [%s].", ip, port, value1 + value2);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ public class QuickstartCalleeController {
* @return sum
*/
@GetMapping("/sum")
public int sum(@RequestParam int value1, @RequestParam int value2) {
public String sum(@RequestParam int value1, @RequestParam int value2) {
LOG.info("Quickstart Callee Service [{}:{}] is called and sum is [{}].", ip, port, value1 + value2);
return value1 + value2;
return String.format("Quickstart Callee Service [%s:%s] is called and sum is [%s].", ip, port, value1 + value2);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ public interface QuickstartCalleeService {
* @return sum
*/
@GetMapping("/quickstart/callee/sum")
int sum(@RequestParam("value1") int value1, @RequestParam("value2") int value2);
String sum(@RequestParam("value1") int value1, @RequestParam("value2") int value2);
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
public class QuickstartCalleeServiceFallback implements QuickstartCalleeService {

@Override
public int sum(int value1, int value2) {
return 0;
public String sum(int value1, int value2) {
return "sum is 0.";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class QuickstartCallerController {
* @return sum
*/
@GetMapping("/feign")
public int feign(@RequestParam int value1, @RequestParam int value2) {
public String feign(@RequestParam int value1, @RequestParam int value2) {
return quickstartCalleeService.sum(value1, value2);
}

Expand Down

0 comments on commit 9b295cf

Please sign in to comment.