commit 0b4fc09da6311b337527a3ac14dc0464d7df5749
Author: Jakub Smid <jaksmid@seznam.cz>
Date:   Tue Mar 29 14:09:20 2022 +0200

    Reformatted title page
    re #9383

diff --git a/backend/src/main/java/cz/zcu/kiv/backendapi/titlepage/ITitlePageService.java b/backend/src/main/java/cz/zcu/kiv/backendapi/titlepage/ITitlePageService.java
index 4161849..4e35557 100644
--- a/backend/src/main/java/cz/zcu/kiv/backendapi/titlepage/ITitlePageService.java
+++ b/backend/src/main/java/cz/zcu/kiv/backendapi/titlepage/ITitlePageService.java
@@ -13,5 +13,12 @@ public interface ITitlePageService {
      */
     List<TitlePage> getTitlePages();
 
-    void addNewTitlePage(TitlePage titlePage);
+    /**
+     * Adds or updates title page with given ID
+     *
+     * @param id        ID
+     * @param titlePage title page
+     */
+    void addOrUpdateTitlePage(Long id, TitlePage titlePage);
+
 }
diff --git a/backend/src/main/java/cz/zcu/kiv/backendapi/titlepage/TitlePage.java b/backend/src/main/java/cz/zcu/kiv/backendapi/titlepage/TitlePage.java
index 1621cbf..3963585 100644
--- a/backend/src/main/java/cz/zcu/kiv/backendapi/titlepage/TitlePage.java
+++ b/backend/src/main/java/cz/zcu/kiv/backendapi/titlepage/TitlePage.java
@@ -1,13 +1,12 @@
 package cz.zcu.kiv.backendapi.titlepage;
 
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
+import javax.persistence.*;
+import java.util.UUID;
 
 /**
  * Class representing title page
@@ -18,11 +17,16 @@ import javax.persistence.Table;
 @Entity
 @Table(name = "title_page")
 public class TitlePage {
-
     /**
-     * Title – serves as ID
+     * ID
      */
     @Id
+    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
+    private Long id;
+
+    /**
+     * Title
+     */
     private String title;
 
     /**
diff --git a/backend/src/main/java/cz/zcu/kiv/backendapi/titlepage/TitlePageController.java b/backend/src/main/java/cz/zcu/kiv/backendapi/titlepage/TitlePageController.java
index 6673749..6906746 100644
--- a/backend/src/main/java/cz/zcu/kiv/backendapi/titlepage/TitlePageController.java
+++ b/backend/src/main/java/cz/zcu/kiv/backendapi/titlepage/TitlePageController.java
@@ -30,13 +30,14 @@ public class TitlePageController {
     }
 
     /**
-     * Adds new title page
+     * Adds or updates title page
      *
+     * @param id ID of page to be created/updated
      * @param titlePage title page
      */
-    @PostMapping("")
-    public void addNewTitlePage(@RequestBody TitlePage titlePage) {
-        titlePageService.addNewTitlePage(titlePage);
+    @PutMapping("/{id}")
+    public void updateTitlePage(@PathVariable Long id, @RequestBody TitlePage titlePage) {
+        titlePageService.addOrUpdateTitlePage(id, titlePage);
     }
 
 }
diff --git a/backend/src/main/java/cz/zcu/kiv/backendapi/titlepage/TitlePageRepository.java b/backend/src/main/java/cz/zcu/kiv/backendapi/titlepage/TitlePageRepository.java
index 7c31d2f..5497d6d 100644
--- a/backend/src/main/java/cz/zcu/kiv/backendapi/titlepage/TitlePageRepository.java
+++ b/backend/src/main/java/cz/zcu/kiv/backendapi/titlepage/TitlePageRepository.java
@@ -7,5 +7,5 @@ import org.springframework.stereotype.Repository;
  * Title page repository
  */
 @Repository
-public interface TitlePageRepository extends JpaRepository<TitlePage, String> {
+public interface TitlePageRepository extends JpaRepository<TitlePage, Long> {
 }
diff --git a/backend/src/main/java/cz/zcu/kiv/backendapi/titlepage/TitlePageServiceImplementation.java b/backend/src/main/java/cz/zcu/kiv/backendapi/titlepage/TitlePageServiceImplementation.java
index 06495d2..7ab37c9 100644
--- a/backend/src/main/java/cz/zcu/kiv/backendapi/titlepage/TitlePageServiceImplementation.java
+++ b/backend/src/main/java/cz/zcu/kiv/backendapi/titlepage/TitlePageServiceImplementation.java
@@ -1,6 +1,7 @@
 package cz.zcu.kiv.backendapi.titlepage;
 
 import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -12,6 +13,7 @@ import java.util.List;
 @Service
 @Transactional
 @RequiredArgsConstructor
+@Slf4j
 public class TitlePageServiceImplementation implements ITitlePageService {
     /**
      * Title page repository
@@ -24,7 +26,8 @@ public class TitlePageServiceImplementation implements ITitlePageService {
     }
 
     @Override
-    public void addNewTitlePage(TitlePage titlePage) {
+    public void addOrUpdateTitlePage(Long id, TitlePage titlePage) {
+        titlePage.setId(id);
         titlePageRepository.save(titlePage);
     }
 }
