xiangning 8f85a2d3c8 refactor(file): 移除bucket参数并使用默认桶解析器
- 移除AbortMultipartCommand中的BucketName参数
- 移除CompleteMultipartCommand中的BucketName参数
- 移除DeleteFileCommand中的BucketName参数
- 移除DownloadFileQuery中的BucketName参数
- 移除GetFileContentQuery中的BucketName参数
- 移除GetFilePreviewQuery中的BucketName参数
- 移除GetOfficePreviewQuery中的BucketName参数
- 移除InitMultipartCommand中的BucketName参数
- 在各处理器中注入IBucketResolver并获取默认桶
- 更新所有相关端点和请求模型移除bucket参数
- 修改测试代码适配参数变更
- 添加IM离线消息到平台通知中心的跨模块集成实现
2026-07-03 13:32:08 +08:00

26 lines
711 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using File.Application.Features.Files.Commands;
using MediatR;
namespace BuildFlow.Host.Endpoints.file.Files;
/// <summary>删除文件端点。DELETE /api/files/delete,按对象键删除文件。</summary>
[Authorize]
/// <summary>
/// undefined
/// </summary>
public class DeleteFileEndpoint(IMediator mediator) : Endpoint<DeleteFileRequest, object>
{
public override void Configure()
{
Delete("/files/delete");
Permissions("file:write");
}
public override async Task HandleAsync(DeleteFileRequest req, CancellationToken ct)
{
await mediator.Send(new DeleteFileCommand(req.ObjectKey), ct);
await Send.OkAsync(new { message = "deleted" }, ct);
}
}