| | |
| | | @RequestMapping("/API/videoService/eventCenter/messages") |
| | | public class TranspondDHController { |
| | | |
| | | @Value("${videoPoint.url}") |
| | | @Value("${videoPoint.web_url}") |
| | | private String url; |
| | | |
| | | @Value("${videoPoint.userName}") |
| | |
| | | @RequestParam(required = false) Integer msgNum, |
| | | @RequestParam(required = false) Integer waitSec) { |
| | | String url = "/videoService/eventCenter/messages/subscribe"; |
| | | String param = "?type=" + type + "&msgId=" + msgId + "&msgNum=" + msgNum + "&waitSec=" + waitSec; |
| | | String param = "?type=" + type + "&msgId=" + msgId + "&waitSec=" + waitSec + "&msgNum=" + msgNum; |
| | | |
| | | return getResult(url, param); |
| | | } |
| | | |
| | | private CommonResult<?> getResult(String url, String param) { |
| | | private CommonResult<?> getResult(String reqUrl, String param) { |
| | | try { |
| | | String token = getToken(); |
| | | |
| | | System.out.println("定位接口url:" + url + reqUrl + param); |
| | | HttpHeaders deviceHeaders = new HttpHeaders(); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | deviceHeaders.add("X-Subject-Token", token); |
| | | HttpEntity<Object> deviceEntity = new HttpEntity<>(deviceHeaders); |
| | | |
| | | RestTemplate restTemplate = new RestTemplate(); |
| | | ResponseEntity<String> exchange = restTemplate.exchange(url + param, HttpMethod.GET, deviceEntity, String.class); |
| | | ResponseEntity<String> exchange = restTemplate.exchange(url + reqUrl + param, HttpMethod.GET, deviceEntity, String.class); |
| | | System.out.println(exchange); |
| | | return CommonResult.success(exchange); |
| | | } catch (Exception ex) { |