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