2020
12-22
12-22
SpringBoot如何接收数组参数的方法
1.创建一个表单实体类,将数组封装到实体类中(Post提交)表单类代码:@DatapublicclassMyForm{privateint[]ids;}控制器代码:@Slf4j@RestController@RequestMapping("/info")publicclassInfoController{@PostMapping("/test")publicStringtest(@RequestBodyMyFormform){log.info(Arrays.toString(form.getIds()));return"success";}}前端代码:wx.request({url:'http://localhost:8085/info/tes...
继续阅读 >