Compare commits

...

5 Commits

View File

@ -13,13 +13,14 @@ namespace ServiceStationRestApi.Controllers
private readonly IExecutorReportLogic _executorReportLogic;
private readonly IGuarantorReportLogic _guarantorReportLogic;
private readonly AbstractMailWorker _mailWorker;
private readonly IGuarantorReportLogic _guarantorReportLogic;
public ReportController(ILogger<ReportController> logger, IExecutorReportLogic executorReportLogic, IGuarantorReportLogic guarantorReportLogic)
public ReportController(ILogger<ReportController> logger, IExecutorReportLogic executorReportLogic, AbstractMailWorker abstractMailWorker, IGuarantorLogic guarantorReportLogic)
{
_logger = logger;
_executorReportLogic = executorReportLogic;
_mailWorker = abstractMailWorker;
_guarantorReportLogic = guarantorReportLogic;
_mailWorker = mailWorker;
}
[HttpPost]
@ -67,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)
@ -115,18 +129,6 @@ namespace ServiceStationRestApi.Controllers
throw;
}
}
[HttpPost]
public void SendPdfToMail(MailSendInfoBindingModel model)
{
try
{
_mailWorker.MailSendAsync(model);
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка отправки письма");
throw;
}
}
}
}