|
|
@@ -91,6 +91,19 @@ public class FileController {
|
|
|
return success(true);
|
|
|
}
|
|
|
|
|
|
+ @DeleteMapping("/delete-by-url")
|
|
|
+ @Operation(summary = "根据 URL 删除文件")
|
|
|
+ @Parameter(name = "url", description = "文件 URL", required = true)
|
|
|
+ @PreAuthorize("@ss.hasPermission('infra:file:delete')")
|
|
|
+ public CommonResult<Boolean> deleteFileByUrl(@RequestParam("url") String url) throws Exception {
|
|
|
+ FileDO fileDO = fileService.getFilePathByUrl(url);
|
|
|
+ if (fileDO == null) {
|
|
|
+ throw new IllegalArgumentException("文件不存在");
|
|
|
+ }
|
|
|
+ fileService.deleteFile(fileDO.getId());
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
@GetMapping("/{configId}/get/**")
|
|
|
@PermitAll
|
|
|
@TenantIgnore
|