Готова
This commit is contained in:
parent
ee645d78cf
commit
2c6869c6db
35
src/main/java/com/example/demo/Controller/Controllers.java
Normal file
35
src/main/java/com/example/demo/Controller/Controllers.java
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
|
||||||
|
|
||||||
|
package com.example.demo.Controller;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@CrossOrigin
|
||||||
|
public class Controllers {
|
||||||
|
@GetMapping("/plus")
|
||||||
|
public @ResponseBody Integer Plus (@RequestParam (required = false, defaultValue = "0") int val1,
|
||||||
|
@RequestParam (required = false, defaultValue = "0") int val2){
|
||||||
|
return val1 + val2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/minus")
|
||||||
|
public @ResponseBody Integer Minus (@RequestParam (required = false, defaultValue = "0") int val1,
|
||||||
|
@RequestParam (required = false, defaultValue = "0") int val2){
|
||||||
|
return val1 - val2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/mult")
|
||||||
|
public @ResponseBody Integer Mult (@RequestParam (required = false, defaultValue = "0") int val1,
|
||||||
|
@RequestParam (required = false, defaultValue = "0") int val2){
|
||||||
|
return val1 * val2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/div")
|
||||||
|
public @ResponseBody Integer Div (@RequestParam (required = false, defaultValue = "0") int val1,
|
||||||
|
@RequestParam (required = false, defaultValue = "1") int val2){
|
||||||
|
return val1 / val2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user