api: Add footer pages and fix profile bugs

pull/1/head
Lunix-420 2024-10-31 12:35:00 +01:00
parent dc35da8128
commit 989a151f7a
3 changed files with 28 additions and 7 deletions

View File

@ -2,12 +2,16 @@ package com.maradona.backend.controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import com.maradona.backend.entities.Project;
import com.maradona.backend.services.EmployeeService;
import com.maradona.backend.services.ProjectService;
import com.maradona.backend.services.PrimarySkillService;
import com.maradona.backend.services.SecondarySkillService;
@Controller
public class PageController {
@ -16,7 +20,13 @@ public class PageController {
private ProjectService projectService;
@Autowired
private EmployeeController employeeController;
private EmployeeService employeeService;
@Autowired
private PrimarySkillService primarySkillService;
@Autowired
private SecondarySkillService secondarySkillService;
@GetMapping("/")
public String index(Model model) {
@ -27,8 +37,19 @@ public class PageController {
@GetMapping("/profile")
public String profile(Model model) {
var employeeData = employeeController.getEmployee(Long.valueOf(1));
model.addAttribute("employeeData", employeeData);
var employeeData = employeeService.getEmployeeById(Long.valueOf(1));
System.out.println(employeeData);
model.addAttribute("employee", employeeData.orElse(null));
return "profile";
}
@GetMapping("/impressum")
public String impressum() {
return "impressum";
}
@GetMapping("/datenschutz")
public String datenschutz() {
return "datenschutz";
}
}

View File

@ -1,5 +1,5 @@
<footer>
<p>&copy INTER Versicherungsgruppe</p>
<a href="Impressumlelele">Impressum</a>
<a href="Datenschutzlelele">Datenschutz</a>
<a href="Impressum">Impressum</a>
<a href="Datenschutz">Datenschutz</a>
</footer>

View File

@ -10,10 +10,10 @@
<h2>Profile</h2>
<ul>
<li th:text="${employee.formOfAddress}">Form of Address</li>
<li th:text="${employee.formOfAddress.description}">Form of Address</li>
<li th:text="${employee.firstName}">First Name</li>
<li th:text="${employee.lastName}">Last Name</li>
<li th:text="${employee.email}">Email</li>
<li th:text="${employee.mail}">Email</li>
<li <p>6969420</p></li>
<!-- TODO: Add Profile Phonenumber -->
</ul>