From 2c2fcf91b62c4e6696095eaf950fb9e248478192 Mon Sep 17 00:00:00 2001 From: penny <2500338766@qq.com> Date: Mon, 11 Jul 2022 23:55:06 +0800 Subject: [PATCH] =?UTF-8?q?feature-img-1.0.0:=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=88=A0=E9=99=A4=E5=8F=82=E6=95=B0=E4=B8=BA?= =?UTF-8?q?requestBody?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../file/controller/SysFileController.java | 6 ++++-- .../java/com/bnyer/file/dto/FileUrlDto.java | 20 +++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 bnyer-services/bnyer-file/src/main/java/com/bnyer/file/dto/FileUrlDto.java diff --git a/bnyer-services/bnyer-file/src/main/java/com/bnyer/file/controller/SysFileController.java b/bnyer-services/bnyer-file/src/main/java/com/bnyer/file/controller/SysFileController.java index 4fa9161..f002008 100644 --- a/bnyer-services/bnyer-file/src/main/java/com/bnyer/file/controller/SysFileController.java +++ b/bnyer-services/bnyer-file/src/main/java/com/bnyer/file/controller/SysFileController.java @@ -5,6 +5,7 @@ import com.bnyer.common.core.domain.R; import com.bnyer.file.config.ImgConfig; import com.bnyer.file.dto.FileDto; import com.bnyer.file.dto.FileUploadDto; +import com.bnyer.file.dto.FileUrlDto; import com.bnyer.file.service.IFileService; import com.bnyer.file.service.IQiniuService; import com.bnyer.file.service.MinioService; @@ -12,6 +13,7 @@ import com.bnyer.file.utils.ImgUtil; import com.bnyer.file.vo.ChekFileVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; import lombok.extern.slf4j.Slf4j; import org.apache.poi.util.IOUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -83,8 +85,8 @@ public class SysFileController { } @ApiOperation(value="文件删除") @PostMapping("/deleteFile") - public R deleteFile(@RequestParam String url) throws IOException { - String res = qiniuService.deleteFile(url); + public R deleteFile(@RequestBody @ApiParam("上传url对象") FileUrlDto params) throws IOException { + String res = qiniuService.deleteFile(params.getUrl()); // 上传并返回访问地址 return R.ok(res); } diff --git a/bnyer-services/bnyer-file/src/main/java/com/bnyer/file/dto/FileUrlDto.java b/bnyer-services/bnyer-file/src/main/java/com/bnyer/file/dto/FileUrlDto.java new file mode 100644 index 0000000..cd50b2e --- /dev/null +++ b/bnyer-services/bnyer-file/src/main/java/com/bnyer/file/dto/FileUrlDto.java @@ -0,0 +1,20 @@ +package com.bnyer.file.dto; + +import io.swagger.annotations.ApiModel; +import lombok.Getter; +import lombok.Setter; + +import java.io.Serializable; + +/** + * @Author chengkun + * @Date 2022/7/10 16:37 + * @Description + */ +@Getter +@Setter +@ApiModel("文件url地址") +public class FileUrlDto implements Serializable { + + private String url; +}