-
Notifications
You must be signed in to change notification settings - Fork 1
✨ OMF-218 설문 마감시 사용자에게 푸시알림 #117
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
Open
wonjuneee
wants to merge
8
commits into
develop
Choose a base branch
from
feat/OMF-218
base: 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.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ea83d20
feat: 푸시알림 기능 및 웹훅 연결 구현
wonjuneee b689d39
chore: 푸시알림 비동기 이벤트 처리를 위한 설정
wonjuneee 406e083
feat: 이벤트 처리를 기반으로 한 푸시알림 구현
wonjuneee 9f355a1
feat: 푸시알림 이벤트 추가/수정 로직 구현
wonjuneee acccde6
chore: 불필요 로그 삭제 및 주석 추가
wonjuneee 0d2f43e
docs: 요청 스키마 설명 수정
wonjuneee 63877e8
fix: 코드리뷰 반영
wonjuneee c2ef025
fix: 누락된 요청 validation 추가
wonjuneee 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
28 changes: 28 additions & 0 deletions
28
src/main/java/OneQ/OnSurvey/domain/participation/model/event/SurveyCompletedEvent.java
This file contains hidden or 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,28 @@ | ||
| package OneQ.OnSurvey.domain.participation.model.event; | ||
|
|
||
| import OneQ.OnSurvey.global.common.event.pushAlim.PushAlimEvent; | ||
|
|
||
| import java.util.Map; | ||
|
|
||
| public record SurveyCompletedEvent ( | ||
| Long userKey, | ||
| Map<String, String> eventContext | ||
| ) implements PushAlimEvent { | ||
|
|
||
| @Override | ||
| public Long getTargetUserKey() { | ||
| return userKey; | ||
| } | ||
|
|
||
| @Override | ||
| public String getPushTemplateName() { | ||
| return this.getClass().getSimpleName(); | ||
| } | ||
|
|
||
| @Override | ||
| public Map<String, String> getPushContext() { | ||
| return eventContext == null | ||
| ? Map.of() | ||
| : eventContext; | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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
9 changes: 9 additions & 0 deletions
9
src/main/java/OneQ/OnSurvey/global/common/event/pushAlim/PushAlimEvent.java
This file contains hidden or 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,9 @@ | ||
| package OneQ.OnSurvey.global.common.event.pushAlim; | ||
|
|
||
| import java.util.Map; | ||
|
|
||
| public interface PushAlimEvent { | ||
| Long getTargetUserKey(); | ||
| String getPushTemplateName(); | ||
| Map<String, String> getPushContext(); | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
src/main/java/OneQ/OnSurvey/global/infra/discord/notifier/dto/PushAlimAlert.java
This file contains hidden or 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 OneQ.OnSurvey.global.infra.discord.notifier.dto; | ||
|
|
||
| public record PushAlimAlert( | ||
| long userKey, | ||
| String templateSetCode, | ||
| long completedCount, | ||
| long failedCount, | ||
| String errorReason | ||
| ) { | ||
| } |
This file contains hidden or 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
11 changes: 11 additions & 0 deletions
11
src/main/java/OneQ/OnSurvey/global/infra/toss/common/dto/push/PushResultResponse.java
This file contains hidden or 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,11 @@ | ||
| package OneQ.OnSurvey.global.infra.toss.common.dto.push; | ||
|
|
||
| public record PushResultResponse ( | ||
| Long sentPushCount, | ||
| String sentPushContentIds | ||
| ) { | ||
|
|
||
| public static PushResultResponse of(Long sentPushCount, String sentPushContentIds) { | ||
| return new PushResultResponse(sentPushCount, sentPushContentIds); | ||
| } | ||
| } |
29 changes: 29 additions & 0 deletions
29
src/main/java/OneQ/OnSurvey/global/infra/toss/common/dto/push/PushTemplateAddRequest.java
This file contains hidden or 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,29 @@ | ||
| package OneQ.OnSurvey.global.infra.toss.common.dto.push; | ||
|
|
||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import jakarta.validation.constraints.NotBlank; | ||
| import jakarta.validation.constraints.Size; | ||
|
|
||
| import java.util.List; | ||
| import java.util.Map; | ||
|
|
||
| public record PushTemplateAddRequest( | ||
| @Schema(description = "메시지 템플릿 이름 (이벤트 클래스 명)", example = "SurveyCompletedEvent") | ||
| @NotBlank | ||
| String name, | ||
|
|
||
| @Schema(description = "발송할 메시지 템플릿 코드", example = "test_01") | ||
| @NotBlank | ||
| String code, | ||
|
|
||
| @Schema( | ||
| description = "템플릿에서 사용할 기본 context 값. key는 템플릿에서 사용할 변수명, value는 해당 변수에 들어갈 기본값(index 0)과 설명(index 1)을 담은 리스트", | ||
| example = "{" + | ||
| "\"surveyTitle\": [\"기본 설문 제목\", \"설문 제목에 들어갈 기본 변수값\"], " + | ||
| "\"surveyDeadline\": [\"2024-12-31\", null]" + | ||
| "}" | ||
| ) | ||
|
|
||
| Map<@NotBlank String, @Size(min = 1) List<String>> defaultContext | ||
| ) { | ||
wonjuneee marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.