| 1234567891011121314151617181920212223242526272829303132333435 |
- using Domain.Entities.Store.ValueObject;
- using Web.Api.Common;
- using Application.Abstractions.Messaging;
- namespace Web.Api.Endpoints.Store;
- /// <summary>상점 — 상품 리스트 (Frontend 사용자). 활성 + 판매 기간 내 상품만 노출.</summary>
- internal sealed class ProductsSearch : IEndpoint
- {
- public void MapEndpoint(IEndpointRouteBuilder app)
- {
- app.MapGet("api/store/products", async (
- int? gameID,
- ProductType? type,
- string? keyword,
- string? sort,
- int? page,
- ushort? perPage,
- ISender sender,
- CancellationToken ct
- ) => {
- var data = await sender.Send(new Application.Features.Api.Store.Products.Search.Query(
- gameID,
- type,
- keyword,
- sort,
- page is > 0 ? page.Value : 1,
- perPage is > 0 ? perPage.Value : (ushort)20
- ), ct);
- return ApiResponse.Ok(data);
- })
- .WithTags("Store")
- .AllowAnonymous();
- }
- }
|