Skip to content

Commit

Permalink
feat: 푸시 알림 title 수정 (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
julia-heo committed May 23, 2024
1 parent 1019abf commit f03216f
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,14 @@ public void cheeringBenefitGoalAnnounce() throws CustomException {
List<FCMToken> fcmTokens = fcmTokenRepository.findAllByUsers(users);
for ( FCMToken fcmToken : fcmTokens){
String token = fcmToken.getToken();
firebaseCloudMessageService.sendNotification(new AnnouncementRequestDto(token,"ONCE",content));
firebaseCloudMessageService.sendNotification(new AnnouncementRequestDto(token,"목표 응원 알림",content));
}
}
}

@Scheduled(cron = "0 0 21 10,15,25 * ?")
public void cardPerformanceAnnounce() throws CustomException {
String currentDate = String.valueOf(LocalDate.now().getMonthValue());;
List<OwnedCard> ownedCardList = ownedCardRepository.findOwnedCardByIsMain(true);
for (OwnedCard card : ownedCardList) {
// 실적 업데이트
Expand All @@ -97,12 +98,12 @@ public void cardPerformanceAnnounce() throws CustomException {

ownedCardRepository.save(card);
String res = String.valueOf(Math.max(card.getPerformanceCondition()-card.getCurrentPerformance(),0));
String content = "이번 달 "+card.getCard().getName()+" 실적까지 "+res+"원 남았어요!";
String content = "이번 달 "+card.getCard().getName()+" 실적까지\n"+res+"원 남았어요!";
String moreInfo = card.getCard().getImgUrl();

Announcement announcement = Announcement.builder()
.users(users)
.type(1)
.type(3)
.content(content)
.moreInfo(moreInfo)
.hasCheck(false)
Expand All @@ -111,7 +112,7 @@ public void cardPerformanceAnnounce() throws CustomException {
List<FCMToken> fcmTokens = fcmTokenRepository.findAllByUsers(users);
for ( FCMToken fcmToken : fcmTokens){
String token = fcmToken.getToken();
firebaseCloudMessageService.sendNotification(new AnnouncementRequestDto(token,"ONCE",content));
firebaseCloudMessageService.sendNotification(new AnnouncementRequestDto(token,currentDate+"월 실적 알림",content));
}

}
Expand Down

0 comments on commit f03216f

Please sign in to comment.