constructor injection instead of field injection

This commit is contained in:
2025-04-18 09:23:13 +02:00
parent e60f959dfb
commit 8fc8473962
3 changed files with 8 additions and 7 deletions

View File

@@ -15,11 +15,13 @@ import java.util.List;
@RequestMapping("/api/v1/notices")
@RestController
public class NoticeController {
@Autowired
private NoticeService noticeService;
private final NoticeService noticeService;
private final ClientService clientService;
@Autowired
private ClientService clientService;
public NoticeController(NoticeService noticeService, ClientService clientService) {
this.noticeService = noticeService;
this.clientService = clientService;
}
@GetMapping("/get/all")
public List<NoticeDTO> getAllNotices() {