From 63cce4c4f82d09bb600e492dacebfe0608feb07e Mon Sep 17 00:00:00 2001 From: Zakharov_Rostislav Date: Fri, 17 May 2024 14:58:48 +0400 Subject: [PATCH] fix BankRestApi.Controllers.ManagerController --- .../Controllers/ManagerController.cs | 63 ++----------------- 1 file changed, 4 insertions(+), 59 deletions(-) diff --git a/Bank/BankRestApi/Controllers/ManagerController.cs b/Bank/BankRestApi/Controllers/ManagerController.cs index bc5b761..8cf42e0 100644 --- a/Bank/BankRestApi/Controllers/ManagerController.cs +++ b/Bank/BankRestApi/Controllers/ManagerController.cs @@ -22,74 +22,19 @@ namespace BankRestApi.Controllers } [HttpGet] - public List? GetManagerList() - { - try - { - return _logic.ReadList(null); - } - catch (Exception ex) - { - _logger.LogError(ex, "Ошибка получения списка менеджеров"); - throw; - } - } - - [HttpGet] - public ManagerViewModel? GetManager(int ManagerId) + public ManagerViewModel? Login(string login, string password) { try { return _logic.ReadElement(new ManagerSearchModel { - Id = ManagerId + Email = login, + Password = password }); } catch (Exception ex) { - _logger.LogError(ex, "Ошибка получения менеджера по Id={Id}", ManagerId); - throw; - } - } - - [HttpPost] - public void CreateManager(ManagerBindingModel model) - { - try - { - _logic.Create(model); - } - catch (Exception ex) - { - _logger.LogError(ex, "Ошибка создания менеджера"); - throw; - } - } - - [HttpPut] - public void UpdateManager(ManagerBindingModel model) - { - try - { - _logic.Update(model); - } - catch (Exception ex) - { - _logger.LogError(ex, "Ошибка обновления менеджера"); - throw; - } - } - - [HttpDelete] - public void DeleteManager(ManagerBindingModel model) - { - try - { - _logic.Delete(model); - } - catch (Exception ex) - { - _logger.LogError(ex, "Ошибка удаления менеджера"); + _logger.LogError(ex, "Ошибка входа в систему"); throw; } }