From 328631c037e9216a73ed79f468d632f7687c35e3 Mon Sep 17 00:00:00 2001 From: antoc0der <1@DESKTOP-K1L8ND3> Date: Sat, 27 Apr 2024 16:18:55 +0400 Subject: [PATCH 1/2] =?UTF-8?q?=D0=BF=D0=BE=D1=80=D1=83=D1=87=D0=B8=D1=82?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=20=D1=83=D0=B6=D0=B5=20=D0=BE=D0=B4=D0=BD?= =?UTF-8?q?=D0=BE=D0=B9=20=D0=BD=D0=BE=D0=B3=D0=BE=D0=B9=20=D0=B2=20=D0=B4?= =?UTF-8?q?=D1=83=D1=80=D0=BA=D0=B5,=20=D0=BD=D0=BE=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B4=D0=BE=D0=BB=D0=B6=D0=B0=D0=B5=D1=82=20=D0=B4=D0=B5=D0=BB?= =?UTF-8?q?=D0=B0=D1=82=D1=8C=20=D1=80=D0=B5=D1=81=D1=82=20=D0=B0=D0=BF?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VeterinaryRestApi/Controllers/DrugController.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/VeterinaryView/VeterinaryRestApi/Controllers/DrugController.cs b/VeterinaryView/VeterinaryRestApi/Controllers/DrugController.cs index 31964eb..6c9e387 100644 --- a/VeterinaryView/VeterinaryRestApi/Controllers/DrugController.cs +++ b/VeterinaryView/VeterinaryRestApi/Controllers/DrugController.cs @@ -35,15 +35,15 @@ namespace VeterinaryRestApi.Controllers } } [HttpGet] - public List GetDrugs(int purchaseId) + public List GetDrugs() { try { - return _drug.ReadList(new DrugSearchModel { DoctorId = purchaseId }); + return _drug.ReadList(new DrugSearchModel()); } catch (Exception ex) { - _logger.LogError(ex, "Ошибка получения списка услуг"); + _logger.LogError(ex, "Ошибка получения списка лекартсв"); throw; } } @@ -56,7 +56,7 @@ namespace VeterinaryRestApi.Controllers } catch (Exception ex) { - _logger.LogError(ex, "Не удалось создать услугу"); + _logger.LogError(ex, "Не удалось создать лекарств"); throw; } } @@ -71,7 +71,7 @@ namespace VeterinaryRestApi.Controllers } catch (Exception ex) { - _logger.LogError(ex, "Не удалось обновить услугу"); + _logger.LogError(ex, "Не удалось обновить лекарства"); throw; } } @@ -85,7 +85,7 @@ namespace VeterinaryRestApi.Controllers } catch (Exception ex) { - _logger.LogError(ex, "Ошибка удаления услуги"); + _logger.LogError(ex, "Ошибка удаления лекарства"); throw; } } From 2ed6bcf35261cd87942c692b99f396ff0f884087 Mon Sep 17 00:00:00 2001 From: antoc0der <1@DESKTOP-K1L8ND3> Date: Sun, 28 Apr 2024 18:26:18 +0400 Subject: [PATCH 2/2] =?UTF-8?q?=D0=BF=D0=BE=D1=80=D1=83=D1=87=D0=B8=D1=82?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C:=20=D0=B2=20=D0=BF=D1=80=D0=B8=D0=BD=D1=86?= =?UTF-8?q?=D0=B8=D0=BF=D0=B5=20=D0=B3=D0=BE=D1=82=D0=BE=D0=B2=D0=B0=20?= =?UTF-8?q?=D0=B0=D0=BF=D0=B8=D1=88=D0=B5=D1=87=D0=BA=D0=B0=20=D1=80=D0=B5?= =?UTF-8?q?=D1=81=D1=82=D1=83=D1=88=D0=B5=D1=87=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/DrugController.cs | 2 +- .../Controllers/MedicationController.cs | 18 +----------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/VeterinaryView/VeterinaryRestApi/Controllers/DrugController.cs b/VeterinaryView/VeterinaryRestApi/Controllers/DrugController.cs index 6c9e387..b02948b 100644 --- a/VeterinaryView/VeterinaryRestApi/Controllers/DrugController.cs +++ b/VeterinaryView/VeterinaryRestApi/Controllers/DrugController.cs @@ -39,7 +39,7 @@ namespace VeterinaryRestApi.Controllers { try { - return _drug.ReadList(new DrugSearchModel()); + return _drug.ReadList(null); } catch (Exception ex) { diff --git a/VeterinaryView/VeterinaryRestApi/Controllers/MedicationController.cs b/VeterinaryView/VeterinaryRestApi/Controllers/MedicationController.cs index 1c2e3df..64d4e75 100644 --- a/VeterinaryView/VeterinaryRestApi/Controllers/MedicationController.cs +++ b/VeterinaryView/VeterinaryRestApi/Controllers/MedicationController.cs @@ -17,23 +17,7 @@ namespace VeterinaryRestApi.Controllers _logger = logger; _medication = medication; } - // а нужен ли он нам вообще - [HttpGet] - public Tuple>? GetMedication(int medicationId) - { - try - { - var elem = _medication.ReadElement(new MedicationSearchModel { Id = medicationId }); - if (elem == null) - return null; - return Tuple.Create(elem, elem.MedicationAnimals.Select(x => x.Value.AnimalName).ToList()); // возврат модели медикамента и всех животных, у которых есть этот медикамент - } - catch (Exception ex) - { - _logger.LogError(ex, "Ошибка получения медикамента по id={Id}", medicationId); - throw; - } - } + [HttpGet] public List GetMedications(int doctorId) {