Skip to content

Commit

Permalink
Merge pull request #33 from yangyy93/add-some-api
Browse files Browse the repository at this point in the history
add return-body and custom-return-size
  • Loading branch information
Frapschen authored Jul 15, 2024
2 parents e2fba8a + e18ce5d commit db80204
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -161,4 +162,17 @@ public Mono<String> healthz() throws UnknownHostException {
return Mono.just("ok");
}

@RequestMapping(value = "return-body", method = RequestMethod.POST)
public Mono<String> returnBody(@RequestBody String body) {
return Mono.just(body);
}

@RequestMapping("/custom-return-size")
public Mono<String> customReturnSize(@RequestParam(required = false,defaultValue = "10") Long size){
char[] chars = new char[size.intValue()];
Arrays.fill(chars, 'a');
return Mono.just(new String(chars));
}


}

0 comments on commit db80204

Please sign in to comment.