This commit is contained in:
Programmist73 2023-05-14 20:22:31 +04:00
commit b8aafc7cc5
2 changed files with 18 additions and 4 deletions

View File

@ -18,11 +18,14 @@ namespace BankYouBankruptRestApi.Controllers
private readonly IDebitingLogic _debitingLogic; private readonly IDebitingLogic _debitingLogic;
public CardController(ICardLogic cardLogic, IDebitingLogic debitingLogic, ILogger<ClientController> logger) private readonly ICreditingLogic _creditingLogic;
public CardController(ICardLogic cardLogic, IDebitingLogic debitingLogic, ICreditingLogic creditingLogic, ILogger<ClientController> logger)
{ {
_logger = logger; _logger = logger;
_cardLogic = cardLogic; _cardLogic = cardLogic;
_debitingLogic = debitingLogic; _debitingLogic = debitingLogic;
_creditingLogic = creditingLogic;
} }
[HttpGet] [HttpGet]
@ -61,7 +64,18 @@ namespace BankYouBankruptRestApi.Controllers
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Ошибка создания на снятие наличных"); _logger.LogError(ex, "Ошибка создания запроса на снятие наличных");
Response.StatusCode = (int)HttpStatusCode.NotAcceptable;
}
}
[HttpPost]
public void CreateCreditingOperation(CreditingBindingModel model) {
try {
_creditingLogic.Create(model);
}
catch (Exception ex) {
_logger.LogError(ex, "Ошибка создания операции на пополнение");
Response.StatusCode = (int)HttpStatusCode.NotAcceptable; Response.StatusCode = (int)HttpStatusCode.NotAcceptable;
} }
} }