|
@@ -118,14 +118,9 @@ public class MinioController {
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping("/preview")
|
|
@RequestMapping("/preview")
|
|
- public void preview(@RequestParam("objectName") String objectName, HttpServletResponse response) throws ServerException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException {
|
|
|
|
- InputStream inputStream = MinioUtil.downloadToStream(
|
|
|
|
- minioClient,
|
|
|
|
- bucketName,
|
|
|
|
- objectName
|
|
|
|
- );
|
|
|
|
- String fileName = FileUtil.getFileName(objectName);
|
|
|
|
- FileUtil.downloadForHttp(fileName, inputStream, response, 1024);
|
|
|
|
|
|
+ public ResponseBodyVO<String> preview(@RequestBody @Validated MinioParameter minioParameter) throws ServerException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException {
|
|
|
|
+ String previewUrl = MinioUtil.getPreviewUrl(minioClient, Method.GET, bucketName, minioParameter.getObjectName());
|
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, previewUrl);
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping("/createMultipartUpload")
|
|
@RequestMapping("/createMultipartUpload")
|