| 123456789101112131415161718192021222324252627282930313233 |
- using System.Security.Claims;
- using Web.Api.Common;
- using Web.Api.Extensions;
- using MediatR;
- namespace Web.Api.Endpoints.Store;
- /// <summary>상점 — 내 보관함 (Digital 상품 쿠폰 코드).</summary>
- internal sealed class InventoryList : IEndpoint
- {
- public void MapEndpoint(IEndpointRouteBuilder app)
- {
- app.MapGet("api/store/inventory", async (
- int? page,
- ushort? perPage,
- int? productID,
- ClaimsPrincipal user,
- ISender sender,
- CancellationToken ct
- ) => {
- var memberID = user.GetRequiredMemberID();
- var data = await sender.Send(new Application.Features.Api.Store.Inventory.List.Query(
- memberID,
- page is > 0 ? page.Value : 1,
- perPage is > 0 ? perPage.Value : (ushort)20,
- productID is > 0 ? productID.Value : null
- ), ct);
- return ApiResponse.Ok(data);
- })
- .WithTags("Store")
- .RequireAuthorization();
- }
- }
|