【功能扩展】新增逻辑删除文件接口

pull/1/head
zengchenxi 9 months ago
parent 5c41ae14a8
commit 04883c13ab

@ -71,6 +71,15 @@ public class FileController {
return success(true); return success(true);
} }
@DeleteMapping("/deleteLogic")
@Operation(summary = "删除文件(逻辑删除)")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('infra:file:delete')")
public CommonResult<Boolean> deleteFileLogic(@RequestParam("id") Long id) throws Exception {
fileService.deleteFileLogic(id);
return success(true);
}
@GetMapping("/{configId}/get/**") @GetMapping("/{configId}/get/**")
@PermitAll @PermitAll
@Operation(summary = "下载文件") @Operation(summary = "下载文件")

@ -48,4 +48,9 @@ public interface FileService {
*/ */
byte[] getFileContent(Long configId, String path) throws Exception; byte[] getFileContent(Long configId, String path) throws Exception;
/**
*
* @param id
*/
void deleteFileLogic(Long id);
} }

@ -98,4 +98,12 @@ public class FileServiceImpl implements FileService {
return client.getContent(path); return client.getContent(path);
} }
@Override
public void deleteFileLogic(Long id) {
// 校验存在
FileDO file = validateFileExists(id);
// 删除记录
fileMapper.deleteById(id);
}
} }

Loading…
Cancel
Save