public UserRealInfoVO getInquiryData(OnlyIdStr id) {
id.validate();
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Type", "application/json;charset=UTF-8");
headers.add("Authorization", "Bearer " + warrantConfig.getToken());
// 请求
HttpEntity request = new HttpEntity<>(id.getId(), headers);
JSONObject jsonObject = restTemplate.postForObject(warrantConfig.getUrl(), request, JSONObject.class);
if (jsonObject == null) {
return null;
}
try {
if (jsonObject.get("code").equals(200) && jsonObject.get("data") != null) {
return JSONObject.parseObject(JSONObject.toJSONString(jsonObject.get("data")), UserRealInfoVO.class);
}
return null;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}