From cb0f7f812b6a4615459f96ac6fd6a4ef22e87a5e Mon Sep 17 00:00:00 2001 From: Beyza Aydeniz Date: Wed, 3 Jan 2024 02:31:21 +0300 Subject: [PATCH] #EHA-33 Veterinarian list for admin dashboard is fetched. --- pom.xml | 6 +++- .../Controllers/VeterinarianController.java | 13 +++++-- .../static/images}/Icon.png | Bin .../static/images}/Union.png | Bin .../static/images}/logout.png | Bin .../static/images}/newdog.png | Bin .../templates}/desktop.html | 33 +++++++++++------- .../templates}/login.html | 8 ++--- 8 files changed, 41 insertions(+), 19 deletions(-) rename src/main/{Frontend/Images => resources/static/images}/Icon.png (100%) rename src/main/{Frontend/Images => resources/static/images}/Union.png (100%) rename src/main/{Frontend/Images => resources/static/images}/logout.png (100%) rename src/main/{Frontend/Images => resources/static/images}/newdog.png (100%) rename src/main/{Frontend => resources/templates}/desktop.html (85%) rename src/main/{Frontend => resources/templates}/login.html (91%) diff --git a/pom.xml b/pom.xml index 4628205..8a7a104 100644 --- a/pom.xml +++ b/pom.xml @@ -77,7 +77,11 @@ junit test - + + org.springframework.boot + spring-boot-starter-thymeleaf + + diff --git a/src/main/java/com/production/ehayvanbackendapi/Controllers/VeterinarianController.java b/src/main/java/com/production/ehayvanbackendapi/Controllers/VeterinarianController.java index 5e1df4a..13b9480 100644 --- a/src/main/java/com/production/ehayvanbackendapi/Controllers/VeterinarianController.java +++ b/src/main/java/com/production/ehayvanbackendapi/Controllers/VeterinarianController.java @@ -1,5 +1,7 @@ package com.production.ehayvanbackendapi.Controllers; - +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; import com.production.ehayvanbackendapi.DTO.VeterinarianDTO; import com.production.ehayvanbackendapi.DTO.request.CreateOrUpdateVeterinarianDTO; import com.production.ehayvanbackendapi.Services.VeterinarianService; @@ -8,7 +10,7 @@ import org.springframework.web.bind.annotation.*; import java.util.List; -@RestController +@Controller @RequestMapping("/api/veterinarians") public class VeterinarianController { private final VeterinarianService veterinarianService; @@ -84,6 +86,13 @@ public ResponseEntity> getAllVeterinarians() { } } + @GetMapping("/desktop") + public String desktop(Model model) { + List veterinarians = veterinarianService.getAllVeterinarians(); + model.addAttribute("veterinarians", veterinarians); + return "desktop"; + } + // Other controller methods for updating, deleting veterinarians, etc. } diff --git a/src/main/Frontend/Images/Icon.png b/src/main/resources/static/images/Icon.png similarity index 100% rename from src/main/Frontend/Images/Icon.png rename to src/main/resources/static/images/Icon.png diff --git a/src/main/Frontend/Images/Union.png b/src/main/resources/static/images/Union.png similarity index 100% rename from src/main/Frontend/Images/Union.png rename to src/main/resources/static/images/Union.png diff --git a/src/main/Frontend/Images/logout.png b/src/main/resources/static/images/logout.png similarity index 100% rename from src/main/Frontend/Images/logout.png rename to src/main/resources/static/images/logout.png diff --git a/src/main/Frontend/Images/newdog.png b/src/main/resources/static/images/newdog.png similarity index 100% rename from src/main/Frontend/Images/newdog.png rename to src/main/resources/static/images/newdog.png diff --git a/src/main/Frontend/desktop.html b/src/main/resources/templates/desktop.html similarity index 85% rename from src/main/Frontend/desktop.html rename to src/main/resources/templates/desktop.html index 15114bc..1524bd9 100644 --- a/src/main/Frontend/desktop.html +++ b/src/main/resources/templates/desktop.html @@ -1,5 +1,5 @@ - + @@ -30,11 +30,11 @@
E-H
- Logo + Logo
YV
- Logo + Logo
N
@@ -52,7 +52,7 @@
Esther
- Logout Icon + Logout Icon
@@ -69,14 +69,23 @@ - - - - - - -
NameClinic NameDelete
- + + + + + + + + + + + + + + +
NameClinic NameDelete
+ +