提交 f088f725 编写于 作者: H haoxr

refactor:类名重命名

上级 fd3c0258
...@@ -10,6 +10,7 @@ import io.swagger.annotations.ApiImplicitParam; ...@@ -10,6 +10,7 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
...@@ -48,17 +49,13 @@ public class MinIOController { ...@@ -48,17 +49,13 @@ public class MinIOController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "path", value = "文件路径", required = true, paramType = "query"), @ApiImplicitParam(name = "path", value = "文件路径", required = true, paramType = "query"),
}) })
@SneakyThrows
public Result removeFile(@RequestParam String path) { public Result removeFile(@RequestParam String path) {
try { int lastIndex = path.lastIndexOf("/");
int lastIndex = path.lastIndexOf("/"); String bucketName = path.substring(path.lastIndexOf("/", lastIndex - 1) + 1, lastIndex);
String bucketName = path.substring(path.lastIndexOf("/", lastIndex - 1) + 1, lastIndex); String objectName = path.substring(lastIndex + 1);
String objectName = path.substring(lastIndex + 1); minIOService.removeObject(bucketName, objectName);
minIOService.removeObject(bucketName, objectName); return Result.success();
return Result.success();
} catch (Exception e) {
e.printStackTrace();
return Result.failed(e.getLocalizedMessage());
}
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册