From 4ded692e1ebf2fe8be533964fc95ccf6231f4490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A2=D0=B0=D0=B1=D0=B5=D0=B5=D0=B2=20=D0=90=D0=BB=D0=B5?= =?UTF-8?q?=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80?= Date: Tue, 28 May 2024 23:36:22 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=BE=D0=BD=D1=84=D0=BB=D0=B8?= =?UTF-8?q?=D0=BA=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ReportController.cs | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/ServiceStation/ServiceStationRestApi/Controllers/ReportController.cs b/ServiceStation/ServiceStationRestApi/Controllers/ReportController.cs index 62ea2f8..ef2fd50 100644 --- a/ServiceStation/ServiceStationRestApi/Controllers/ReportController.cs +++ b/ServiceStation/ServiceStationRestApi/Controllers/ReportController.cs @@ -14,15 +14,13 @@ namespace ServiceStationRestApi.Controllers private readonly IGuarantorReportLogic _guarantorReportLogic; private readonly AbstractMailWorker _mailWorker; private readonly IGuarantorReportLogic _guarantorReportLogic; - private readonly AbstractMailWorker _mailWorker; - public ReportController(ILogger logger, IExecutorReportLogic executorReportLogic, IGuarantorReportLogic guarantorReportLogic) + public ReportController(ILogger logger, IExecutorReportLogic executorReportLogic, AbstractMailWorker abstractMailWorker, IGuarantorLogic guarantorReportLogic) { _logger = logger; _executorReportLogic = executorReportLogic; _mailWorker = abstractMailWorker; _guarantorReportLogic = guarantorReportLogic; - _mailWorker = mailWorker; } [HttpPost] @@ -70,6 +68,19 @@ namespace ServiceStationRestApi.Controllers throw; } } + [HttpPost] + public void SendPdfToMail(MailSendInfoBindingModel model) + { + try + { + _mailWorker.MailSendAsync(model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка отправки письма"); + throw; + } + } [HttpPost] public void CreateGuarantorReportToWord(ReportGuarantorBindingModel model) @@ -118,18 +129,6 @@ namespace ServiceStationRestApi.Controllers throw; } } - [HttpPost] - public void SendPdfToMail(MailSendInfoBindingModel model) - { - try - { - _mailWorker.MailSendAsync(model); - } - catch (Exception ex) - { - _logger.LogError(ex, "Ошибка отправки письма"); - throw; - } - } + } }