代码 @GetMapping("test") public Object test(@RequestParam List<Long> ids) { Map<String, Object> map = new HashMap<>(); map.put("ids", ids); return map; } 请求 http://localhost:8080/api/test?ids=20,30,22 返回 { "ids": [ 20, 30, 22 ] }