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; - } - } + } }