CrewActiveSession.cs 675 B

12345678910111213141516171819202122
  1. using Web.Api.Common;
  2. using MediatR;
  3. namespace Web.Api.Endpoints.Studio.Crew;
  4. /// <summary>현재 활성 세션 조회 (동의 현황 포함)</summary>
  5. internal sealed class CrewActiveSession : IEndpoint
  6. {
  7. public void MapEndpoint(IEndpointRouteBuilder app)
  8. {
  9. app.MapGet("api/studio/crew/session/active/{crewID}", async (
  10. int crewID,
  11. ISender sender,
  12. CancellationToken ct
  13. ) => {
  14. var data = await sender.Send(new Application.Features.Api.Crew.GetActiveSession.Query(crewID), ct);
  15. return ApiResponse.Ok(data);
  16. })
  17. .WithTags("StudioCrew")
  18. .RequireAuthorization();
  19. }
  20. }