get请求:http://localhost:3100/api/animal-husbandry/harmless-comparison/list?current=1&size=10&collectionTime[]=2024-07-18&collectionTime[]=2024-08-18&farmName=%E5%A4%A7%E5%85%B4
@RestController
@AllArgsConstructor
@RequestMapping("/harmless-comparison")
public class HarmlessComparisonController extends BladeController {
@GetMapping("/list")
public R<IPage<HarmlessComparison>> page(ArrayList<String> collectionTime, String farmName, Query query) {
System.out.println("collection = " + collectionTime);
System.out.println("farmName = " + farmName);
}
}
接收:
使用@RequestParam注解直接报:缺少必要的请求参数: collectionTime"
付:使用post请求不存在路径参数接收不到的问题 或get请求使用实体接收也不存在此问题