我想在 spring boot 控制器中接收多行,尝试了不同的方法但无法做到。我正在用邮递员进行测试。
控制器
@PostMapping(URLConstant.URL_SC_ATTACHMENT_POST)
public ResponseEntity<ApiResponse> storeFile(@RequestParam("attachmentDto") List<BudgetSceAttachmentDto> attachmentDto) throws IOException {
System.out.println(attachmentDto);
return ResponseUtil.getResponse(HttpStatus.OK, MsgConstant.BUDGET_MSG_FILE_UPLOADED, null);
}
DTO
private Integer versionId;
private String fileName;
private String pathUploadedFile;
private String uploadedFileName;
private MultipartFile file;