Skip to content

Commit

Permalink
fix: FCM refresh 메서드 삭제 (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbscks97 authored Aug 13, 2024
1 parent 724c03e commit bce07ec
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,4 @@ public ResponseEntity<Void> deleteToken(
fcmTokenService.invalidateToken(fcmTokenRequest.token());
return ResponseEntity.ok().build();
}

@Operation(summary = "앱 실행 시 FCM 토큰 타임스탬프 갱신", description = "앱 실행 시 FCM 토큰의 타임스탬프를 갱신합니다.")
@PostMapping("/token/refresh")
public ResponseEntity<Void> refreshTokenTimestamp() {
fcmTokenService.refreshTokenTimestampForCurrentUser();
return ResponseEntity.ok().build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,4 @@ public void storeOrUpdateToken(String token) {
fcmRepository.save(fcmToken);
});
}

@Transactional
public void refreshTokenTimestampForCurrentUser() {
final Member member = memberUtil.getCurrentMember();
fcmRepository
.findByMember(member)
.ifPresentOrElse(
fcmToken -> updateToken(fcmToken, fcmToken.getToken()),
() -> {
throw new CustomException(ErrorCode.FAILED_TO_FIND_FCM_TOKEN);
});
}
}

0 comments on commit bce07ec

Please sign in to comment.