From 8ea2ecb27daa0c2d550ea3b8b4163602ad0aed86 Mon Sep 17 00:00:00 2001 From: nihaotian Date: Mon, 14 Oct 2024 17:03:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/kening/vordm/controller/FileController.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/kn-service/biz-vordm/src/main/java/com/kening/vordm/controller/FileController.java b/kn-service/biz-vordm/src/main/java/com/kening/vordm/controller/FileController.java index fe0e27d..a59c562 100644 --- a/kn-service/biz-vordm/src/main/java/com/kening/vordm/controller/FileController.java +++ b/kn-service/biz-vordm/src/main/java/com/kening/vordm/controller/FileController.java @@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; @@ -74,4 +75,16 @@ public class FileController { } return bladeFile; } + + /** + * 删除 images 文件 + * @param + * @return + */ + @PostMapping("/removeFileImages") + public R removeFile(@RequestParam String fileUrl){ + String[] fileUrlArr= fileUrl.split("/"); + minioTemplate.removeFile("images",fileUrlArr[3]+"/"+fileUrlArr[4]+"/"+fileUrlArr[5]); + return R.data(true); + } }