|
@ -61,10 +61,15 @@ public class FlightReservation { |
|
|
status = Confirmed; |
|
|
status = Confirmed; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public boolean notifyUser(String type, String email, String content) { |
|
|
|
|
|
|
|
|
public boolean notifyUser(String type, String to, String content) { |
|
|
Notification notification = null; |
|
|
Notification notification = null; |
|
|
switch (type) { |
|
|
switch (type) { |
|
|
case "email": notification = new EmailNotification(email, content); |
|
|
|
|
|
|
|
|
case "email": |
|
|
|
|
|
notification = new EmailNotification(to, content); |
|
|
|
|
|
break; |
|
|
|
|
|
case "sms": |
|
|
|
|
|
notification = new SmsNotification(to, content); |
|
|
|
|
|
break; |
|
|
} |
|
|
} |
|
|
return notification.sendNotification(); |
|
|
return notification.sendNotification(); |
|
|
} |
|
|
} |
|
|