CrewSessionStart.cs 710 B

1234567891011121314151617181920212223
  1. using Web.Api.Common;
  2. using MediatR;
  3. namespace Web.Api.Endpoints.Donation;
  4. /// <summary>크루 방송 시작</summary>
  5. internal sealed class CrewSessionStart : IEndpoint
  6. {
  7. public void MapEndpoint(IEndpointRouteBuilder app)
  8. {
  9. /// 전원 동의(Ready) 상태에서만 시작. Active 전환 후 DonationHub 브로드캐스트
  10. app.MapPost("api/crew/session/start", async (
  11. Application.Features.Api.Crew.StartSession.Command body,
  12. ISender sender,
  13. CancellationToken ct
  14. ) => {
  15. var data = await sender.Send(body, ct);
  16. return ApiResponse.Ok(data);
  17. })
  18. .WithTags("Crew")
  19. .RequireAuthorization();
  20. }
  21. }