InventoryGroups.cs 998 B

12345678910111213141516171819202122232425262728293031
  1. using System.Security.Claims;
  2. using Web.Api.Common;
  3. using Web.Api.Extensions;
  4. using Application.Abstractions.Messaging;
  5. namespace Web.Api.Endpoints.Store;
  6. /// <summary>상점 — 내 보관함 그룹 목록 (ProductID 단위).</summary>
  7. internal sealed class InventoryGroups : IEndpoint
  8. {
  9. public void MapEndpoint(IEndpointRouteBuilder app)
  10. {
  11. app.MapGet("api/store/inventory/groups", async (
  12. int? page,
  13. ushort? perPage,
  14. ClaimsPrincipal user,
  15. ISender sender,
  16. CancellationToken ct
  17. ) => {
  18. var memberID = user.GetRequiredMemberID();
  19. var data = await sender.Send(new Application.Features.Api.Store.Inventory.Groups.Query(
  20. memberID,
  21. page is > 0 ? page.Value : 1,
  22. perPage is > 0 ? perPage.Value : (ushort)24
  23. ), ct);
  24. return ApiResponse.Ok(data);
  25. })
  26. .WithTags("Store")
  27. .RequireAuthorization();
  28. }
  29. }