mirror of
https://github.com/Shchoholiev/shopping-assistant-api.git
synced 2025-04-11 01:18:50 +00:00
20 lines
811 B
C#
20 lines
811 B
C#
using HotChocolate.Authorization;
|
|
using ShoppingAssistantApi.Application.IServices;
|
|
using ShoppingAssistantApi.Domain.Entities;
|
|
|
|
namespace ShoppingAssistantApi.Api.Queries;
|
|
|
|
[ExtendObjectType(OperationTypeNames.Query)]
|
|
public class ProductQuery
|
|
{
|
|
[Authorize]
|
|
public IAsyncEnumerable<string> GetProductFromSearch(Message message, CancellationToken cancellationToken,
|
|
[Service] IProductService productService)
|
|
=> productService.GetProductFromSearch(message, cancellationToken);
|
|
|
|
[Authorize]
|
|
public IAsyncEnumerable<string> GetRecommendationsForProductFromSearchStream(Message message, CancellationToken cancellationToken,
|
|
[Service] IProductService productService)
|
|
=> productService.GetRecommendationsForProductFromSearchStream(message, cancellationToken);
|
|
|
|
} |