build-flow.api/src/BuildFlow.Host/Endpoints/File/Files/GetOfficePreviewEndpoint.cs
xiangning 2548c3ed91 refactor(endpoints): 统一命名空间大小写规范
- 将 file 相关端点命名空间从小写改为首字母大写
- 将 im 相关端点命名空间从小写改为首字母大写
- 将 workflow 相关端点命名空间从小写改为首字母大写
- 将 rag 相关端点命名空间从小写改为首字母大写
- 将 platform 相关端点命名空间从小写改为首字母大写
- 保持代码功能不变,仅调整命名空间命名风格一致性
2026-07-03 17:12:48 +08:00

28 lines
847 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.DTOs;
using File.Application.Features.Files.Queries;
using MediatR;
namespace BuildFlow.Host.Endpoints.File.Files;
/// <summary>
/// Office/PDF 文档在线预览端点。GET /api/files/office-preview,
/// 返回 KKFileView 预览地址,前端 window.open 打开即可渲染 Office 文档。
/// </summary>
[Authorize]
/// <summary>
/// undefined
/// </summary>
public class GetOfficePreviewEndpoint(IMediator mediator) : Endpoint<GetOfficePreviewRequest, OfficePreviewResult>
{
public override void Configure()
{
Get("/files/office-preview");
}
public override async Task HandleAsync(GetOfficePreviewRequest req, CancellationToken ct)
{
var result = await mediator.Send(new GetOfficePreviewQuery(req.ObjectKey), ct);
await Send.OkAsync(result, ct);
}
}