Subversion Repositories SmartDukaan

Rev

Rev 22162 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
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;
7
import org.springframework.stereotype.Controller;
8
import org.springframework.ui.Model;
9
import org.springframework.web.bind.annotation.PathVariable;
10
import org.springframework.web.bind.annotation.RequestMapping;
11
import org.springframework.web.bind.annotation.RequestMethod;
12
 
13
import com.spice.profitmandi.dao.repository.dtr.Mongo;
14
 
15
@Controller
16
public class FofoController {
17
 
18
	private static final Logger LOGGER = LoggerFactory.getLogger(FofoController.class);
19
 
20
	@RequestMapping(value = "/fofo", method = RequestMethod.GET)
21
	public String getAll(HttpServletRequest request, Model model) throws Exception{
22
		model.addAttribute("fofoForms", Mongo.getFofoForms(0, 20));
23
		return "fofo-index";
24
	}
25
 
26
	@RequestMapping(value = "/fofo/{fofoId}/edit", method = RequestMethod.GET)
27
	public String editFofoForm(HttpServletRequest request, @PathVariable(name = "fofoId") int fofoId, Model model) throws Exception{
28
		model.addAttribute("fofoForm", Mongo.getFofoForm(fofoId));
29
		return "fofo-edit";
30
	}
31
}