try{
String body = HttpUtil.createGet(url).addHeaders(buildHeaders()).execute().body();
TypeReference<IncidentResp<IncidentDetail>> typeReference = new TypeReference<IncidentResp<IncidentDetail>>(){};
return JSONUtil.toBean(body, typeReference, false).getData();
} catch (Exception e) {
log.info("Fail to send request from {}", url);
}
return null;
@Data
@AllArgsConstructor
public class IncidentDetail {
private String id;
private String centerCode;
private String incidentNo;
}
@Data
public class IncidentResp<T>{
String code;
String msg;
T data;
}