@GetMapping("/exportExcel")
public <T> ResponseEntity <InputStreamResource> exportData(@RequestBody List<T> data) {
String fileName = data.getClass().getSimpleName();
ByteArrayInputStream out = excelUtilsService.writeToExcel(data);
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Disposition", "attachment; filename=" + fileName + ".xlsx");
return ResponseEntity.ok().headers(headers).body(new InputStreamResource(out));
}
我得到这个错误:
illegalargumentexception无法为非类型化集合参数类型生成变量名。
暂无答案!
目前还没有任何答案,快来回答吧!