这里写自定义目录标题
Springboot 接收List结果集
restTemplate 发送Post请求,服务端返回的是List
ResponseEntity<sob[]> responseEntity = this.get().postForEntity(url, requestEntity, sob[].class);
Sob[] sobs= responseEntity.getBody();
List<Sob> sobDtos = Arrays.asList(sobs);
Springboot 接受List请求参数
public ResponseEntity<?> does(
@RequestBody List<Does> getRportList) {...}
@RequestBody 会自动转换List<>为对象, @RequestParam 只会接受Json参数
最基本的string类型的json字符串转为List对象
com.fasterxml.jackson.databind.ObjectMapper mapper = new com.fasterxml.jackson.databind.ObjectMapper();
List<Obj> transItems = mapper.readValue(json,new TypeReference<List<Obj>>(){});