From aea0dbd97578a812af05b23773a1684273cf846b Mon Sep 17 00:00:00 2001 From: shadowik Date: Sun, 14 May 2023 11:48:00 +0400 Subject: [PATCH] . --- .../Controllers/CardController.cs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/BankYouBankrupt/BankYouBankruptRestAPI/Controllers/CardController.cs b/BankYouBankrupt/BankYouBankruptRestAPI/Controllers/CardController.cs index 2c79f26..418db10 100644 --- a/BankYouBankrupt/BankYouBankruptRestAPI/Controllers/CardController.cs +++ b/BankYouBankrupt/BankYouBankruptRestAPI/Controllers/CardController.cs @@ -16,10 +16,13 @@ namespace BankYouBankruptRestApi.Controllers private readonly ICardLogic _cardLogic; - public CardController(ICardLogic cardLogic, ILogger logger) + private readonly IDebitingLogic _debitingLogic; + + public CardController(ICardLogic cardLogic, IDebitingLogic debitingLogic, ILogger 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; + } + } } }