| 123456789101112131415161718192021222324252627 |
- using Application.Abstractions.Messaging;
- using Web.Api.Common;
- using Web.Api.Extensions;
- namespace Web.Api.Endpoints.Forum.StockBoard;
- /// <summary>글의 예측 메타 + 채점 상태 — GET /api/posts/{id}/prediction (익명).</summary>
- internal sealed class GetPrediction : IEndpoint
- {
- public void MapEndpoint(IEndpointRouteBuilder app)
- {
- app.MapGet("api/posts/{id}/prediction", async (
- int id,
- ISender sender,
- CancellationToken ct
- ) => {
- var result = await sender.Send(new Application.Features.Api.Forum.StockBoard.GetPrediction.Query(id), ct);
- return result.Match(
- data => ApiResponse.Ok(data),
- CustomResults.Problem
- );
- })
- .WithTags("StockBoard")
- .AllowAnonymous();
- }
- }
|