Готова

This commit is contained in:
Pineapple 2023-04-03 12:29:00 +04:00
parent ee645d78cf
commit 2c6869c6db

View 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;
}
}