BAEL-1178: changing variable type from String to Integer (#3700)
This commit is contained in:
parent
5c181c4b72
commit
d9fddbde78
|
@ -16,7 +16,7 @@ public class BasicMathController {
|
|||
private RestTemplate restTemplate;
|
||||
|
||||
@GetMapping("/calculate")
|
||||
public String checkOddAndEven(@RequestParam("number") String number) {
|
||||
public String checkOddAndEven(@RequestParam("number") Integer number) {
|
||||
HttpHeaders httpHeaders = new HttpHeaders();
|
||||
httpHeaders.add("Content-Type", "application/json");
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
public class EvenOddController {
|
||||
|
||||
@GetMapping("/validate/prime-number")
|
||||
public String isNumberPrime(@RequestParam("number") String number) {
|
||||
return Integer.parseInt(number) % 2 == 0 ? "Even" : "Odd";
|
||||
public String isNumberPrime(@RequestParam("number") Integer number) {
|
||||
return number % 2 == 0 ? "Even" : "Odd";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue