| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.web.controller;
|
1 |
package com.spice.profitmandi.web.controller;
|
| 2 |
|
2 |
|
| 3 |
import com.fasterxml.jackson.databind.ObjectMapper;
|
3 |
import com.fasterxml.jackson.databind.ObjectMapper;
|
| - |
|
4 |
import com.spice.profitmandi.service.integrations.smartping.SmartPingService;
|
| - |
|
5 |
import com.spice.profitmandi.service.integrations.smartping.model.CallDetailModel;
|
| 4 |
import com.spice.profitmandi.service.integrations.spicemoney.CallbackRequestData;
|
6 |
import com.spice.profitmandi.service.integrations.spicemoney.CallbackRequestData;
|
| 5 |
import com.spice.profitmandi.service.smartping.model.CallDetailModel;
|
- |
|
| 6 |
import com.spice.profitmandi.web.util.MVCResponseSender;
|
7 |
import com.spice.profitmandi.web.util.MVCResponseSender;
|
| 7 |
import org.apache.logging.log4j.LogManager;
|
8 |
import org.apache.logging.log4j.LogManager;
|
| 8 |
import org.apache.logging.log4j.Logger;
|
9 |
import org.apache.logging.log4j.Logger;
|
| 9 |
import org.springframework.beans.factory.annotation.Autowired;
|
10 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 10 |
import org.springframework.stereotype.Controller;
|
11 |
import org.springframework.stereotype.Controller;
|
| Line 24... |
Line 25... |
| 24 |
MVCResponseSender mvcResponseSender;
|
25 |
MVCResponseSender mvcResponseSender;
|
| 25 |
|
26 |
|
| 26 |
private static final Logger LOGGER = LogManager.getLogger(WebHookController.class);
|
27 |
private static final Logger LOGGER = LogManager.getLogger(WebHookController.class);
|
| 27 |
|
28 |
|
| 28 |
@Autowired
|
29 |
@Autowired
|
| 29 |
ObjectMapper objectMapper;
|
30 |
SmartPingService smartPingService;
|
| 30 |
|
31 |
|
| 31 |
@RequestMapping(value = "/click2call/report-handler", method = RequestMethod.POST)
|
32 |
@RequestMapping(value = "/click2call/report-handler", method = RequestMethod.POST)
|
| 32 |
public String click2callReportHandlerPost(HttpServletRequest request, Model model, @RequestParam(name = "push_report") String report) throws Exception {
|
33 |
public String click2callReportHandlerPost(HttpServletRequest request, Model model, @RequestParam(name = "push_report") String callDetailString) throws Exception {
|
| 33 |
|
34 |
|
| 34 |
LOGGER.info("Report - {}", report);
|
- |
|
| 35 |
CallDetailModel callDetailModel = objectMapper.readValue(report, CallDetailModel.class);
|
- |
|
| 36 |
LOGGER.info("Report - {}", callDetailModel);
|
35 |
smartPingService.createAgentRecording(callDetailString);
|
| 37 |
model.addAttribute("response1", mvcResponseSender.createResponseString("GODBLESSYOU"));
|
36 |
model.addAttribute("response1", mvcResponseSender.createResponseString("GODBLESSYOU"));
|
| 38 |
return "response";
|
37 |
return "response";
|
| 39 |
}
|
38 |
}
|
| 40 |
}
|
39 |
}
|