-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 스터디 알림 기능을 구현한다. #593
Draft
poi1649
wants to merge
8
commits into
BE/develop
Choose a base branch
from
BE/feature/572-f
base: BE/develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5a1a2e4
feat: fcm을 통한 알림 발송 기능 추가
poi1649 e75bf0e
test: 테스트 작성중 (임시)
poi1649 46e762a
fix: 도메인 이벤트 추가 후 발생한 테스트 에러 수정
yujamint 8d3e719
fix: 도메인 이벤트 발행 로직 테스트 통과하도록 수정
yujamint 62acc8d
test: 스터디 신청 수락 알림 기능 테스트
yujamint c7809bb
test: 머스트두 등록 알림 기능 테스트
yujamint ee1ffaf
test: 피드 작성 알림 기능 테스트
yujamint 1bcb5f6
test: 머스트두 인증 등록 알림 기능 테스트
yujamint File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
8 changes: 8 additions & 0 deletions
8
backend/src/main/java/com/yigongil/backend/domain/event/CertificationCreatedEvent.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,8 @@ | ||
package com.yigongil.backend.domain.event; | ||
|
||
public record CertificationCreatedEvent( | ||
Long studyId, | ||
String studyName, | ||
String authorGithubId | ||
) { | ||
} |
15 changes: 15 additions & 0 deletions
15
backend/src/main/java/com/yigongil/backend/domain/event/FeedPostCreatedEvent.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 com.yigongil.backend.domain.event; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
public record FeedPostCreatedEvent | ||
( | ||
Long studyId, | ||
String studyName, | ||
String authorGithubId, | ||
String content, | ||
String imageUrl, | ||
LocalDateTime createdAt | ||
) implements DomainEvent { | ||
|
||
} |
5 changes: 0 additions & 5 deletions
5
backend/src/main/java/com/yigongil/backend/domain/event/MemberDeleteEvent.java
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
backend/src/main/java/com/yigongil/backend/domain/event/MemberDeletedEvent.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,5 @@ | ||
package com.yigongil.backend.domain.event; | ||
|
||
public record MemberDeletedEvent(Long memberId) implements DomainEvent { | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
backend/src/main/java/com/yigongil/backend/domain/event/MustDoUpdatedEvent.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,8 @@ | ||
package com.yigongil.backend.domain.event; | ||
|
||
public record MustDoUpdatedEvent( | ||
Long studyId, | ||
String studyName, | ||
String mustDo | ||
) implements DomainEvent{ | ||
} |
5 changes: 5 additions & 0 deletions
5
backend/src/main/java/com/yigongil/backend/domain/event/StudyAppliedEvent.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,5 @@ | ||
package com.yigongil.backend.domain.event; | ||
|
||
public record StudyAppliedEvent(Long studyMasterId, String studyName, String appliedMemberGithubId) implements DomainEvent { | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
backend/src/main/java/com/yigongil/backend/domain/event/StudyCreatedEvent.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,5 @@ | ||
package com.yigongil.backend.domain.event; | ||
|
||
public record StudyCreatedEvent(Long studyId, Long masterId) implements DomainEvent { | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
backend/src/main/java/com/yigongil/backend/domain/event/StudyPermittedEvent.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,5 @@ | ||
package com.yigongil.backend.domain.event; | ||
|
||
public record StudyPermittedEvent(Long permittedMemberId, Long studyId, String studyName) implements DomainEvent { | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
backend/src/main/java/com/yigongil/backend/domain/event/StudyStartedEvent.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,5 @@ | ||
package com.yigongil.backend.domain.event; | ||
|
||
public record StudyStartedEvent(Long studyId, String studyName) implements DomainEvent { | ||
|
||
} |
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
10 changes: 10 additions & 0 deletions
10
backend/src/main/java/com/yigongil/backend/exception/MemberNotRegisteredException.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,10 @@ | ||
package com.yigongil.backend.exception; | ||
|
||
import org.springframework.http.HttpStatus; | ||
|
||
public class MemberNotRegisteredException extends HttpException { | ||
|
||
public MemberNotRegisteredException(final String message, final String input) { | ||
super(HttpStatus.BAD_REQUEST, message, input); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
backend/src/main/java/com/yigongil/backend/infra/FirebaseCloudMessageSender.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,32 @@ | ||
package com.yigongil.backend.infra; | ||
|
||
import com.google.firebase.messaging.FirebaseMessaging; | ||
import com.google.firebase.messaging.Message; | ||
import java.util.List; | ||
import org.springframework.context.annotation.Profile; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Profile(value = {"prod", "dev"}) | ||
@Component | ||
public class FirebaseCloudMessageSender implements MessageSender { | ||
|
||
private final FirebaseMessaging firebaseMessaging; | ||
|
||
public FirebaseCloudMessageSender(FirebaseMessaging firebaseMessaging) { | ||
this.firebaseMessaging = firebaseMessaging; | ||
} | ||
|
||
@Override | ||
public void subscribeToTopicAsync(List<String> tokens, String topic) { | ||
firebaseMessaging.subscribeToTopicAsync(tokens, topic); | ||
} | ||
|
||
@Override | ||
public void send(String message, String topic) { | ||
Message topicMessage = Message.builder() | ||
.setTopic(topic) | ||
.putData("message", message) | ||
.build(); | ||
firebaseMessaging.sendAsync(topicMessage); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이벤트 중에서 이 녀석만
createdAt
을 가지고 있는 이유가 무엇인가요??