using Microsoft.AspNetCore.Mvc; using Nocr.TextMatcher.Api.Contracts; using Nocr.TextMatcher.Api.Contracts.TextMatches; using Nocr.TextMatcher.Api.Contracts.TextMatches.Dto; using Nocr.TextMatcher.AppServices.TextMatches; using Nocr.TextMatcher.AppServices.TextMatches.Services; namespace Nocr.TextMatcher.Host.Controllers; [ApiController] [Route(WebRoutes.TextMatches.Path)] public class TextMatchController : ControllerBase { private readonly ITextMatchService _textMatchService; public TextMatchController(ITextMatchService textMatchService) { _textMatchService = textMatchService ?? throw new ArgumentNullException(nameof(textMatchService)); } [HttpPost] public Task Create([FromBody] CreateTextMatchRequest request, CancellationToken cancellationToken = default) { return _textMatchService.Create(request.UserId, request.ChatId, request.Template, request.Rule, cancellationToken); } }