fix
This commit is contained in:
parent
7ae39149ce
commit
441b3b8151
@ -1,4 +1,5 @@
|
||||
using BankContracts.BindingModels;
|
||||
using BankBusinessLogic.MailWorker;
|
||||
using BankContracts.BindingModels;
|
||||
using BankContracts.BusinessLogicsContracts;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
@ -10,11 +11,13 @@ namespace BankRestApi.Controllers
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
private readonly IReportLogic _logic;
|
||||
private readonly AbstractMailWorker _mailWorker;
|
||||
|
||||
public ReportController(ILogger<RequestController> logger, IReportLogic logic)
|
||||
public ReportController(ILogger<RequestController> logger, IReportLogic logic, AbstractMailWorker mailWorker)
|
||||
{
|
||||
_logger = logger;
|
||||
_logic = logic;
|
||||
_mailWorker = mailWorker;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
@ -76,6 +79,12 @@ namespace BankRestApi.Controllers
|
||||
try
|
||||
{
|
||||
_logic.SaveTransfersWithdrawalsToPdfFile(model);
|
||||
_mailWorker.MailSendAsync(new MailSendInfoBindingModel
|
||||
{
|
||||
MailAddress = model.Email!,
|
||||
Subject = "Отчет по животным",
|
||||
Text = "Лови"
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user