From 4d9f0fbb0ee0c3dae15635eba1fa47d74b771206 Mon Sep 17 00:00:00 2001 From: Mika Bomm Date: Sun, 1 Sep 2024 21:35:20 +0200 Subject: [PATCH] change api scheme to /api/v1/feature and use construction injection instead of field injection --- .../mixel/docusphere/controller/DocumentController.java | 8 ++++++-- .../com/mixel/docusphere/controller/UserController.java | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/com/mixel/docusphere/controller/DocumentController.java b/server/src/main/java/com/mixel/docusphere/controller/DocumentController.java index c3f0ac6..b371e28 100644 --- a/server/src/main/java/com/mixel/docusphere/controller/DocumentController.java +++ b/server/src/main/java/com/mixel/docusphere/controller/DocumentController.java @@ -11,11 +11,15 @@ import java.util.Optional; import java.util.UUID; @RestController -@RequestMapping("/documents") +@RequestMapping("/api/v1/documents") public class DocumentController { + private final DocumentService documentService; + @Autowired - private DocumentService documentService; + public DocumentController(DocumentService documentService) { + this.documentService = documentService; + } @GetMapping public List getAllDocuments() { diff --git a/server/src/main/java/com/mixel/docusphere/controller/UserController.java b/server/src/main/java/com/mixel/docusphere/controller/UserController.java index 211c8b7..5b9035f 100644 --- a/server/src/main/java/com/mixel/docusphere/controller/UserController.java +++ b/server/src/main/java/com/mixel/docusphere/controller/UserController.java @@ -11,11 +11,15 @@ import java.util.Optional; import java.util.UUID; @RestController -@RequestMapping("/users") +@RequestMapping("/api/v1/users") public class UserController { + private final UserService userService; + @Autowired - private UserService userService; + public UserController(UserService userService) { + this.userService = userService; + } @GetMapping public List getAllUsers() {