新增rss功能

This commit is contained in:
2025-05-15 12:53:47 +08:00
parent b689c013d7
commit 22e9aefe1a
24 changed files with 318 additions and 151 deletions

View File

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

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");
}
}
}