This commit is contained in:
shadowik 2023-05-14 11:48:00 +04:00
parent 10d97c1ff8
commit aea0dbd975

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