一开始apifox的body设置如图
idea报错:
Resolved [org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize value of type java.util.ArrayList<java.lang.Integer>
from Object value (token JsonToken.START_OBJECT
)]
修改apifox设置:
成功
controller层:
@PostMapping("/deleteProduct")
public CommonResp deleteProduct(@RequestBody List<Integer> ids){
return productService.deleteProduct(ids) ? CommonResp.success("删除成功"):CommonResp.failed("删除失败");
}