Skip to content

Commit

Permalink
update: Notification microservice
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioscardace committed Jul 14, 2024
1 parent 8f184a3 commit 5c24007
Showing 1 changed file with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,11 @@ public SenderCreator(ApplicationContext applicationContext) {
}

public ISender getSender(String contactType) {
switch (contactType) {
case "email":
return this.applicationContext.getBean(EmailSender.class);
case "slack":
return this.applicationContext.getBean(SlackSender.class);
case "telegram":
return this.applicationContext.getBean(TelegramSender.class);
default:
throw new IllegalArgumentException("Unknown Contact type " + contactType);
}
return switch (contactType) {
case "email" -> this.applicationContext.getBean(EmailSender.class);
case "slack" -> this.applicationContext.getBean(SlackSender.class);
case "telegram" -> this.applicationContext.getBean(TelegramSender.class);
default -> throw new IllegalArgumentException("Unknown Contact type " + contactType);
};
}
}

0 comments on commit 5c24007

Please sign in to comment.