Skip to content

Commit

Permalink
[DEV:文件服务] 上线测试服务器2<Auto> -e:test -m:file-service -type:single -v:1.4…
Browse files Browse the repository at this point in the history
….1 -rp:8089 -de:<-e ACTIVE=dev -e UNIQUE_ID=0 -e SERVER_PORT=8089>
  • Loading branch information
welsir committed Dec 23, 2023
1 parent 7ddacb2 commit a4b7922
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ public Result<?> upload(@RequestParam("file") MultipartFile[] files,
ossFileVO.setMd5(md5List.get(0));
ossFileVO.setBucket(bucket);
Callable<UploadFileVO> file1 = ()->strategy.upload(ossFileVO);
ossFileVO.setFile(files[1]);
ossFileVO.setPath(pathList.get(0));
ossFileVO.setMd5(md5List.get(0));
Callable<UploadFileVO> file2 = ()->strategy.upload(ossFileVO);

OSSFileVO ossFileVO1 = new OSSFileVO();
ossFileVO1.setFile(files[1]);
ossFileVO1.setPath(pathList.get(1));
ossFileVO1.setMd5(md5List.get(1));
ossFileVO1.setBucket(bucket);
Callable<UploadFileVO> file2 = ()->strategy.upload(ossFileVO1);
Future<UploadFileVO> res1 = ConcurrentUtil.doJob(executorService, file1);
Future<UploadFileVO> res2 = ConcurrentUtil.doJob(executorService, file2);

res.add(ConcurrentUtil.futureGet(res1));
res.add(ConcurrentUtil.futureGet(res2));
return Result.success(res);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@ public UploadFileVO uploadFile(OSSFileVO ossFileVO) {
} catch (IOException e) {
throw new RuntimeException(e);
}
logger.info("文件上传成功");
fileMapper.insert(singleFile);
fileBucketMapper.insertFileBucketRelative(singleFile.getId().toString(),uploadBucket, CommonConstant.ALIYUN_OSS);
return Boolean.TRUE;
});

return UploadFileVO.builder()
.fileId(String.valueOf(singleFile.getId()))
.url("https://" + uploadBucket + "." + uploadEndpoint +"/"+uploadPath)
Expand Down

0 comments on commit a4b7922

Please sign in to comment.