CrewActiveForChannel.cs 715 B

12345678910111213141516171819202122
  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. app.MapGet("api/donation/crew/active/{channelSID}", async (
  10. string channelSID,
  11. ISender sender,
  12. CancellationToken ct
  13. ) => {
  14. var data = await sender.Send(new Application.Features.Api.Crew.GetActiveCrewForChannel.Query(channelSID), ct);
  15. return ApiResponse.Ok(data);
  16. })
  17. .WithTags("Donation")
  18. .AllowAnonymous();
  19. }
  20. }