| 35289 |
amit |
1 |
package com.spice.profitmandi.web.controller;
|
|
|
2 |
|
|
|
3 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
|
|
4 |
import com.spice.profitmandi.dao.entity.fofo.TrialForm;
|
|
|
5 |
import com.spice.profitmandi.dao.repository.trialOnboarding.TrialFormRepository;
|
|
|
6 |
import org.apache.logging.log4j.LogManager;
|
|
|
7 |
import org.apache.logging.log4j.Logger;
|
|
|
8 |
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
9 |
import org.springframework.stereotype.Controller;
|
|
|
10 |
import org.springframework.ui.Model;
|
|
|
11 |
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
12 |
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
13 |
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
14 |
|
|
|
15 |
import javax.servlet.http.HttpServletRequest;
|
|
|
16 |
import javax.transaction.Transactional;
|
|
|
17 |
import java.util.List;
|
|
|
18 |
|
|
|
19 |
@Controller
|
|
|
20 |
@Transactional(rollbackOn = Throwable.class)
|
|
|
21 |
public class TrialController {
|
|
|
22 |
|
|
|
23 |
private static final Logger LOGGER = LogManager.getLogger(TrialController.class);
|
|
|
24 |
@Autowired
|
|
|
25 |
TrialFormRepository trialFormRepository;
|
|
|
26 |
|
|
|
27 |
@RequestMapping(value = "/trial/pending", method = RequestMethod.GET)
|
|
|
28 |
public String getTrialPending(HttpServletRequest request, Model model) throws Exception {
|
|
|
29 |
List<TrialForm> trialForms = trialFormRepository.selectAllByStatus(ProfitMandiConstants.Status.PENDING);
|
|
|
30 |
LOGGER.info("trialForms {}", trialForms.size());
|
|
|
31 |
model.addAttribute("trialForms", trialForms);
|
|
|
32 |
return "trial-form";
|
|
|
33 |
}
|
|
|
34 |
|
|
|
35 |
@RequestMapping(value = "/trial/create/{trialFormId}", method = RequestMethod.GET)
|
|
|
36 |
public String getTrialPending(HttpServletRequest request, Model model, @PathVariable int trialFormId) throws Exception {
|
|
|
37 |
TrialForm trialForm = trialFormRepository.selectById(trialFormId);
|
|
|
38 |
|
|
|
39 |
return "trial-form";
|
|
|
40 |
}
|
|
|
41 |
}
|