Skip to content

Commit

Permalink
πŸ› Fix: μˆ˜λ½ν•œ μ΄ˆλŒ€μž₯도 좜λ ₯ν•˜λ„λ‘ μˆ˜μ • + 토큰 μ‹œκ°„ λ³€κ²½
Browse files Browse the repository at this point in the history
  • Loading branch information
koojun99 committed Oct 10, 2024
1 parent e75d0b5 commit a90e197
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class InvitationService {
@Transactional
public InvitationResponseDTO.getInvitations getInvitations(User user) {

List<Invitation> invitations = invitationQueryAdapter.findAllPendingByPhone(user.getPhone());
List<Invitation> invitations = invitationQueryAdapter.findAllByPhone(user.getPhone());

List<InvitationResponseDTO.getInvitation> invitationDtos = invitations.stream()
.map(invitation -> {
Expand Down Expand Up @@ -117,7 +117,16 @@ public InvitationResponseDTO.invitationAccept decisionInvitation(User user, Invi
treehouseId = invitation.getTreeHouse().getId(); // treehouse κ΄€λ ¨ 둜직 개발 ν›„, invitation.getTreeHouse.getId() λ“±μœΌλ‘œ λ°”κΎΈκΈ°
// μ΄ˆλŒ€μž₯ 수락
invitationCommandAdapter.acceptInvitation(invitation);
} else if (request.isAcceptDecision()==false) {
// μ΄ˆλŒ€μž₯ 거절
invitationCommandAdapter.deleteInvitation(invitation);
}
return InvitationMapper.toInvitationResult(treehouseId);
}

@Transactional
public void deleteInvitation(Long invitationId) {
Invitation invitation = invitationQueryAdapter.findById(invitationId);
invitationCommandAdapter.deleteInvitation(invitation);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ public void acceptInvitation(Invitation invitation) {
invitation.setStatus(InvitationStatus.ACCEPTED);
invitationRepository.save(invitation);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,13 @@ public CommonResponse<InvitationResponseDTO.createInvitation> createInvitation(
){
return CommonResponse.onSuccess(invitationService.createInvitation(user,request));
}

@DeleteMapping("/invitation/{invitationId}")
@Operation(summary = "μ΄ˆλŒ€μž₯ μ‚­μ œ API βœ… πŸ”‘", description = "μ΄ˆλŒ€μž₯을 μ‚­μ œν•˜λŠ” API μž…λ‹ˆλ‹€.")
public CommonResponse deleteInvitation(
@PathVariable Long invitationId
){
invitationService.deleteInvitation(invitationId);
return CommonResponse.onSuccess(null);
}
}
4 changes: 2 additions & 2 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ jwt:
key: ${JWT_SECRET}
# secret : ${JWT_SECRET}
authorities-key: authoritiesKey
access-token-validity-in-seconds: 7200000 # 2 hour
refresh-token-validity-in-seconds: 2592000000 # 30 day
access-token-validity-in-seconds: 120000 # 2 min
refresh-token-validity-in-seconds: 300000 # 30 day

firebase:
admin-sdk: ${FCM_KEY}
Expand Down

0 comments on commit a90e197

Please sign in to comment.