-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
24 changed files
with
372 additions
and
375 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
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
16 changes: 8 additions & 8 deletions
16
src/main/java/toy/bookchat/bookchat/infrastructure/fcm/ChatMessageBody.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,17 +1,17 @@ | ||
package toy.bookchat.bookchat.infrastructure.push; | ||
package toy.bookchat.bookchat.infrastructure.fcm; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class ChatMessageBody { | ||
|
||
private Long chatId; | ||
private Long chatRoomId; | ||
private Long chatId; | ||
private Long chatRoomId; | ||
|
||
@Builder | ||
private ChatMessageBody(Long chatId, Long chatRoomId) { | ||
this.chatId = chatId; | ||
this.chatRoomId = chatRoomId; | ||
} | ||
@Builder | ||
private ChatMessageBody(Long chatId, Long chatRoomId) { | ||
this.chatId = chatId; | ||
this.chatRoomId = chatRoomId; | ||
} | ||
} |
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
20 changes: 10 additions & 10 deletions
20
src/main/java/toy/bookchat/bookchat/infrastructure/fcm/PushMessageBody.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,19 +1,19 @@ | ||
package toy.bookchat.bookchat.infrastructure.push; | ||
package toy.bookchat.bookchat.infrastructure.fcm; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public class PushMessageBody { | ||
|
||
private PushType pushType; | ||
private Object body; | ||
private PushType pushType; | ||
private Object body; | ||
|
||
private PushMessageBody(PushType pushType, Object body) { | ||
this.pushType = pushType; | ||
this.body = body; | ||
} | ||
private PushMessageBody(PushType pushType, Object body) { | ||
this.pushType = pushType; | ||
this.body = body; | ||
} | ||
|
||
public static PushMessageBody of(PushType pushType, Object body) { | ||
return new PushMessageBody(pushType, body); | ||
} | ||
public static PushMessageBody of(PushType pushType, Object body) { | ||
return new PushMessageBody(pushType, body); | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
src/main/java/toy/bookchat/bookchat/infrastructure/fcm/PushType.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,7 +1,7 @@ | ||
package toy.bookchat.bookchat.infrastructure.push; | ||
package toy.bookchat.bookchat.infrastructure.fcm; | ||
|
||
public enum PushType { | ||
|
||
LOGIN, | ||
CHAT; | ||
LOGIN, | ||
CHAT; | ||
} |
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
6 changes: 3 additions & 3 deletions
6
src/main/java/toy/bookchat/bookchat/infrastructure/fcm/service/PushService.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,8 +1,8 @@ | ||
package toy.bookchat.bookchat.infrastructure.push.service; | ||
package toy.bookchat.bookchat.infrastructure.fcm.service; | ||
|
||
import toy.bookchat.bookchat.infrastructure.push.PushMessageBody; | ||
import toy.bookchat.bookchat.infrastructure.fcm.PushMessageBody; | ||
|
||
public interface PushService { | ||
|
||
void send(String fcmToken, PushMessageBody pushMessageBody); | ||
void send(String fcmToken, PushMessageBody pushMessageBody); | ||
} |
28 changes: 14 additions & 14 deletions
28
src/main/java/toy/bookchat/bookchat/infrastructure/rabbitmq/MessagePublisher.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,26 +1,26 @@ | ||
package toy.bookchat.bookchat.infrastructure.broker; | ||
package toy.bookchat.bookchat.infrastructure.rabbitmq; | ||
|
||
import org.springframework.messaging.simp.SimpMessagingTemplate; | ||
import org.springframework.stereotype.Component; | ||
import toy.bookchat.bookchat.infrastructure.broker.message.CommonMessage; | ||
import toy.bookchat.bookchat.infrastructure.broker.message.NotificationMessage; | ||
import toy.bookchat.bookchat.infrastructure.rabbitmq.message.CommonMessage; | ||
import toy.bookchat.bookchat.infrastructure.rabbitmq.message.NotificationMessage; | ||
|
||
@Component | ||
public class MessagePublisher { | ||
|
||
private final String DESTINATION_PREFIX = "/topic/"; | ||
private final String DESTINATION_PREFIX = "/topic/"; | ||
|
||
private final SimpMessagingTemplate messagingTemplate; | ||
private final SimpMessagingTemplate messagingTemplate; | ||
|
||
public MessagePublisher(SimpMessagingTemplate messagingTemplate) { | ||
this.messagingTemplate = messagingTemplate; | ||
} | ||
public MessagePublisher(SimpMessagingTemplate messagingTemplate) { | ||
this.messagingTemplate = messagingTemplate; | ||
} | ||
|
||
public void sendCommonMessage(String roomSid, CommonMessage commonMessage) { | ||
messagingTemplate.convertAndSend(DESTINATION_PREFIX + roomSid, commonMessage); | ||
} | ||
public void sendCommonMessage(String roomSid, CommonMessage commonMessage) { | ||
messagingTemplate.convertAndSend(DESTINATION_PREFIX + roomSid, commonMessage); | ||
} | ||
|
||
public void sendNotificationMessage(String roomSid, NotificationMessage notificationMessage) { | ||
messagingTemplate.convertAndSend(DESTINATION_PREFIX + roomSid, notificationMessage); | ||
} | ||
public void sendNotificationMessage(String roomSid, NotificationMessage notificationMessage) { | ||
messagingTemplate.convertAndSend(DESTINATION_PREFIX + roomSid, notificationMessage); | ||
} | ||
} |
Oops, something went wrong.