From c42829d221533c790799c008f9dd297708335c30 Mon Sep 17 00:00:00 2001
From: Xiajijian <1176061145@qq.com>
Date: Mon, 10 Nov 2025 16:54:08 +0800
Subject: [PATCH] 1.增加修改航线分组ID接口。 2.Minio格式优化。 3.分组管理查询列表优化。 4.航线信息增加航线类型字段。 5.修改航线(kmz)功能优化。 6.增加定制删除旧的文件名的文件,并添加新文件名的文件接口。
---
ard-oss/src/main/java/com/ard/oss/service/impl/MinIOServiceImpl.java | 26 +++++++++++++++++++++-----
1 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/ard-oss/src/main/java/com/ard/oss/service/impl/MinIOServiceImpl.java b/ard-oss/src/main/java/com/ard/oss/service/impl/MinIOServiceImpl.java
index 38718a3..4d9065c 100644
--- a/ard-oss/src/main/java/com/ard/oss/service/impl/MinIOServiceImpl.java
+++ b/ard-oss/src/main/java/com/ard/oss/service/impl/MinIOServiceImpl.java
@@ -127,7 +127,10 @@
@Override
public Boolean deleteObject(String bucket, String objectKey) {
try {
- client.removeObject(RemoveObjectArgs.builder().bucket(bucket).object(objectKey).build());
+ client.removeObject(RemoveObjectArgs.builder()
+ .bucket(bucket)
+ .object(objectKey)
+ .build());
} catch (MinioException | NoSuchAlgorithmException | IOException | InvalidKeyException e) {
log.error("Failed to delete file.");
e.printStackTrace();
@@ -139,7 +142,10 @@
@Override
public InputStream getObject(String bucket, String objectKey) {
try {
- GetObjectResponse object = client.getObject(GetObjectArgs.builder().bucket(bucket).object(objectKey).build());
+ GetObjectResponse object = client.getObject(GetObjectArgs.builder()
+ .bucket(bucket)
+ .object(objectKey)
+ .build());
return new ByteArrayInputStream(object.readAllBytes());
} catch (ErrorResponseException | InsufficientDataException | InternalException | InvalidKeyException | InvalidResponseException | IOException | NoSuchAlgorithmException | ServerException | XmlParserException e) {
e.printStackTrace();
@@ -150,7 +156,10 @@
@Override
public void putObject(String bucket, String objectKey, InputStream input) {
try {
- client.statObject(StatObjectArgs.builder().bucket(bucket).object(objectKey).build());
+ client.statObject(StatObjectArgs.builder()
+ .bucket(bucket)
+ .object(objectKey)
+ .build());
throw new RuntimeException("The filename already exists.");
} catch (MinioException | InvalidKeyException | IOException | NoSuchAlgorithmException e) {
log.info("The file does not exist, start uploading.");
@@ -158,7 +167,11 @@
// 设置 partSize 为 10MB
long partSize = 10 * 1024 * 1024;
ObjectWriteResponse response = client.putObject(
- PutObjectArgs.builder().bucket(bucket).object(objectKey).stream(input, -1, partSize).build());
+ PutObjectArgs.builder()
+ .bucket(bucket)
+ .object(objectKey)
+ .stream(input, -1, partSize)
+ .build());
log.info("Upload File: {}", response.etag());
} catch (MinioException | IOException | InvalidKeyException | NoSuchAlgorithmException ex) {
log.error("Failed to upload File {}.", objectKey);
@@ -170,7 +183,10 @@
public void putObject(String bucket, String objectKey, InputStream input, String contentType) {
try {
// 检查文件是否已经存在
- client.statObject(StatObjectArgs.builder().bucket(bucket).object(objectKey).build());
+ client.statObject(StatObjectArgs.builder()
+ .bucket(bucket)
+ .object(objectKey)
+ .build());
throw new RuntimeException("The file already exists: " + objectKey);
} catch (ErrorResponseException e) {
// 如果文件不存在,则继续上传
--
Gitblit v1.9.3