CrewActiveForChannel.cs 779 B

1234567891011121314151617181920212223
  1. using Web.Api.Common;
  2. using MediatR;
  3. namespace Web.Api.Endpoints.Donation;
  4. /// <summary>채널의 활성 크루 세션 + 크루원 조회 (시청자용, 인증 불필요)</summary>
  5. internal sealed class CrewActiveForChannel : IEndpoint
  6. {
  7. public void MapEndpoint(IEndpointRouteBuilder app)
  8. {
  9. /// identifier: @handle 또는 YouTube Channel ID (SID)
  10. app.MapGet("api/donation/crew/active/{identifier}", async (
  11. string identifier,
  12. ISender sender,
  13. CancellationToken ct
  14. ) => {
  15. var data = await sender.Send(new Application.Features.Api.Crew.GetActiveCrewForChannel.Query(identifier), ct);
  16. return ApiResponse.Ok(data);
  17. })
  18. .WithTags("Donation")
  19. .AllowAnonymous();
  20. }
  21. }