commit e91fef9c377db2fb5cac4e9e37be02fd9a45975e
Author: Jakub Smid <jaksmid@seznam.cz>
Date:   Thu Mar 31 09:31:57 2022 +0200

    Added swagger summary for controllers

diff --git a/backend/src/main/java/cz/zcu/kiv/backendapi/catalog/CatalogController.java b/backend/src/main/java/cz/zcu/kiv/backendapi/catalog/CatalogController.java
index 484057c..d230218 100644
--- a/backend/src/main/java/cz/zcu/kiv/backendapi/catalog/CatalogController.java
+++ b/backend/src/main/java/cz/zcu/kiv/backendapi/catalog/CatalogController.java
@@ -1,5 +1,6 @@
 package cz.zcu.kiv.backendapi.catalog;
 
+import io.swagger.v3.oas.annotations.Operation;
 import lombok.RequiredArgsConstructor;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
@@ -13,7 +14,7 @@ import java.util.UUID;
  */
 @RestController
 @RequiredArgsConstructor
-@RequestMapping("")
+@RequestMapping("/catalog-items")
 public class CatalogController {
 
     /**
@@ -26,7 +27,8 @@ public class CatalogController {
      *
      * @param catalogItemDto catalog item DTO
      */
-    @PostMapping("/catalog-item")
+    @PostMapping("")
+    @Operation(summary = "creates new catalog item")
     public void addCatalogItem(@RequestBody CatalogItemDto catalogItemDto) {
         catalogService.saveCatalogItem(catalogItemDto);
     }
@@ -39,7 +41,8 @@ public class CatalogController {
      * @param type    type - optional
      * @return list of catalog items satisfying given filter
      */
-    @GetMapping("/catalog")
+    @GetMapping("")
+    @Operation(summary = "returns catalog items based on filter")
     public ResponseEntity<List<CatalogItemDto>> getCatalog(@RequestParam(defaultValue = "") String name, @RequestParam(defaultValue = "") String country, @RequestParam(defaultValue = "") String type) {
         return new ResponseEntity<>(catalogService.getCatalog(name, country, type), HttpStatus.OK);
     }
@@ -50,7 +53,8 @@ public class CatalogController {
      * @param id             ID
      * @param catalogItemDto catalog item DTO
      */
-    @PutMapping("/catalog-item/{id}")
+    @PutMapping("/{id}")
+    @Operation(summary = "updates catalog item with given ID")
     public void updateCatalogItem(@PathVariable UUID id, @RequestBody CatalogItemDto catalogItemDto) {
         catalogService.updateCatalogItem(id, catalogItemDto);
     }
@@ -60,7 +64,8 @@ public class CatalogController {
      *
      * @param id ID
      */
-    @DeleteMapping("/catalog-item/{id}")
+    @DeleteMapping("/{id}")
+    @Operation(summary = "deletes catalog item with given ID")
     public void deleteCatalogItem(@PathVariable UUID id) {
         catalogService.deleteCatalogItem(id);
     }
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 ba3b158..1355543 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
@@ -1,5 +1,6 @@
 package cz.zcu.kiv.backendapi.titlepage;
 
+import io.swagger.v3.oas.annotations.Operation;
 import lombok.RequiredArgsConstructor;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
@@ -23,6 +24,7 @@ public class TitlePageController {
      * @return title page
      */
     @GetMapping("")
+    @Operation(summary = "returns title page")
     public ResponseEntity<TitlePage> getTitlePage() {
         return new ResponseEntity<>(titlePageService.getTitlePage(), HttpStatus.OK);
     }
@@ -33,6 +35,7 @@ public class TitlePageController {
      * @param titlePage title page
      */
     @PostMapping("")
+    @Operation(summary = "updates/creates title page")
     public void updateTitlePage(@RequestBody TitlePage titlePage) {
         titlePageService.updateTitlePage(titlePage);
     }
diff --git a/backend/src/main/java/cz/zcu/kiv/backendapi/user/UserController.java b/backend/src/main/java/cz/zcu/kiv/backendapi/user/UserController.java
index 6843f25..ba1bab6 100644
--- a/backend/src/main/java/cz/zcu/kiv/backendapi/user/UserController.java
+++ b/backend/src/main/java/cz/zcu/kiv/backendapi/user/UserController.java
@@ -9,6 +9,7 @@ import cz.zcu.kiv.backendapi.exception.ApiRequestException;
 import cz.zcu.kiv.backendapi.security.jwt.JwtUtils;
 import cz.zcu.kiv.backendapi.user.password.PasswordDto;
 import cz.zcu.kiv.backendapi.user.permission.PermissionDto;
+import io.swagger.v3.oas.annotations.Operation;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.http.HttpHeaders;
@@ -33,6 +34,7 @@ import java.util.stream.Collectors;
  */
 @RestController
 @RequiredArgsConstructor
+@RequestMapping("/users")
 @Slf4j
 public class UserController {
 
@@ -52,7 +54,8 @@ public class UserController {
      *
      * @param userDto user DTO
      */
-    @PostMapping("/register")
+    @PostMapping("")
+    @Operation(summary = "registers new user")
     public void registerNewUser(@RequestBody @Valid UserDto userDto) {
         userService.registerNewUser(userDto);
     }
@@ -64,7 +67,8 @@ public class UserController {
      * @param oldPassword old password
      * @param passwordDto password DTO
      */
-    @PatchMapping("/user/change-password")
+    @PatchMapping("/password")
+    @Operation(summary = "changes password to logged-in user")
     public void changePassword(@Valid @NotNull(message = "Old password must not be null") @RequestParam String oldPassword, @RequestBody @Valid PasswordDto passwordDto) {
         userService.changePassword(oldPassword, passwordDto.getPassword());
     }
@@ -74,7 +78,8 @@ public class UserController {
      *
      * @return list of all users
      */
-    @GetMapping("/users")
+    @GetMapping("")
+    @Operation(summary = "returns all users")
     public ResponseEntity<List<UserDto>> getAllUsers() {
         return new ResponseEntity<>(userService.getAllUsers(), HttpStatus.OK);
     }
@@ -85,7 +90,8 @@ public class UserController {
      * @param username      username
      * @param permissionDto permissions
      */
-    @PatchMapping("/user/update-permissions/{username}")
+    @PatchMapping("/{username}/permissions")
+    @Operation(summary = "changes permissions to given user")
     public void updatePermissions(@PathVariable String username, @RequestBody PermissionDto permissionDto) {
         userService.updatePermissions(username, permissionDto);
     }
@@ -96,13 +102,15 @@ public class UserController {
      * @param username    username
      * @param passwordDto password
      */
-    @PatchMapping(value = "/user/reset-password/{username}")
+    @PatchMapping(value = "/{username}/password")
+    @Operation(summary = "changes password to given user")
     public void resetPassword(@PathVariable String username, @RequestBody @Valid PasswordDto passwordDto) {
         userService.resetPassword(username, passwordDto.getPassword());
     }
 
     //TODO check if needed, comment otherwise
-    @DeleteMapping("/user/{username}")
+    @DeleteMapping("/{username}")
+    @Operation(summary = "deletes user with given username")
     public void deleteUser(@PathVariable String username) {
         userService.deleteUser(username);
     }
@@ -115,7 +123,8 @@ public class UserController {
      * @param response response
      * @throws IOException I/O Exception
      */
-    @GetMapping("token/refresh")
+    @GetMapping("/token")
+    @Operation(summary = "returns a new access token and a refresh token to user")
     public void refreshToken(HttpServletRequest request, HttpServletResponse response) throws IOException {
         String authorizationHeader = request.getHeader(HttpHeaders.AUTHORIZATION);
         if (Strings.isNullOrEmpty(authorizationHeader) || !authorizationHeader.startsWith(jwtUtils.getTokenPrefix())) {
