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;
@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<Document> getAllDocuments() {

View file

@ -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<User> getAllUsers() {