This commit is contained in:
Programmist73 2023-05-14 16:01:52 +04:00
commit 1c273157d1

View File

@ -16,10 +16,13 @@ namespace BankYouBankruptRestApi.Controllers
private readonly ICardLogic _cardLogic;
public CardController(ICardLogic cardLogic, ILogger<ClientController> logger)
private readonly IDebitingLogic _debitingLogic;
public CardController(ICardLogic cardLogic, IDebitingLogic debitingLogic, ILogger<ClientController> logger)
{
_logger = logger;
_cardLogic = cardLogic;
_debitingLogic = debitingLogic;
}
[HttpGet]
@ -48,7 +51,19 @@ namespace BankYouBankruptRestApi.Controllers
_logger.LogError(ex, "Ошибка создания карты");
Response.StatusCode = (int)HttpStatusCode.NotAcceptable;
}
}
[HttpPost]
public void CreateDebitingRequest(DebitingBindingModel model) {
try
{
_debitingLogic.Create(model);
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка создания на снятие наличных");
Response.StatusCode = (int)HttpStatusCode.NotAcceptable;
}
}
}
}