diff --git a/docs/NEW_MODULE_TEMPLATE.md b/docs/NEW_MODULE_TEMPLATE.md
index c1484524..37d62a62 100644
--- a/docs/NEW_MODULE_TEMPLATE.md
+++ b/docs/NEW_MODULE_TEMPLATE.md
@@ -67,11 +67,14 @@ import java.util.stream.Collectors;
@Service
public class CheckinService {
- @Autowired
- private CheckinRepository checkinRepo;
+ private final CheckinRepository checkinRepo;
+ private final StudentRepository studentRepo;
@Autowired
- private StudentRepository studentRepo;
+ public CheckinService(CheckinRepository checkinRepo, StudentRepository studentRepo) {
+ this.checkinRepo = checkinRepo;
+ this.studentRepo = studentRepo;
+ }
public Checkin save(Checkin checkin) {
if (checkin.getDate() == null) {
@@ -130,8 +133,12 @@ import java.util.List;
@RequestMapping("/checkin")
public class CheckinController {
+ private final CheckinService checkinService;
+
@Autowired
- private CheckinService checkinService;
+ public CheckinController(CheckinService checkinService) {
+ this.checkinService = checkinService;
+ }
@GetMapping("/")
public String home(ModelMap model) {
@@ -198,7 +205,7 @@ public class CheckinController {
- Use `checkin/read.html` as a resource, not a template
-```HTML
+```HTML
@@ -242,7 +249,7 @@ public class CheckinController {
|
|
- |