From 38dac8f822d1ede5e9fd3fbe3e8a5de719fd6883 Mon Sep 17 00:00:00 2001
From: zhaowenyu <35589726@qq.com>
Date: Wed, 10 Dec 2025 09:17:25 +0800
Subject: [PATCH] 2025-12-10 zwy 在切换无人机摄像头时,因为无人机不支持红外,切换失败,修改提示内容为“325003000,指令响应失败,请确认无人机是否支持此功能。”
---
ard-oss/src/main/java/com/ard/oss/service/impl/OssServiceContext.java | 36 +++++++++++++-----------------------
1 files changed, 13 insertions(+), 23 deletions(-)
diff --git a/ard-oss/src/main/java/com/ard/oss/service/impl/OssServiceContext.java b/ard-oss/src/main/java/com/ard/oss/service/impl/OssServiceContext.java
index e78de05..2ee3fdc 100644
--- a/ard-oss/src/main/java/com/ard/oss/service/impl/OssServiceContext.java
+++ b/ard-oss/src/main/java/com/ard/oss/service/impl/OssServiceContext.java
@@ -140,13 +140,7 @@
// 上传文件到 Minio
this.ossService.putObject(bucket, objectName, inputStream, contentType);
- // ✅ 拼接永久 URL(不带 presigned 过期参数)
- String baseUrl = OssConfiguration.endpoint;
- if (!baseUrl.endsWith("/")) {
- baseUrl += "/";
- }
-
- return baseUrl + bucket + "/" + objectName;
+ return buildUrl(bucket, objectName);
} catch (Exception e) {
throw new IOException("Upload failed: " + e.getMessage(), e);
}
@@ -154,32 +148,19 @@
public String upload(String bucket, String objectKey, InputStream input) {
try {
-
// 上传文件
this.ossService.putObject(bucket, objectKey, input);
-
- // ✅ 构建永久访问 URL
- String baseUrl = OssConfiguration.endpoint;
- if (!baseUrl.endsWith("/")) {
- baseUrl += "/";
- }
- return baseUrl + bucket + "/" + objectKey;
+ return buildUrl(bucket, objectKey);
} catch (Exception e) {
throw new RuntimeException("Upload failed: " + e.getMessage(), e);
}
}
- @Async("threadPoolTaskExecutor")
+
public String upload(String bucket, String objectKey, InputStream input, String contentType) {
try {
// 上传文件时指定 Content-Type
this.ossService.putObject(bucket, objectKey, input, contentType);
-
- // ✅ 构建永久访问 URL
- String baseUrl = OssConfiguration.endpoint;
- if (!baseUrl.endsWith("/")) {
- baseUrl += "/";
- }
- return baseUrl + bucket + "/" + objectKey;
+ return buildUrl(bucket, objectKey);
} catch (Exception e) {
throw new RuntimeException("Upload failed: " + e.getMessage(), e);
}
@@ -216,4 +197,13 @@
}
}
+ // 构建url
+ private String buildUrl(String bucket, String key) {
+ String base = OssConfiguration.endpoint;
+ if (!base.endsWith("/")) {
+ base += "/";
+ }
+ return base + bucket + "/" + key;
+ }
+
}
--
Gitblit v1.9.3