-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
알림 작업 구조 개선 & 특정 알림 메시지 구체화
- Loading branch information
Showing
56 changed files
with
1,465 additions
and
493 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
15 changes: 15 additions & 0 deletions
15
backend/src/main/java/mouda/backend/chat/domain/ChatNotificationEvent.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,15 @@ | ||
package mouda.backend.chat.domain; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
@Builder | ||
public class ChatNotificationEvent { | ||
|
||
private final Long darakbangId; | ||
private final ChatRoom chatRoom; | ||
private final Chat appendedChat; | ||
} |
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
26 changes: 26 additions & 0 deletions
26
backend/src/main/java/mouda/backend/chat/implement/notification/ChatNotificationSender.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 mouda.backend.chat.implement.notification; | ||
|
||
import org.springframework.context.ApplicationEventPublisher; | ||
import org.springframework.stereotype.Component; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import mouda.backend.chat.domain.Chat; | ||
import mouda.backend.chat.domain.ChatNotificationEvent; | ||
import mouda.backend.chat.domain.ChatRoom; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
public class ChatNotificationSender { | ||
|
||
private final ApplicationEventPublisher eventPublisher; | ||
|
||
public void sendChatNotification(long darakbangId, ChatRoom chatRoom, Chat appendedChat) { | ||
ChatNotificationEvent event = ChatNotificationEvent.builder() | ||
.darakbangId(darakbangId) | ||
.chatRoom(chatRoom) | ||
.appendedChat(appendedChat) | ||
.build(); | ||
|
||
eventPublisher.publishEvent(event); | ||
} | ||
} |
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
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
12 changes: 5 additions & 7 deletions
12
...ender/AbstractMoimNotificationSender.java → ...tMoimRelatedNotificationEventHandler.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 |
---|---|---|
@@ -1,23 +1,21 @@ | ||
package mouda.backend.moim.implement.sender; | ||
package mouda.backend.moim.implement.notificiation; | ||
|
||
import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
import org.springframework.stereotype.Component; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import mouda.backend.common.config.UrlConfig; | ||
import mouda.backend.notification.implement.NotificationProcessor; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
@EnableConfigurationProperties(UrlConfig.class) | ||
public abstract class AbstractMoimNotificationSender { | ||
public abstract class AbstractMoimRelatedNotificationEventHandler { | ||
|
||
private final UrlConfig urlConfig; | ||
protected final UrlConfig urlConfig; | ||
protected final NotificationProcessor notificationProcessor; | ||
|
||
protected String getMoimUrl(long darakbangId, long moimId) { | ||
return urlConfig.getMoimUrl(darakbangId, moimId); | ||
} | ||
|
||
protected String getChatRoomUrl(long darakbangId, long moimId) { | ||
return urlConfig.getChatRoomUrl(darakbangId, moimId); | ||
} | ||
} |
Oops, something went wrong.