RestTemplate 返回值嵌套范型解析


接口返回值定义如下:ResponseEntity<ValuationResponseEntity<DealChangeNotifyVO>>

1 ParameterizedTypeReference<ValuationResponseEntity<DealChangeNotifyVO>> typeRef = new ParameterizedTypeReference<ValuationResponseEntity<DealChangeNotifyVO>>() {};
2 HttpHeaders headers = new HttpHeaders();
3 headers.setContentType(MediaType.APPLICATION_JSON);
4 headers.set("Accept", "application/json");
5 HttpEntity<Object> requestEntity = new HttpEntity<>(requestBody, headers);
6 ResponseEntity<ValuationResponseEntity<DealChangeNotifyVO>> response = restTemplate.exchange(url, HttpMethod.POST, requestEntity, typeRef);
7 return response;

 




RestTemplate 返回值嵌套范型解析

上一篇:git 只删除远程仓库中的文件


下一篇:oracle 子查询 where having from ,from子查询提高效率