CrewSessionHistory.cs 728 B

123456789101112131415161718192021222324
  1. using Web.Api.Common;
  2. using MediatR;
  3. namespace Web.Api.Endpoints.Studio.Crew;
  4. /// <summary>세션 히스토리 목록</summary>
  5. internal sealed class CrewSessionHistory : IEndpoint
  6. {
  7. public void MapEndpoint(IEndpointRouteBuilder app)
  8. {
  9. app.MapGet("api/studio/crew/session/history/{crewID}", async (
  10. int crewID,
  11. ISender sender,
  12. CancellationToken ct,
  13. int page = 1,
  14. ushort perPage = 20
  15. ) => {
  16. var data = await sender.Send(new Application.Features.Api.Crew.GetSessionHistory.Query(crewID, page, perPage), ct);
  17. return ApiResponse.Ok(data);
  18. })
  19. .WithTags("StudioCrew")
  20. .RequireAuthorization();
  21. }
  22. }