change api scheme to /api/v1/feature and use construction injection instead of field injection

This commit is contained in:
Mika Bomm 2024-09-01 21:35:20 +02:00
parent 23affca287
commit 4d9f0fbb0e
2 changed files with 12 additions and 4 deletions

View file

@ -11,11 +11,15 @@ import java.util.Optional;
import java.util.UUID; import java.util.UUID;
@RestController @RestController
@RequestMapping("/documents") @RequestMapping("/api/v1/documents")
public class DocumentController { public class DocumentController {
private final DocumentService documentService;
@Autowired @Autowired
private DocumentService documentService; public DocumentController(DocumentService documentService) {
this.documentService = documentService;
}
@GetMapping @GetMapping
public List<Document> getAllDocuments() { public List<Document> getAllDocuments() {

View file

@ -11,11 +11,15 @@ import java.util.Optional;
import java.util.UUID; import java.util.UUID;
@RestController @RestController
@RequestMapping("/users") @RequestMapping("/api/v1/users")
public class UserController { public class UserController {
private final UserService userService;
@Autowired @Autowired
private UserService userService; public UserController(UserService userService) {
this.userService = userService;
}
@GetMapping @GetMapping
public List<User> getAllUsers() { public List<User> getAllUsers() {