上传接口
@RequestMapping(value = "/upload") public RespInfo fileBatchRepay( @RequestParam(value = "file") MultipartFile file, @RequestParam(value = "objectJsonStr") String objectJsonStr) throws IOException { String realName = file.getOriginalFilename(); String suffixName = realName.substring(realName.lastIndexOf(".")); //这里的文件名用文件的GUID,数据库中存的也是GUID,避免文件覆盖 String fileName = UUID.randomUUID() + suffixName; File fileT = new File("G:\\test" ); if (!fileT.exists()) { fileT.mkdirs(); } //实际的保存 file.transferTo(new File("G:\\test\\" + fileName )); GResource gResource = JSON.parseObject(objectJsonStr, GResource.class); gResource.setTempPath("G:\\test\\" + fileName + suffixName ); System.out.println("gResource=" + gResource.toString()); return RespInfo.su