public class ApiResult { @JsonProperty("data") private List dataList; @JsonProperty("errorCode") private String code; @JsonProperty("errorMess") private String mess; } ResponseEntity responseEntity = restTemplate.exchange( api, HttpMethod.POST, httpEntity, ApiResult.class ); ApiResult apiResult = responseEntity.getBody();
thì nó sẽ như này ạ.
