This commit is contained in:
ker73rus 2023-03-06 23:15:45 +04:00
parent a8c8ec1bf8
commit aacaa682bc
2 changed files with 2 additions and 33 deletions

View File

@ -12,35 +12,4 @@ public class DemoApplication {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args); SpringApplication.run(DemoApplication.class, args);
} }
@GetMapping("/hello")
public String hello(@RequestParam(value = "name", defaultValue = "World") String name) {
return String.format("Hello %s!", name);
}
@GetMapping("/sum")
public String Sum(@RequestParam(defaultValue = "0") double first,
@RequestParam(defaultValue = "0") double second) {
return Double.toString(first + second);
}
@GetMapping("/minus")
public String Ras(@RequestParam(defaultValue = "0") double first,
@RequestParam(defaultValue = "0") double second) {
return Double.toString(first - second);
}
@GetMapping("/multi")
public String Pros(@RequestParam(defaultValue = "1") double first,
@RequestParam(defaultValue = "1") double second) {
return Double.toString(first * second);
}
@GetMapping("/div")
public String Del(@RequestParam(defaultValue = "1") double first,
@RequestParam(defaultValue = "1") double second) {
if (second == 0) {
return null;
}
return Double.toString(first / second);
}
} }

View File

@ -1,7 +1,7 @@
package method.service; package method.service;
import ip.labwork.method.domain.IMethod; import method.domain.IMethod;
import ip.labwork.method.domain.MethodString; import method.domain.MethodString;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;