Skip to content

Commit 88ace05

Browse files
author
Nilanchal Panigrahy
committed
Misc improvements
1 parent d2ee50f commit 88ace05

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

004-spring-dependency-injection/naive-method/src/com/example/app/service/EmailService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
public class EmailService {
44

55
public void emailUser(String subject, String toEmail, String template) {
6-
//Send email here
6+
//Send email over SMTP here
77
}
88
}

004-spring-dependency-injection/naive-method/src/com/example/app/service/ShoppingCartService.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ public ShoppingCartService() {
1212
}
1313

1414
public void checkout(Product product, User user) {
15+
//Logic to check out the product
16+
17+
//Payment verification
18+
1519
emailService.emailUser("Order placed successfully for " + product.getName(),
1620
user.getEmail(),
1721
"test-email-template.html");

004-spring-dependency-injection/naive-method/src/com/example/app/service/UserService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
public class UserService {
66

7-
private final EmailService emailService;
87
private final UserDao userDao;
8+
private final EmailService emailService;
99

1010
public UserService() {
11-
emailService = new EmailService();
1211
userDao = new UserDao();
12+
emailService = new EmailService();
1313
}
1414

1515
public void registerUser(User user) {

0 commit comments

Comments
 (0)