| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.web.controller;
|
1 |
package com.spice.profitmandi.web.controller;
|
| 2 |
|
2 |
|
| - |
|
3 |
import com.spice.profitmandi.service.smartping.model.CallDetailModel;
|
| 3 |
import com.spice.profitmandi.web.util.MVCResponseSender;
|
4 |
import com.spice.profitmandi.web.util.MVCResponseSender;
|
| 4 |
import org.apache.logging.log4j.LogManager;
|
5 |
import org.apache.logging.log4j.LogManager;
|
| 5 |
import org.apache.logging.log4j.Logger;
|
6 |
import org.apache.logging.log4j.Logger;
|
| 6 |
import org.springframework.beans.factory.annotation.Autowired;
|
7 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 7 |
import org.springframework.stereotype.Controller;
|
8 |
import org.springframework.stereotype.Controller;
|
| 8 |
import org.springframework.ui.Model;
|
9 |
import org.springframework.ui.Model;
|
| 9 |
import org.springframework.web.bind.annotation.RequestBody;
|
- |
|
| 10 |
import org.springframework.web.bind.annotation.RequestMapping;
|
10 |
import org.springframework.web.bind.annotation.RequestMapping;
|
| 11 |
import org.springframework.web.bind.annotation.RequestMethod;
|
11 |
import org.springframework.web.bind.annotation.RequestMethod;
|
| - |
|
12 |
import org.springframework.web.bind.annotation.RequestParam;
|
| 12 |
|
13 |
|
| 13 |
import javax.servlet.http.HttpServletRequest;
|
14 |
import javax.servlet.http.HttpServletRequest;
|
| 14 |
import javax.transaction.Transactional;
|
15 |
import javax.transaction.Transactional;
|
| 15 |
|
16 |
|
| 16 |
@Controller
|
17 |
@Controller
|
| Line 20... |
Line 21... |
| 20 |
@Autowired
|
21 |
@Autowired
|
| 21 |
MVCResponseSender mvcResponseSender;
|
22 |
MVCResponseSender mvcResponseSender;
|
| 22 |
|
23 |
|
| 23 |
private static final Logger LOGGER = LogManager.getLogger(WebHookController.class);
|
24 |
private static final Logger LOGGER = LogManager.getLogger(WebHookController.class);
|
| 24 |
|
25 |
|
| 25 |
@RequestMapping(value = "/click2call/report-handler", method = RequestMethod.GET)
|
- |
|
| 26 |
public String click2callReportHandler(HttpServletRequest request, Model model, @RequestBody String report) throws Exception {
|
- |
|
| 27 |
|
- |
|
| 28 |
LOGGER.info("Report - {}", report);
|
- |
|
| 29 |
model.addAttribute("response1", mvcResponseSender.createResponseString("GODBLESSYOU"));
|
- |
|
| 30 |
return "response";
|
- |
|
| 31 |
}
|
- |
|
| 32 |
|
26 |
|
| 33 |
@RequestMapping(value = "/click2call/report-handler", method = RequestMethod.POST)
|
27 |
@RequestMapping(value = "/click2call/report-handler", method = RequestMethod.POST)
|
| 34 |
public String click2callReportHandlerPost(HttpServletRequest request, Model model, @RequestBody String report) throws Exception {
|
28 |
public String click2callReportHandlerPost(HttpServletRequest request, Model model, @RequestParam(name = "push_report") CallDetailModel report) throws Exception {
|
| 35 |
|
29 |
|
| 36 |
LOGGER.info("Report - {}", report);
|
30 |
LOGGER.info("Report - {}", report);
|
| 37 |
model.addAttribute("response1", mvcResponseSender.createResponseString("GODBLESSYOU"));
|
31 |
model.addAttribute("response1", mvcResponseSender.createResponseString("GODBLESSYOU"));
|
| 38 |
return "response";
|
32 |
return "response";
|
| 39 |
}
|
33 |
}
|