36 lines
1.4 KiB
Java
36 lines
1.4 KiB
Java
package com.webproglabs.lab1.lab2.controllers;
|
|
|
|
import com.webproglabs.lab1.lab2.Lab2Service;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
@RestController
|
|
public class Lab2Controller {
|
|
private final Lab2Service lab2Service;
|
|
|
|
public Lab2Controller(Lab2Service lab2Service) {this.lab2Service = lab2Service;}
|
|
|
|
@GetMapping("/lab2/sum")
|
|
public Object sum(@RequestParam (value = "first", defaultValue = "hello") String first,
|
|
@RequestParam (value = "second", defaultValue = "world") String second,
|
|
@RequestParam (value = "type") String type) {
|
|
return lab2Service.sum(first, second, type);
|
|
}
|
|
|
|
@GetMapping("/lab2/makeitbigger")
|
|
public Object makeItBigger(@RequestParam (value = "small") String small, @RequestParam (value = "type") String type) {
|
|
return lab2Service.makeItBigger(small, type);
|
|
}
|
|
|
|
@GetMapping("/lab2/reverse")
|
|
public Object reverse(@RequestParam(value="value")String value, @RequestParam (value = "type") String type) {
|
|
return lab2Service.reverse(value, type);
|
|
}
|
|
|
|
@GetMapping("lab2/lenght")
|
|
public Object lenght(@RequestParam(value = "value") String value, @RequestParam (value = "type") String type) {
|
|
return lab2Service.lenght(value, type);
|
|
}
|
|
}
|