Skip to content

Commit

Permalink
Merge pull request #112 from TelePigeon/feat/111
Browse files Browse the repository at this point in the history
[feat] emotion 특정 점수 및이면 fcm알림 추가
  • Loading branch information
tkdwns414 committed Jun 12, 2024
2 parents 8c27514 + fc1d767 commit adb9fc7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public enum FcmContent {
QUESTION("질문이 도착했습니다.", "오늘의 질문을 확인하세요!", "ROOM_CLICK", "question"),
ANSWER("답변이 도착했습니다.", "상대방의 답변을 확인하세요!", "ROOM_CLICK", "answer"),
HURRY("재촉하기가 도착했습니다.", "상대방에게 답변을 보내보세요!", "ROOM_CLICK", "hurry"),
EMOTION("상대방에게 먼저 연락을 해보세요.", "상대의 기분이 좋지 않은 것 같아요!", "ROOM_CLICK", "emotion"),
ROOM_ENTER("상대방이 입장했습니다", "상대방과 대화를 시작하세요!", "ROOM_CLICK", "room"),
ROOM_LEAVE("상대방이 퇴장했습니다", "상대방이 퇴장했습니다", "ROOM_CLICK", "room"),
;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ public Answer create(
emotion
)
);
if (profile.getEmotion() < -0.5){
fcmService.send(
receiver.getUser().getFcmToken(),
FcmMessageDto.of(
FcmContent.EMOTION,
roomId
)
);
}
if (hurryRetriever.existsByProfileId(receiver.getId()))
hurryRemover.remove(hurryRetriever.findByProfileId(receiver.getId()));
fcmService.send(
Expand Down

0 comments on commit adb9fc7

Please sign in to comment.