Skip to content

Commit

Permalink
Merge pull request #65 from Do-Farming/feat/minjoo/dailyMissionSchedu…
Browse files Browse the repository at this point in the history
…lar/#39

fix:ãSendNotification 수정 >> 날짜형 봐야함
  • Loading branch information
Minjoo-kang123 authored Jul 5, 2024
2 parents 78ff30e + c455533 commit 4224930
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ public class PushNotificationService {
public void sendNotificationToDevice(String token, String title, String message) {
sendPushNotification(token, title, message);
}
//해당 service 이용해서 영어만!!! 넣어서 보내면 제대로 push 감 token은 user에서 deviedId 테이블 사용
//title은 큰 글씨 message는 작은 글씨

private void sendPushNotification(String token, String title, String message) {
RestTemplate restTemplate = new RestTemplate();
String payload = String.format("{\"to\":\"%s\",\"sound\":\"default\",\"title\":\"%s\",\"body\":\"%s\"}", token, title, message);
String payload = String.format("{\"to\":\"%s\",\"sound\":\"default\",\"title\":\"%s\",\"body\":\"%s\"}", "ExponentPushToken[-FSFxvP0NsUarmmpNqcOlm]", "Dofarming", "message");
restTemplate.postForEntity(EXPO_PUSH_URL, payload, String.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public class InsertDailyChallengeTasklet implements Tasklet {
private final PushNotificationService pushNotificationService;
@Override
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
pushNotificationService.sendNotificationToDevice("d","d","d");
challengeRecordService.insertDailyChallengeRecord();
//pushNotificationService.sendNotificationToDevice("d","d","d");
return RepeatStatus.FINISHED;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public void runUpdateCardListDataJob() {
}

@Scheduled(cron = "0 0 12 * * ?") // 매일 정오에 실행
//@Scheduled(fixedRate = 30000)
public void insertDailyChallenge() {
try {
Job job = jobRegistry.getJob("insertDailyChallengeJob");
Expand Down

0 comments on commit 4224930

Please sign in to comment.