遇到此异常后,我正在尝试使用在线API
此JSON示例
> "[{\"mdcnNo\":\"2\",\"grpName\":\"VARIOUS\",\"gnrcName\":\"Acetylcysteine
> 200 mg/ mL in 10? mL Inj. NMSF Cilol®\",\"trdName\":\"Cilol 200mg/ml
> Inj.\",\"apprv\":\"لا يحتاج
> موافقة\",\"gndr\":\"كلاهما\",\"unit\":\"Amp.\",\"ATCcode\":\"V03AB23\",\"ADMR\":\"\",\"dfnDayDos\":\"\",\"inInsurance\":\"1\",\"bnfCopayment\":\"25%\",\"corpCopayment\":\"75%\",\"sts\":\"1\"}]"
模型类
@JsonIgnoreProperties(ignoreUnknown = true) 公共类MdcnData {
private String mdcnNo;
private String grpName;
private String gnrcName;
private String trdName;
private String apprv;
private String gndr;
private String unit;
private String ATCcode;
private String ADMR;
private String dfnDayDos;
private String inInsurance;
private String bnfCopayment;
private String corpCopayment;
private String sts;
//setter getter toString
服务等级
public List<MdcnData> getAllMdcnData() {
return Arrays.stream (restTemplate.getForObject(endPoint,MdcnData[].class))
.collect(Collectors.toList());
}
控制器类
@GetMapping(value="/get", produces = MediaType.APPLICATION_JSON_VALUE)
public void run() {
List<MdcnData> allMdcnData = consumerSrivce.getAllMdcnData();
for (MdcnData mdcnData : allMdcnData) {
System.out.println(allMdcnData);
}