Subversion Repositories SmartDukaan

Rev

Rev 33591 | Rev 33602 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 33591 Rev 33595
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.common.web.util.ResponseSender;
3
import com.spice.profitmandi.common.web.util.ResponseSender;
-
 
4
import com.spice.profitmandi.dao.repository.cs.AgentRecordingRepository;
4
import com.spice.profitmandi.service.integrations.smartping.SmartPingService;
5
import com.spice.profitmandi.service.integrations.smartping.SmartPingService;
5
import com.spice.profitmandi.service.integrations.smartping.model.CallDetailModel;
6
import com.spice.profitmandi.service.integrations.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;
Line 31... Line 32...
31
    private static final Logger LOGGER = LogManager.getLogger(WebHookController.class);
32
    private static final Logger LOGGER = LogManager.getLogger(WebHookController.class);
32
 
33
 
33
    @Autowired
34
    @Autowired
34
    SmartPingService smartPingService;
35
    SmartPingService smartPingService;
35
 
36
 
-
 
37
    @Autowired
-
 
38
    AgentRecordingRepository agentRecordingRepository;
-
 
39
 
36
//    @RequestMapping(value = "/click2call/report-handler", method = RequestMethod.POST)
40
//    @RequestMapping(value = "/click2call/report-handler", method = RequestMethod.POST)
37
//    public String click2callReportHandlerPost(HttpServletRequest request, Model model, @RequestParam(name = "push_report") String callDetailString) throws Exception {
41
//    public String click2callReportHandlerPost(HttpServletRequest request, Model model, @RequestParam(name = "push_report") String callDetailString) throws Exception {
38
//
42
//
39
//        smartPingService.createAgentRecording(callDetailString);
43
//        smartPingService.createAgentRecording(callDetailString);
40
//        model.addAttribute("response1", mvcResponseSender.createResponseString("GODBLESSYOU"));
44
//        model.addAttribute("response1", mvcResponseSender.createResponseString("GODBLESSYOU"));
Line 42... Line 46...
42
//    }
46
//    }
43
 
47
 
44
    @RequestMapping(value = "/click2call/report-handler", method = RequestMethod.POST, consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
48
    @RequestMapping(value = "/click2call/report-handler", method = RequestMethod.POST, consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
45
    public ResponseEntity<?> click2callReportHandlerPost(HttpServletRequest request, Model model, @ModelAttribute CallDetailModel callDetail) throws Exception {
49
    public ResponseEntity<?> click2callReportHandlerPost(HttpServletRequest request, Model model, @ModelAttribute CallDetailModel callDetail) throws Exception {
46
        LOGGER.info("first event call detail {}", callDetail);
50
        LOGGER.info("first event call detail {}", callDetail);
47
        smartPingService.createAgentRecording(callDetail);
51
        smartPingService.updateAgentRecording(callDetail);
48
 
52
 
49
        return responseSender.ok(true);
53
        return responseSender.ok(true);
50
    }
54
    }
51
 
55
 
52
 
56