-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: auth 필터 로직 리팩터링 * chore: 패키지 이름 변경 * feat: 애플 로그인 토큰 3분 내 검증으로 변경 * feat: 에러 코드 추가 * feat: 트랜잭션 추가 * feat: 미션 삭제 API 구현 * chore: 컴파일 에러 수정 * test: 테스트 코드 추가 * chore: 패키지 위치 이동 * refactor: 서비스 의존 단방향으로 수정 * chore: 불필요한 코드 제거 * feat: 이벤트 처리 로직 고도화 * test: 테스트 코드 추가 * chore: 코드 보완 * fix: 충돌 해결
- Loading branch information
Showing
49 changed files
with
344 additions
and
136 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
2 changes: 1 addition & 1 deletion
2
src/main/java/com/nexters/goalpanzi/application/auth/apple/AppleClaimsValidator.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
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
2 changes: 1 addition & 1 deletion
2
...on/mission/handler/DeleteMemberEvent.java → ...ation/member/event/DeleteMemberEvent.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
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
6 changes: 6 additions & 0 deletions
6
src/main/java/com/nexters/goalpanzi/application/mission/event/DeleteMissionEvent.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,6 @@ | ||
package com.nexters.goalpanzi.application.mission.event; | ||
|
||
public record DeleteMissionEvent( | ||
Long missionId | ||
) { | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/nexters/goalpanzi/application/mission/event/JoinMissionEvent.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,7 @@ | ||
package com.nexters.goalpanzi.application.mission.event; | ||
|
||
public record JoinMissionEvent( | ||
Long memberId, | ||
String invitationCode | ||
) { | ||
} |
48 changes: 48 additions & 0 deletions
48
...va/com/nexters/goalpanzi/application/mission/event/handler/MissionMemberEventHandler.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,48 @@ | ||
package com.nexters.goalpanzi.application.mission.event.handler; | ||
|
||
import com.nexters.goalpanzi.application.member.event.DeleteMemberEvent; | ||
import com.nexters.goalpanzi.application.mission.MissionMemberService; | ||
import com.nexters.goalpanzi.application.mission.MissionVerificationService; | ||
import com.nexters.goalpanzi.application.mission.event.DeleteMissionEvent; | ||
import com.nexters.goalpanzi.application.mission.event.JoinMissionEvent; | ||
import com.nexters.goalpanzi.domain.mission.InvitationCode; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.scheduling.annotation.Async; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.transaction.annotation.Propagation; | ||
import org.springframework.transaction.annotation.Transactional; | ||
import org.springframework.transaction.event.TransactionPhase; | ||
import org.springframework.transaction.event.TransactionalEventListener; | ||
|
||
@Slf4j | ||
@Component | ||
@RequiredArgsConstructor | ||
public class MissionMemberEventHandler { | ||
private final MissionMemberService missionMemberService; | ||
private final MissionVerificationService missionVerificationService; | ||
|
||
@TransactionalEventListener(phase = TransactionPhase.BEFORE_COMMIT) | ||
void handleJoinMissionEvent(final JoinMissionEvent event) { | ||
missionMemberService.joinMission(event.memberId(), new InvitationCode(event.invitationCode())); | ||
log.info("Handled JoinMissionEvent for memberId: {}", event.memberId()); | ||
} | ||
|
||
@Async | ||
@Transactional(propagation = Propagation.REQUIRES_NEW) | ||
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) | ||
void handleDeleteMemberEvent(final DeleteMemberEvent event) { | ||
missionMemberService.deleteAllByMemberId(event.memberId()); | ||
missionVerificationService.deleteAllByMemberId(event.memberId()); | ||
log.info("Handled DeleteMemberEvent for memberId: {}", event.memberId()); | ||
} | ||
|
||
@Async | ||
@Transactional(propagation = Propagation.REQUIRES_NEW) | ||
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) | ||
void handleDeleteMissionEvent(final DeleteMissionEvent event) { | ||
missionMemberService.deleteAllByMissionId(event.missionId()); | ||
missionVerificationService.deleteAllByMissionId(event.missionId()); | ||
log.info("Handled DeleteMissionEvent for missionId: {}", event.missionId()); | ||
} | ||
} |
25 changes: 0 additions & 25 deletions
25
...ain/java/com/nexters/goalpanzi/application/mission/handler/MissionMemberEventHandler.java
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
src/main/java/com/nexters/goalpanzi/common/argumentresolver/UserIdResolver.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
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
2 changes: 1 addition & 1 deletion
2
...com/nexters/goalpanzi/common/jwt/Jwt.java → ...exters/goalpanzi/common/auth/jwt/Jwt.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
2 changes: 1 addition & 1 deletion
2
...xters/goalpanzi/common/jwt/JwtParser.java → .../goalpanzi/common/auth/jwt/JwtParser.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
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
Oops, something went wrong.