springboot RestTemplate 解析泛型数据

ParameterizedTypeReference<List<ModelDto>> typeReference = new ParameterizedTypeReference<List<ModelDto>>() {
    
    };
ResponseEntity<List<ModelDto>> respEntity = this.restTemplate.exchange(
        URL_MODELS,
        HttpMethod.GET,
        null,
        typeReference
);

猜你喜欢

转载自blog.csdn.net/zhoudingding/article/details/132583072