This commit is contained in:
2025-05-15 00:48:26 +08:00
parent e13dcbb553
commit b689c013d7
8 changed files with 244 additions and 2 deletions

View File

@@ -0,0 +1,19 @@

namespace Yes.Blog.Endpoints.Blogs
{
public class RssEndpoint : BlogEndpointScheme, IEndpoint
{
public void Map(IEndpointRouteBuilder app) => app.MapGet("feed", Handle).AllowAnonymous();
private async Task<Microsoft.AspNetCore.Http.IResult> Handle(
IMediator mediator,
IMapper mapper,
CancellationToken cancellationToken)
{
var response = await mediator.Send(new GetRssQuery(), cancellationToken);
return Results.Text(response.Xml, "application/rss+xml; charset=utf-8");
}
}
}