Преглед на файлове

비대면 진료 요청일시와 아닐때 구분하여 푸시 페이로드 변경

jksong преди 3 години
родител
ревизия
3466dab49c

+ 16 - 16
src/main/java/com/lemon/lifecenter/scheduler/common/HomeController.java

@@ -104,23 +104,23 @@ public class HomeController {
         pushController.everyDayPushSend();
     }
     
-    // @Scheduled(cron = "31 * * * * *", zone = "Asia/Seoul")
-    // public void sendTask2() {
-    //     pushController.selectSendPushList();
-    //     pushController.everyDayPushSend();
-    // }
+     @Scheduled(cron = "31 * * * * *", zone = "Asia/Seoul")
+     public void sendTask2() {
+         pushController.selectSendPushList();
+         pushController.everyDayPushSend();
+     }
     
 //    
-//    @Scheduled(cron = "16 * * * * *", zone = "Asia/Seoul")
-//    public void sendTask3() {
-//        pushController.selectSendPushList();
-//        pushController.everyDayPushSend();
-//    }
-//    
-//    @Scheduled(cron = "46 * * * * *", zone = "Asia/Seoul")
-//    public void sendTask4() {
-//        pushController.selectSendPushList();
-//        pushController.everyDayPushSend();
-//    }
+    @Scheduled(cron = "16 * * * * *", zone = "Asia/Seoul")
+    public void sendTask3() {
+        pushController.selectSendPushList();
+        pushController.everyDayPushSend();
+    }
+    
+    @Scheduled(cron = "46 * * * * *", zone = "Asia/Seoul")
+    public void sendTask4() {
+        pushController.selectSendPushList();
+        pushController.everyDayPushSend();
+    }
     
 }

+ 30 - 4
src/main/java/com/lemon/lifecenter/scheduler/common/PushUtils.java

@@ -51,12 +51,38 @@ public class PushUtils {
             
             String registrationToken = deviceKey;
             
-            AndroidNotification notification = AndroidNotification.builder().setTitle(title).setBody(content).setSound("ctc_alarm.wav").setChannelId("ctc_alarm").setClickAction(".LoadingActivity").setPriority(Priority.MAX).build();
-            AndroidConfig androidConfig = AndroidConfig.builder().setPriority(AndroidConfig.Priority.HIGH).setNotification(notification).setTtl(7200).build();
+            AndroidNotification notification = null;
             
             ApsAlert apsAlert = ApsAlert.builder().setTitle(title).setBody(content).build();
-//            Aps aps = Aps.builder().setSound("default").setAlert(apsAlert).build();
-            Aps aps = Aps.builder().setSound("ctc_alarm.wav").setAlert(apsAlert).build();
+            Aps aps = null;
+            
+            logger.error("redirectUrl -- > " + redirectUrl);
+            if (redirectUrl.equals("nonface")) {
+                notification = AndroidNotification.builder()
+                        .setTitle(title)
+                        .setBody(content)
+                        .setSound("ctc_alarm.wav")
+                        .setChannelId("ctc_alarm")
+                        .setClickAction(".LoadingActivity")
+                        .setPriority(Priority.MAX).build();
+                
+                aps = Aps.builder().setSound("ctc_alarm.wav").setAlert(apsAlert).build();
+            } else {
+                notification = AndroidNotification.builder()
+                        .setTitle(title)
+                        .setBody(content)
+                        .setClickAction(".LoadingActivity")
+                        .setPriority(Priority.MAX).build();
+                
+                aps = Aps.builder().setSound("default").setAlert(apsAlert).build();
+            }
+            
+
+            AndroidConfig androidConfig = AndroidConfig.builder()
+                    .setPriority(AndroidConfig.Priority.HIGH)
+                    .setNotification(notification)
+                    .setTtl(7200).build();
+            
             ApnsConfig apnsConfig = ApnsConfig.builder().setAps(aps).build();
             
             Message message = Message.builder()