diff --git a/src/main/java/ru/ulstu/extractor/controller/BaseIndexingController.java b/src/main/java/ru/ulstu/extractor/controller/BaseIndexingController.java index c6d1b7a..e2a154a 100644 --- a/src/main/java/ru/ulstu/extractor/controller/BaseIndexingController.java +++ b/src/main/java/ru/ulstu/extractor/controller/BaseIndexingController.java @@ -3,34 +3,19 @@ package ru.ulstu.extractor.controller; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import ru.ulstu.extractor.model.mvc.IndexRepoForm; -import ru.ulstu.extractor.model.mvc.RepoForm; -import ru.ulstu.extractor.service.GitRepositoryService; +import ru.ulstu.extractor.repository.RepositoryRepository; @Controller public class BaseIndexingController { - private final GitRepositoryService gitRepositoryService; + private final RepositoryRepository repositoryRepository; - public BaseIndexingController(GitRepositoryService gitRepositoryService) { - this.gitRepositoryService = gitRepositoryService; + public BaseIndexingController(RepositoryRepository repositoryRepository) { + this.repositoryRepository = repositoryRepository; } @GetMapping("/indexRepo") public String indexNewRepo(Model model) { - model.addAttribute(new RepoForm()); + model.addAttribute("repositories", repositoryRepository.findAll()); return "indexRepo"; } - - @RequestMapping(value = "/indexRepo", method = RequestMethod.POST, params = "send") - public String getBranch(@ModelAttribute IndexRepoForm indexRepoForm, Model model) { - try { - return "indexRepo"; - } catch (Exception ex) { - model.addAttribute("error", ex.getMessage()); - return "indexRepo"; - } - } } diff --git a/src/main/java/ru/ulstu/extractor/model/mvc/IndexRepoForm.java b/src/main/java/ru/ulstu/extractor/model/mvc/IndexRepoForm.java deleted file mode 100644 index 27f55b7..0000000 --- a/src/main/java/ru/ulstu/extractor/model/mvc/IndexRepoForm.java +++ /dev/null @@ -1,20 +0,0 @@ -package ru.ulstu.extractor.model.mvc; - -public class IndexRepoForm { - private String repo; - - public String getRepo() { - return repo; - } - - public void setRepo(String repo) { - this.repo = repo; - } - - @Override - public String toString() { - return "IndexRepoForm{" + - "repo='" + repo + '\'' + - '}'; - } -} diff --git a/src/main/resources/templates/indexRepo.html b/src/main/resources/templates/indexRepo.html index 5266427..50fedff 100644 --- a/src/main/resources/templates/indexRepo.html +++ b/src/main/resources/templates/indexRepo.html @@ -3,23 +3,21 @@ xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}"> - Индексировать новый репозиторий + Проиндексированные репозитории
-
- - - - - - - - - - - -
Url
-
+ + + + + + + + + + + +
Репозиторий