This commit is contained in:
DozorovaA.A 2023-02-20 14:20:58 +04:00
parent 69c307f081
commit 8f133c177d

View File

@ -14,35 +14,5 @@ public class DozorovaLabWorkApplication {
SpringApplication.run(DozorovaLabWorkApplication.class, args); SpringApplication.run(DozorovaLabWorkApplication.class, args);
} }
@GetMapping("/")
public String Hello() {
return "Hello, user";
}
@GetMapping("/sum")
public String Sum(@RequestParam(required = false, defaultValue = "0") float first,
@RequestParam(required = false, defaultValue = "0") float second) {
return Float.toString(first + second);
}
@GetMapping("/ras")
public String Ras(@RequestParam(required = false, defaultValue = "0") float first,
@RequestParam(required = false, defaultValue = "0") float second) {
return Float.toString(first - second);
}
@GetMapping("/pros")
public String Pros(@RequestParam(required = false, defaultValue = "1") float first,
@RequestParam(required = false, defaultValue = "1") float second) {
return Float.toString(first * second);
}
@GetMapping("/del")
public String Del(@RequestParam(required = false, defaultValue = "1") float first,
@RequestParam(required = false, defaultValue = "1") float second) {
if(second == 0)
{
return null;
}
return Float.toString(first/second);
}
} }