This commit is contained in:
luke 2025-06-21 01:06:10 +08:00
parent 31da1625f5
commit 343472f5cb

View File

@ -57,13 +57,15 @@ public class MinioOSGatewayImpl implements ObjectStorageGateway {
@Override
public void uploadFile(String bucket, String objectPath, MultipartFile file) throws Exception {
long startMs = System.currentTimeMillis();
localMinioClient.putObject(PutObjectArgs.builder()
.bucket(bucket)
.object(objectPath)
.stream(file.getInputStream(), file.getSize(), -1)
.contentType(Optional.ofNullable(file.getContentType()).orElse("application/octet-stream"))
.build());
log.info("上传成功: {}/{}", bucket, objectPath);
long endMs = System.currentTimeMillis();
log.info("上传成功: {}/{}, takes: {} ms", bucket, objectPath, (endMs - startMs));
}
@Override