AlertConfig.cs 705 B

12345678910111213141516171819202122
  1. using Web.Api.Common;
  2. using MediatR;
  3. namespace Web.Api.Endpoints.Widget;
  4. /// <summary>후원 알림 위젯 설정 조회 (OBS 브라우저 소스용, 인증 불필요)</summary>
  5. internal sealed class AlertConfig : IEndpoint
  6. {
  7. public void MapEndpoint(IEndpointRouteBuilder app)
  8. {
  9. app.MapGet("api/widget/alert/config/{widgetToken}", async (
  10. string widgetToken,
  11. ISender sender,
  12. CancellationToken ct
  13. ) => {
  14. var data = await sender.Send(new Application.Features.Api.DonationAlert.GetConfigByToken.Query(widgetToken), ct);
  15. return ApiResponse.Ok(data);
  16. })
  17. .WithTags("Widget")
  18. .AllowAnonymous();
  19. }
  20. }