Projekt

Obecné

Profil

Stáhnout (1.54 KB) Statistiky
| Větev: | Revize:
1 26342eaf Vojtěch Danišík
package vldc.aswi.web.controller;
2
3
import org.springframework.beans.factory.annotation.Autowired;
4
import org.springframework.stereotype.Controller;
5
import org.springframework.ui.ModelMap;
6
import org.springframework.web.bind.annotation.GetMapping;
7 2868bb9a Vojtěch Danišík
import org.springframework.web.bind.annotation.ModelAttribute;
8
import org.springframework.web.bind.annotation.PostMapping;
9 26342eaf Vojtěch Danišík
import org.springframework.web.servlet.ModelAndView;
10 417c1106 Vojtech Danisik
import vldc.aswi.database.DatabaseInterface;
11 2868bb9a Vojtěch Danišík
import vldc.aswi.domain.Assembly;
12 417c1106 Vojtech Danisik
import vldc.aswi.model.table.TableColumn;
13
import vldc.aswi.model.table.contingencyTable.ContingencyTableRow;
14
import vldc.aswi.model.table.contingencyTable.ContingencyTableRowCell;
15 2868bb9a Vojtěch Danišík
import vldc.aswi.service.AssemblyManager;
16 417c1106 Vojtech Danisik
import vldc.aswi.service.SqlQueryManager;
17
import vldc.aswi.utils.Converter;
18 26342eaf Vojtěch Danišík
19
import javax.sql.DataSource;
20 2868bb9a Vojtěch Danišík
import javax.validation.Valid;
21 26342eaf Vojtěch Danišík
import java.util.ArrayList;
22
import java.util.List;
23 417c1106 Vojtech Danisik
import java.util.Map;
24 26342eaf Vojtěch Danišík
25
@Controller
26
public class IndexController {
27
28
	@Autowired
29 417c1106 Vojtech Danisik
	private SqlQueryManager sqlQueryManager;
30 26342eaf Vojtěch Danišík
31 2868bb9a Vojtěch Danišík
	@Autowired
32
	private AssemblyManager assemblyManager;
33
34 26342eaf Vojtěch Danišík
	@GetMapping("/")
35 2868bb9a Vojtěch Danišík
	public ModelAndView index() {
36 26342eaf Vojtěch Danišík
		ModelAndView modelAndView = new ModelAndView("index");
37
38
		ModelMap modelMap = modelAndView.getModelMap();
39
40 2868bb9a Vojtěch Danišík
		modelMap.addAttribute("assemblies", assemblyManager.getAssemblies());
41
42
		return modelAndView;
43
	}
44
45
	@PostMapping("/")
46
	public ModelAndView indexPost(@Valid @ModelAttribute("assemblyID") String id) {
47
		ModelAndView modelAndView = new ModelAndView();
48
		modelAndView.setViewName("redirect:/assembly");
49 26342eaf Vojtěch Danišík
50
		return modelAndView;
51
	}
52
53
}