diff --git a/src/main/java/ru/ulstu/grant/controller/GrantRestController.java b/src/main/java/ru/ulstu/grant/controller/GrantRestController.java new file mode 100644 index 0000000..9b90a4d --- /dev/null +++ b/src/main/java/ru/ulstu/grant/controller/GrantRestController.java @@ -0,0 +1,29 @@ +package ru.ulstu.grant.controller; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import ru.ulstu.configuration.Constants; +import ru.ulstu.grant.service.GrantService; + +import java.io.IOException; +import java.text.ParseException; + +import static ru.ulstu.paper.controller.PaperRestController.URL; + +@RestController +@RequestMapping(URL) +public class GrantRestController { + public static final String URL = Constants.API_1_0 + "grants"; + + private final GrantService grantService; + + public GrantRestController(GrantService grantService) { + this.grantService = grantService; + } + + @GetMapping("/grab") + public void grab() throws IOException, ParseException { + grantService.createFromKias(); + } +}