Signatures.cs 969 B

1234567891011121314151617181920212223242526272829303132
  1. using Web.Api.Common;
  2. using Web.Api.Extensions;
  3. using MediatR;
  4. namespace Web.Api.Endpoints.Donation;
  5. /// <summary>채널의 시그니처 이미지 목록 (이미지 있는 Alert 설정만, 페이징)</summary>
  6. internal sealed class Signatures : IEndpoint
  7. {
  8. public void MapEndpoint(IEndpointRouteBuilder app)
  9. {
  10. /// identifier: @handle 또는 YouTube Channel ID (SID)
  11. app.MapGet("api/donation/signatures/{identifier}", async (
  12. string identifier,
  13. int? page,
  14. int? perPage,
  15. ISender sender,
  16. CancellationToken ct
  17. ) => {
  18. var query = new Application.Features.Api.DonationAlert.GetSignatureImages.Query(
  19. identifier,
  20. page ?? 1,
  21. perPage ?? 6
  22. );
  23. var data = await sender.Send(query, ct);
  24. return ApiResponse.Ok(data);
  25. })
  26. .WithTags("Donation")
  27. .AllowAnonymous();
  28. }
  29. }