0


Get请求传参List<Map>或List<对象>

前端参数结构

let list =[{start:"2022-02-02 00:00:00",end:"2022-02-03 00:00:00"},{start:"2022-02-02 00:00:00",end:"2022-02-03 00:00:00"}]let timeListStr =JSON.stringify(list);

后端参数结构(后端结构前端不用关心!!!!)

@Datapublicclass test {@DateTimeFormat(pattern ="yyyy-MM-dd HH:mm:ss")privateLocalDateTime start;@DateTimeFormat(pattern ="yyyy-MM-dd HH:mm:ss")privateLocalDateTime end;}
@ApiOperation("test")@GetMapping("/test")publicR<Object>test(@RequestParam(value ="timeListStr")String timeListStr){List<Test> timeList =JSONObject.parseArray(timeListStr,Test.class);returnR.ok(timeList);}

本文转载自: https://blog.csdn.net/TM_enn/article/details/129176624
版权归原作者 TM_enn 所有, 如有侵权,请联系我们删除。

“Get请求传参List<Map>或List<对象>”的评论:

还没有评论