| Line 10... |
Line 10... |
| 10 |
import org.slf4j.Logger;
|
10 |
import org.slf4j.Logger;
|
| 11 |
import org.slf4j.LoggerFactory;
|
11 |
import org.slf4j.LoggerFactory;
|
| 12 |
import org.springframework.beans.factory.annotation.Autowired;
|
12 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 13 |
import org.springframework.stereotype.Controller;
|
13 |
import org.springframework.stereotype.Controller;
|
| 14 |
import org.springframework.ui.Model;
|
14 |
import org.springframework.ui.Model;
|
| 15 |
import org.springframework.ui.ModelMap;
|
- |
|
| 16 |
import org.springframework.web.bind.annotation.ModelAttribute;
|
- |
|
| 17 |
import org.springframework.web.bind.annotation.RequestBody;
|
15 |
import org.springframework.web.bind.annotation.RequestBody;
|
| 18 |
import org.springframework.web.bind.annotation.RequestMapping;
|
16 |
import org.springframework.web.bind.annotation.RequestMapping;
|
| 19 |
import org.springframework.web.bind.annotation.RequestMethod;
|
17 |
import org.springframework.web.bind.annotation.RequestMethod;
|
| 20 |
|
18 |
|
| 21 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
19 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| Line 36... |
Line 34... |
| 36 |
DocumentRepository documentRepository;
|
34 |
DocumentRepository documentRepository;
|
| 37 |
|
35 |
|
| 38 |
@Autowired
|
36 |
@Autowired
|
| 39 |
CookiesProcessor cookiesProcessor;
|
37 |
CookiesProcessor cookiesProcessor;
|
| 40 |
|
38 |
|
| - |
|
39 |
@Autowired
|
| - |
|
40 |
Mongo mongoClient;
|
| - |
|
41 |
|
| 41 |
@RequestMapping(value = "/register", method = RequestMethod.GET)
|
42 |
@RequestMapping(value = "/register", method = RequestMethod.GET)
|
| 42 |
public String registerIndex(HttpServletResponse response, HttpServletRequest request, Model model) throws Throwable{
|
43 |
public String registerIndex(HttpServletResponse response, HttpServletRequest request, Model model) throws Throwable{
|
| 43 |
LoginDetails details = cookiesProcessor.getCookiesObject(request);
|
44 |
LoginDetails details = cookiesProcessor.getCookiesObject(request);
|
| 44 |
FofoForm form = Mongo.getFofoForm(details.getEmailId());
|
45 |
FofoForm form = mongoClient.getFofoForm(details.getEmailId());
|
| 45 |
if (form == null) {
|
46 |
if (form == null) {
|
| 46 |
model.addAttribute("email", details.getEmailId());
|
47 |
model.addAttribute("email", details.getEmailId());
|
| 47 |
return "fofo-form";
|
48 |
return "fofo-form";
|
| 48 |
} else {
|
49 |
} else {
|
| 49 |
cookiesProcessor.removeCookies(request, response);
|
50 |
cookiesProcessor.removeCookies(request, response);
|
| Line 51... |
Line 52... |
| 51 |
}
|
52 |
}
|
| 52 |
}
|
53 |
}
|
| 53 |
|
54 |
|
| 54 |
@RequestMapping(value = "/register", method = RequestMethod.POST)
|
55 |
@RequestMapping(value = "/register", method = RequestMethod.POST)
|
| 55 |
public String registerIndex(HttpServletResponse response, HttpServletRequest request, @RequestBody FofoForm fofoForm ,Model model) throws Throwable{
|
56 |
public String registerIndex(HttpServletResponse response, HttpServletRequest request, @RequestBody FofoForm fofoForm ,Model model) throws Throwable{
|
| 56 |
Mongo.persistFofoRegInfo(fofoForm);
|
57 |
mongoClient.persistFofoRegInfo(fofoForm);
|
| 57 |
cookiesProcessor.removeCookies(request, response);
|
58 |
cookiesProcessor.removeCookies(request, response);
|
| 58 |
return "fofo-thankyou";
|
59 |
return "fofo-thankyou";
|
| 59 |
}
|
60 |
}
|
| 60 |
|
61 |
|
| 61 |
public Integer moveDocument(String documentId){
|
62 |
public Integer moveDocument(String documentId){
|