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