|
|
@ -38,23 +38,12 @@ public class GitExtractorController {
|
|
|
|
return "filtering";
|
|
|
|
return "filtering";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*@PostMapping("/sendRepo")
|
|
|
|
|
|
|
|
public String sendRepo(@ModelAttribute RepoForm repoForm, Model model) {
|
|
|
|
|
|
|
|
model.addAttribute("filterForm", new FilterForm(repoForm.getRepo()));
|
|
|
|
|
|
|
|
if (repoForm.getBranch() == null) {
|
|
|
|
|
|
|
|
return "newRepo";
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return "filtering";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/sendFilter")
|
|
|
|
@PostMapping("/sendFilter")
|
|
|
|
public String sendFilter(@ModelAttribute FilterForm filterForm, Model model) {
|
|
|
|
public String sendFilter(@ModelAttribute FilterForm filterForm, Model model) {
|
|
|
|
if (filterForm.getFilter() == null || filterForm.getFilter().isEmpty()) {
|
|
|
|
if (filterForm.getFilter() == null || filterForm.getFilter().isEmpty()) {
|
|
|
|
model.addAttribute("error", "'Строка' не должно быть пустым");
|
|
|
|
model.addAttribute("error", "'Строка' не должно быть пустым");
|
|
|
|
return "filtering";
|
|
|
|
return "filtering";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// model.addAttribute("commits", filteringService.getCommits(filterForm.getFilter(), filterForm.getFilter()));
|
|
|
|
|
|
|
|
return "resultRepo";
|
|
|
|
return "resultRepo";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -62,7 +51,6 @@ public class GitExtractorController {
|
|
|
|
public String getBranch(@ModelAttribute RepoForm repoForm, Model model) {
|
|
|
|
public String getBranch(@ModelAttribute RepoForm repoForm, Model model) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
gitRepositoryService.cloneOrUpdateRepo(repoForm.getRepo());
|
|
|
|
gitRepositoryService.cloneOrUpdateRepo(repoForm.getRepo());
|
|
|
|
// model.addAttribute("branches", gitRepositoryService.getBranches(repoForm.getRepo()));
|
|
|
|
|
|
|
|
List<Branch> list = gitRepositoryService.getBranches(repoForm.getRepo());
|
|
|
|
List<Branch> list = gitRepositoryService.getBranches(repoForm.getRepo());
|
|
|
|
model.addAttribute("branches", list);
|
|
|
|
model.addAttribute("branches", list);
|
|
|
|
return "newRepo";
|
|
|
|
return "newRepo";
|
|
|
|