From e567c76939c6516b4146aa6a554d95c0bcb4f078 Mon Sep 17 00:00:00 2001
From: rain <167982779@qq.com>
Date: Mon, 15 Jul 2024 16:57:50 +0800
Subject: [PATCH] 修改航线文件重命名报错,增加图片缩略图,完善喊话功能

---
 src/main/java/com/dji/sample/component/oss/service/impl/MinIOServiceImpl.java |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/dji/sample/component/oss/service/impl/MinIOServiceImpl.java b/src/main/java/com/dji/sample/component/oss/service/impl/MinIOServiceImpl.java
index 21024c8..d54368e 100644
--- a/src/main/java/com/dji/sample/component/oss/service/impl/MinIOServiceImpl.java
+++ b/src/main/java/com/dji/sample/component/oss/service/impl/MinIOServiceImpl.java
@@ -1,5 +1,6 @@
 package com.dji.sample.component.oss.service.impl;
 
+import com.dji.sample.common.model.ResponseResult;
 import com.dji.sample.component.oss.model.OssConfiguration;
 import com.dji.sample.component.oss.model.enums.OssTypeEnum;
 import com.dji.sample.component.oss.service.IOssService;
@@ -91,10 +92,10 @@
     }
 
     @Override
-    public void putObject(String bucket, String objectKey, InputStream input) {
+    public String putObject(String bucket, String objectKey, InputStream input) {
         try {
             client.statObject(StatObjectArgs.builder().bucket(bucket).object(objectKey).build());
-            throw new RuntimeException("文件名已存在");
+            return "航线名重复";
         } catch (MinioException | InvalidKeyException | IOException | NoSuchAlgorithmException e) {
             log.info("文件不存在,开始上传。");
             try {
@@ -106,6 +107,7 @@
                 ex.printStackTrace();
             }
         }
+        return null;
     }
 
     public void createClient() {

--
Gitblit v1.9.3