feat: 新增永久删除文件接口和前端删除按钮

后端新增 POST api/files/delete 接口,同时删除物理文件、缩略图和数据库记录。
前端在 FileCard 和 FileListItem 中增加 hover 可见的删除按钮,点击后弹出确认提示。
This commit is contained in:
2026-07-09 17:42:27 +08:00
parent 8c92d2fbac
commit 60878f9b6e
11 changed files with 587 additions and 3 deletions
@@ -82,6 +82,10 @@ namespace FileShare_Services.Endpoints
.WithOpenApi("FileLibrary", "保存文件播放进度。")
.WithName("SaveFileProgress");
endpoints.MapPost<IFileLibraryEndpointService, DeleteFileRequest>("api/files/delete", (service, request, _) => service.DeleteFileAsync(request))
.WithOpenApi("FileLibrary", "永久删除文件(物理文件+数据库记录)。")
.WithName("DeleteFile");
endpoints.MapGet<IFileLibraryEndpointService, FileQueryRequest>("api/files/detail", (service, request, _) => service.GetFileAsync(request))
.WithOpenApi("FileLibrary", "查询文件详情。")
.WithName("GetFileDetail");