From 9e976a6cd2f5f6011284df9cedd9e2dd96b9f68e Mon Sep 17 00:00:00 2001
From: Xiajijian <1176061145@qq.com>
Date: Thu, 30 Oct 2025 09:09:26 +0800
Subject: [PATCH] 1.修改查询无人机盒子列表权限bug。 2.修改查询服务器管理列表权限bug。
---
ard-oss/src/main/java/com/ard/oss/service/impl/MinIOServiceImpl.java | 25 +++++--------------------
1 files changed, 5 insertions(+), 20 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 e38cfb0..5097bce 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,28 +127,13 @@
@Override
public Boolean deleteObject(String bucket, String objectKey) {
try {
- // 检查文件是否存在
- client.statObject(StatObjectArgs.builder()
- .bucket(bucket)
- .object(objectKey)
- .build());
-
- // 文件存在,执行删除
- client.removeObject(RemoveObjectArgs.builder()
- .bucket(bucket)
- .object(objectKey)
- .build());
-
- log.info("成功删除文件: {}/{}", bucket, objectKey);
- return true;
- } catch (ErrorResponseException e) {
- // 文件不存在的情况
- log.warn("文件不存在: {}/{}", bucket, objectKey);
+ client.removeObject(RemoveObjectArgs.builder().bucket(bucket).object(objectKey).build());
+ } catch (MinioException | NoSuchAlgorithmException | IOException | InvalidKeyException e) {
+ log.error("Failed to delete file.");
+ e.printStackTrace();
return false;
- } catch (Exception e) {
- log.error("删除文件失败: {}/{}", bucket, objectKey, e);
- throw new RuntimeException("删除文件失败: " + e.getMessage(), e);
}
+ return true;
}
@Override
--
Gitblit v1.9.3