Skip to content

Commit ebee85e

Browse files
Changed to constructor autowiring
1 parent 099189c commit ebee85e

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/platform/controller/APIController.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@
1717
@RequestMapping(path = "/api")
1818
@Validated
1919
public class APIController {
20+
21+
private final CodeService codeService;
22+
2023
@Autowired
21-
private CodeService codeService;
24+
public APIController(CodeService codeService) {
25+
this.codeService = codeService;
26+
}
2227

2328
@GetMapping(path = "/code/{id}")
2429
@ResponseBody

src/platform/controller/WebInterfaceController.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,13 @@
1313
@Controller
1414
@Validated
1515
public class WebInterfaceController {
16+
17+
private final CodeService codeService;
18+
1619
@Autowired
17-
private CodeService codeService;
20+
public WebInterfaceController(CodeService codeService) {
21+
this.codeService = codeService;
22+
}
1823

1924
@GetMapping(path = "/code/{id}")
2025
public String getCodeSnippetById(Model model, @PathVariable("id") @Size(min = 36, max = 36) String id) {

0 commit comments

Comments
 (0)