GoalProgress.cs 751 B

1234567891011121314151617181920212223
  1. using Web.Api.Common;
  2. using MediatR;
  3. namespace Web.Api.Endpoints.Widget;
  4. /// <summary>후원 목표 진행 상태 조회 (OBS 브라우저 소스용, 인증 불필요)</summary>
  5. internal sealed class GoalProgress : IEndpoint
  6. {
  7. public void MapEndpoint(IEndpointRouteBuilder app)
  8. {
  9. app.MapGet("api/widget/goal/progress/{channelID}/{goalConfigID}", async (
  10. int channelID,
  11. int goalConfigID,
  12. ISender sender,
  13. CancellationToken ct
  14. ) => {
  15. var data = await sender.Send(new Application.Features.Api.DonationGoal.GetProgress.Query(channelID, goalConfigID), ct);
  16. return ApiResponse.Ok(data);
  17. })
  18. .WithTags("Widget")
  19. .AllowAnonymous();
  20. }
  21. }