Files
yes.blog/Yes.Blog/Endpoints/Admins/Comments/GetLatestCommentsEndpoint.cs
2025-05-04 22:11:28 +08:00

21 lines
581 B
C#

namespace Yes.Blog.Endpoints.Admins.Comments
{
public class GetLatestCommentsEndpoint : CommentEndpointScheme, IEndpoint
{
public void Map(IEndpointRouteBuilder app) => app.MapGet("/comments/latest", Handle);
private async Task<IResult> Handle(
IMediator mediator,
IMapper mapper,
CancellationToken cancellationToken)
{
var query = new GetLatestCommentsQuery();
var response = await mediator.Send(query, cancellationToken);
return Result.Ok(response);
}
}
}