-
Notifications
You must be signed in to change notification settings - Fork 0
refactor/#77-common: 알림 Clients 모듈 서비스 재사용성 리팩토링 #80
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
sung-silver
wants to merge
12
commits into
develop
Choose a base branch
from
refactor/#77
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 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
3ae5b70
feat: 서비스 타입 enum 추가
sung-silver 8a1e61e
refactor: 알림 HTTP 호출에 서비스 타입 적용
sung-silver 7e68a8f
refactor: 알림 service 설정 제거
sung-silver 0afbffe
refactor: push 발송 관련 로직을 모듈화
sung-silver 2e4891c
refactor: TimeExpressionConstant 적용 안된 부분 적용
sung-silver 479e6f3
del: 불필요한 파일 삭제
sung-silver 8bb185c
merge: develop -> refactor/#77
sung-silver 4a09158
refactor: time expresssion 적용
sung-silver 62671ed
chore: created_at, updated_at generation 테이블에 추가
sung-silver 23178f8
chore: base entity 누락 수정
sung-silver 3f20e63
refactor: alarm -> push 로 단어 통일
sung-silver f5d5fb8
test: 환경변수 불일치 수정
sung-silver 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 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
53 changes: 0 additions & 53 deletions
53
clients/src/main/java/org/sopt/makers/clients/alarm/AlarmInstantSenderAdapter.java
This file was deleted.
Oops, something went wrong.
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
Empty file.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,17 @@ | ||
| package org.sopt.makers.clients.eventbridge; | ||
|
|
||
| import static org.sopt.makers.core.constant.TimeExpressionConstant.DATE; | ||
| import static org.sopt.makers.core.constant.TimeExpressionConstant.FILE_SAFE_TIME; | ||
|
|
||
| import java.time.ZoneId; | ||
| import java.time.format.DateTimeFormatter; | ||
| import java.util.UUID; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.sopt.makers.clients.alarm.AlarmProperty; | ||
| import org.sopt.makers.clients.eventbridge.dto.AlarmScheduleEventBridgeBody; | ||
| import org.sopt.makers.clients.eventbridge.dto.AlarmScheduleEventBridgeHeader; | ||
| import org.sopt.makers.clients.eventbridge.dto.AlarmScheduleEventBridgeRequest; | ||
| import org.sopt.makers.clients.push.PushProperty; | ||
| import org.sopt.makers.core.type.ServiceType; | ||
| import org.sopt.makers.domain.admin.alarm.Alarm; | ||
| import org.sopt.makers.domain.admin.alarm.AlarmLinkType; | ||
| import org.sopt.makers.domain.admin.alarm.exception.AlarmException; | ||
|
|
@@ -26,12 +30,9 @@ | |
| @RequiredArgsConstructor | ||
| public class AlarmScheduleSenderAdapter implements AlarmScheduleSenderPort { | ||
|
|
||
| private static final String DATE_FORMAT = "yyyy-MM-dd"; | ||
| private static final String SCHEDULE_TIME_FORMAT = "HH-mm"; | ||
|
|
||
| private final SchedulerClient schedulerClient; | ||
| private final ObjectMapper objectMapper; | ||
| private final AlarmProperty alarmProperty; | ||
| private final PushProperty pushProperty; | ||
| private final EventBridgeProperty eventBridgeProperty; | ||
|
|
||
| @Override | ||
|
|
@@ -56,10 +57,9 @@ public void send(Alarm alarm) { | |
| } | ||
|
|
||
| private String buildEventName(Alarm alarm) { | ||
| String dateData = | ||
| alarm.intendedAt().toLocalDate().format(DateTimeFormatter.ofPattern(DATE_FORMAT)); | ||
| String dateData = alarm.intendedAt().toLocalDate().format(DateTimeFormatter.ofPattern(DATE)); | ||
| String timeData = | ||
| alarm.intendedAt().toLocalTime().format(DateTimeFormatter.ofPattern(SCHEDULE_TIME_FORMAT)); | ||
| alarm.intendedAt().toLocalTime().format(DateTimeFormatter.ofPattern(FILE_SAFE_TIME)); | ||
| return String.format("%s_%s_%d", dateData, timeData, alarm.id()); | ||
| } | ||
|
|
||
|
|
@@ -76,9 +76,9 @@ private String buildEventJson(Alarm alarm) throws JacksonException { | |
| AlarmScheduleEventBridgeHeader.builder() | ||
| .alarmId(alarm.id()) | ||
| .action(alarm.target().sendAction().getValue()) | ||
| .xApiKey(alarmProperty.key()) | ||
| .xApiKey(pushProperty.key()) | ||
| .transactionId(UUID.randomUUID().toString()) | ||
| .service(alarmProperty.headerService()) | ||
| .service(ServiceType.ADMIN.getValue()) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 오호 그러면 official 헤더의 값은 ADMIN으로 바뀌게 되는 걸까요? |
||
| .build(); | ||
|
|
||
| boolean isAppLink = AlarmLinkType.APP.equals(alarm.content().linkType()); | ||
|
|
@@ -100,7 +100,7 @@ private String buildEventJson(Alarm alarm) throws JacksonException { | |
| private Target buildTarget(String eventJson) { | ||
| return Target.builder() | ||
| .roleArn(eventBridgeProperty.roleArn()) | ||
| .arn(alarmProperty.arn()) | ||
| .arn(pushProperty.arn()) | ||
| .input(eventJson) | ||
| .build(); | ||
| } | ||
|
|
||
41 changes: 0 additions & 41 deletions
41
...ain/java/org/sopt/makers/clients/notification/MeetingDemandNotificationSenderAdapter.java
This file was deleted.
Oops, something went wrong.
49 changes: 0 additions & 49 deletions
49
.../src/main/java/org/sopt/makers/clients/notification/MeetingNotificationSenderAdapter.java
This file was deleted.
Oops, something went wrong.
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.
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.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
🔎 Supported by static analysis
🏁 Script executed:
Repository: sopt-makers/sopt-makers-backend
Length of output: 1168
🏁 Script executed:
Repository: sopt-makers/sopt-makers-backend
Length of output: 50388
🏁 Script executed:
Repository: sopt-makers/sopt-makers-backend
Length of output: 2604
🏁 Script executed:
Repository: sopt-makers/sopt-makers-backend
Length of output: 21445
🏁 Script executed:
Repository: sopt-makers/sopt-makers-backend
Length of output: 189
🌐 Web query:
Flyway official documentation versioned migrations applied migrations are not rerun checksum changed migration💡 Result:
In Flyway, versioned migrations are immutable, meaning they are applied to a database exactly once [1]. Flyway tracks the state of these migrations in a table called
flyway_schema_history[2]. This table stores metadata about each migration, including its version, description, and a checksum [1][2]. When Flyway runs, it validates that the checksum of your local migration file matches the checksum previously recorded in theflyway_schema_historytable for that specific version [2][3]. If the checksums do not match, Flyway will raise a "Migration checksum mismatch" validation error and prevent further migrations from running [3][4]. Crucially, Flyway does not automatically re-run a migration if its checksum has changed [3]. Because versioned migrations are intended to be immutable, changing the contents of an already-applied migration file is considered a violation of the migration history [1][4]. If you encounter this error, you have a few options: 1. Revert the changes: If the change was accidental or unintended, the simplest solution is to revert the migration file to its original state so that it matches the checksum recorded in the database [5][4]. 2. Use the repair command: If you intentionally modified the file (e.g., to fix a typo in a comment, change formatting, or update the script content) and are certain the database state is consistent with the new file, you can run theflyway repaircommand [6][7]. This command updates the entries in theflyway_schema_historytable to align with the current checksums of your local migration files [6][8]. It does not re-apply the actual SQL changes; it only updates the metadata [6][9]. 3. Follow the standard "roll forward" pattern: Best practice for any necessary schema change is to create a new versioned migration file rather than modifying an existing one [1]. This maintains the integrity of the migration history [1][7]. Note that repeatable migrations behave differently; they are designed to be re-run whenever their checksum changes, making them suitable for objects that are managed as "create or replace" scripts [10].Citations:
V1 마이그레이션을 수정하지 말고 새 버전으로 변경하세요.
이미 V1이 적용된 환경에서는 checksum 불일치로 Flyway가 마이그레이션을 중단합니다. 기존
generation테이블에도 두 컬럼이 추가되지 않습니다. 새 버전에서 컬럼을 추가하고, 기존 행을 backfill한 뒤NOT NULL제약을 적용하세요.🤖 Prompt for AI Agents