Subversion Repositories SmartDukaan

Rev

Rev 22162 | Go to most recent revision | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.spice.profitmandi.web.controller;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.spice.profitmandi.dao.repository.dtr.Mongo;

@Controller
public class FofoController {
        
        private static final Logger LOGGER = LoggerFactory.getLogger(FofoController.class);
        
        @RequestMapping(value = "/fofo", method = RequestMethod.GET)
        public String getAll(HttpServletRequest request, Model model) throws Exception{
                model.addAttribute("fofoForms", Mongo.getFofoForms(0, 20));
                return "fofo-index";
        }
        
        @RequestMapping(value = "/fofo/{fofoId}/edit", method = RequestMethod.GET)
        public String editFofoForm(HttpServletRequest request, @PathVariable(name = "fofoId") int fofoId, Model model) throws Exception{
                model.addAttribute("fofoForm", Mongo.getFofoForm(fofoId));
                return "fofo-edit";
        }
}