소스 검색

테스트 발송 기능 추가

junekeunsong 4 년 전
부모
커밋
376dbcf951
1개의 변경된 파일19개의 추가작업 그리고 0개의 파일을 삭제
  1. 19 0
      src/main/java/com/lemon/lifecenter/scheduler/common/HomeController.java

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

@@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import com.lemon.lifecenter.scheduler.controller.PushController;
@@ -46,6 +47,24 @@ public class HomeController {
         return "helloWorld";
     }
     
+    @RequestMapping(value = "/sendTest", method = RequestMethod.POST)
+    public String sendTest(
+            @RequestParam(value="redirectUrl", required=false, defaultValue="") String redirectUrl,
+            @RequestParam(value="token", required=false, defaultValue="") String token,
+            @RequestParam(value="title", required=false, defaultValue="") String title,
+            @RequestParam(value="content", required=false, defaultValue="") String content) {
+        
+        HashMap<String, String> response = new HashMap<>();
+        
+        response = pushUtils.sendFcm(token,
+                title, content, redirectUrl);
+        
+        logger.error("response -- > " + response);
+
+        return "result : " + response;
+//        return "helloWorld";
+    }
+    
     /**
      * 하루에 한번 결과 테이블이 있는지 확인 후 없으면 생성한다
      * *(초) *(분) *(시) *(일) *(월) *(요일)