| Line 2... |
Line 2... |
| 2 |
|
2 |
|
| 3 |
import javax.servlet.http.HttpServletRequest;
|
3 |
import javax.servlet.http.HttpServletRequest;
|
| 4 |
|
4 |
|
| 5 |
import org.slf4j.Logger;
|
5 |
import org.slf4j.Logger;
|
| 6 |
import org.slf4j.LoggerFactory;
|
6 |
import org.slf4j.LoggerFactory;
|
| - |
|
7 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 7 |
import org.springframework.stereotype.Controller;
|
8 |
import org.springframework.stereotype.Controller;
|
| 8 |
import org.springframework.ui.Model;
|
9 |
import org.springframework.ui.Model;
|
| 9 |
import org.springframework.web.bind.annotation.PathVariable;
|
10 |
import org.springframework.web.bind.annotation.PathVariable;
|
| 10 |
import org.springframework.web.bind.annotation.RequestMapping;
|
11 |
import org.springframework.web.bind.annotation.RequestMapping;
|
| 11 |
import org.springframework.web.bind.annotation.RequestMethod;
|
12 |
import org.springframework.web.bind.annotation.RequestMethod;
|
| Line 15... |
Line 16... |
| 15 |
@Controller
|
16 |
@Controller
|
| 16 |
public class FofoController {
|
17 |
public class FofoController {
|
| 17 |
|
18 |
|
| 18 |
private static final Logger LOGGER = LoggerFactory.getLogger(FofoController.class);
|
19 |
private static final Logger LOGGER = LoggerFactory.getLogger(FofoController.class);
|
| 19 |
|
20 |
|
| - |
|
21 |
|
| - |
|
22 |
@Autowired
|
| - |
|
23 |
Mongo mongoClient;
|
| - |
|
24 |
|
| - |
|
25 |
|
| 20 |
@RequestMapping(value = "/fofo", method = RequestMethod.GET)
|
26 |
@RequestMapping(value = "/fofo", method = RequestMethod.GET)
|
| 21 |
public String getAll(HttpServletRequest request, Model model) throws Exception{
|
27 |
public String getAll(HttpServletRequest request, Model model) throws Exception{
|
| 22 |
model.addAttribute("fofoForms", Mongo.getFofoForms(0, 20));
|
28 |
model.addAttribute("fofoForms", mongoClient.getFofoForms(0, 50));
|
| 23 |
return "fofo-index";
|
29 |
return "fofo-index";
|
| 24 |
}
|
30 |
}
|
| 25 |
|
31 |
|
| 26 |
@RequestMapping(value = "/fofo/{fofoId}/edit", method = RequestMethod.GET)
|
32 |
@RequestMapping(value = "/fofo/{fofoId}/edit", method = RequestMethod.GET)
|
| 27 |
public String editFofoForm(HttpServletRequest request, @PathVariable(name = "fofoId") int fofoId, Model model) throws Exception{
|
33 |
public String editFofoForm(HttpServletRequest request, @PathVariable(name = "fofoId") int fofoId, Model model) throws Exception{
|
| 28 |
model.addAttribute("fofoForm", Mongo.getFofoForm(fofoId));
|
34 |
model.addAttribute("fofoForm", mongoClient.getFofoForm(fofoId));
|
| 29 |
return "fofo-edit";
|
35 |
return "fofo-edit";
|
| 30 |
}
|
36 |
}
|
| 31 |
}
|
37 |
}
|