Subversion Repositories SmartDukaan

Rev

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

Rev 35654 Rev 35660
Line 25... Line 25...
25
import org.springframework.http.MediaType;
25
import org.springframework.http.MediaType;
26
import org.springframework.http.ResponseEntity;
26
import org.springframework.http.ResponseEntity;
27
import org.springframework.stereotype.Controller;
27
import org.springframework.stereotype.Controller;
28
import org.springframework.transaction.annotation.Transactional;
28
import org.springframework.transaction.annotation.Transactional;
29
import org.springframework.ui.Model;
29
import org.springframework.ui.Model;
-
 
30
import org.springframework.web.bind.annotation.ModelAttribute;
30
import org.springframework.web.bind.annotation.*;
31
import org.springframework.web.bind.annotation.RequestBody;
-
 
32
import org.springframework.web.bind.annotation.RequestMapping;
-
 
33
import org.springframework.web.bind.annotation.RequestMethod;
31
 
34
 
32
import javax.servlet.http.HttpServletRequest;
35
import javax.servlet.http.HttpServletRequest;
33
 
36
 
34
@Controller
37
@Controller
35
@Transactional(rollbackFor = Throwable.class)
38
@Transactional(rollbackFor = Throwable.class)
Line 78... Line 81...
78
    }
81
    }
79
 
82
 
80
    /**
83
    /**
81
     * Knowlarity Click2Call Webhook - Push Call Log.
84
     * Knowlarity Click2Call Webhook - Push Call Log.
82
     */
85
     */
83
    @RequestMapping(value = "/click2call/push-call-log-handler/{srNumber}", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
86
    @RequestMapping(value = "/click2call/push-call-log-handler", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
84
    public ResponseEntity<?> click2callPushLogHandler(HttpServletRequest request, @RequestBody String rawBody, @PathVariable String srNumber) throws Exception {
87
    public ResponseEntity<?> click2callPushLogHandler(HttpServletRequest request, @RequestBody String rawBody) throws Exception {
85
        // Log raw JSON body from Knowlarity before processing, so we can see exactly what they sent
88
        // Log raw JSON body from Knowlarity before processing, so we can see exactly what they sent
86
        LOGGER.info("push-call-log raw JSON from Knowlarity: {}", rawBody);
89
        LOGGER.info("push-call-log raw JSON from Knowlarity: {}", rawBody);
87
        try {
90
        try {
88
            ObjectMapper objectMapper = new ObjectMapper();
91
            ObjectMapper objectMapper = new ObjectMapper();
89
            PushCallLogModel pushCallLogModel = objectMapper.readValue(rawBody, PushCallLogModel.class);
92
            PushCallLogModel pushCallLogModel = objectMapper.readValue(rawBody, PushCallLogModel.class);