Browse Source

feature-img-1.0.0: 修改文件删除参数为requestBody

feature-1.0-img-prototype
penny 4 years ago
parent
commit
2c2fcf91b6
  1. 6
      bnyer-services/bnyer-file/src/main/java/com/bnyer/file/controller/SysFileController.java
  2. 20
      bnyer-services/bnyer-file/src/main/java/com/bnyer/file/dto/FileUrlDto.java

6
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.config.ImgConfig;
import com.bnyer.file.dto.FileDto; import com.bnyer.file.dto.FileDto;
import com.bnyer.file.dto.FileUploadDto; import com.bnyer.file.dto.FileUploadDto;
import com.bnyer.file.dto.FileUrlDto;
import com.bnyer.file.service.IFileService; import com.bnyer.file.service.IFileService;
import com.bnyer.file.service.IQiniuService; import com.bnyer.file.service.IQiniuService;
import com.bnyer.file.service.MinioService; import com.bnyer.file.service.MinioService;
@ -12,6 +13,7 @@ import com.bnyer.file.utils.ImgUtil;
import com.bnyer.file.vo.ChekFileVo; import com.bnyer.file.vo.ChekFileVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.poi.util.IOUtils; import org.apache.poi.util.IOUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -83,8 +85,8 @@ public class SysFileController {
} }
@ApiOperation(value="文件删除") @ApiOperation(value="文件删除")
@PostMapping("/deleteFile") @PostMapping("/deleteFile")
public R deleteFile(@RequestParam String url) throws IOException { public R deleteFile(@RequestBody @ApiParam("上传url对象") FileUrlDto params) throws IOException {
String res = qiniuService.deleteFile(url); String res = qiniuService.deleteFile(params.getUrl());
// 上传并返回访问地址 // 上传并返回访问地址
return R.ok(res); return R.ok(res);
} }

20
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;
}
Loading…
Cancel
Save