-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e5dc38
commit 1966c3a
Showing
8 changed files
with
155 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/main/java/com/tukorea/planding/domain/notify/service/schedule/NotificationHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.tukorea.planding.domain.notify.service.schedule; | ||
|
||
import com.tukorea.planding.domain.notify.dto.NotificationDTO; | ||
|
||
public interface NotificationHandler { | ||
public void sendNotification(NotificationDTO request); | ||
} |
26 changes: 26 additions & 0 deletions
26
.../java/com/tukorea/planding/domain/notify/service/schedule/NotificationHandlerFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.tukorea.planding.domain.notify.service.schedule; | ||
|
||
import com.tukorea.planding.domain.notify.entity.NotificationType; | ||
import com.tukorea.planding.global.error.BusinessException; | ||
import com.tukorea.planding.global.error.ErrorCode; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class NotificationHandlerFactory { | ||
|
||
private final PersonalScheduleNotificationHandler personalScheduleNotificationHandler; | ||
private final GroupScheduleNotificationHandler groupScheduleNotificationHandler; | ||
|
||
public NotificationHandler getHandler(NotificationType notificationType) { | ||
switch (notificationType) { | ||
case PERSONAL_SCHEDULE: | ||
return personalScheduleNotificationHandler; | ||
case GROUP_SCHEDULE: | ||
return groupScheduleNotificationHandler; | ||
default: | ||
throw new BusinessException(ErrorCode.ALARM_NOT_FOUND); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.