44import java .util .Map ;
55import lombok .RequiredArgsConstructor ;
66import lombok .extern .slf4j .Slf4j ;
7+
8+ import org .springframework .beans .factory .annotation .Value ;
79import org .springframework .http .HttpEntity ;
810import org .springframework .http .HttpHeaders ;
911import org .springframework .http .MediaType ;
@@ -18,14 +20,15 @@ public class FcmPushScheduler {
1820
1921 private final RestTemplate restTemplate ;
2022
21- private static final String BASE_URL = "http://13.209.210.3/api/v1" ;
23+ @ Value ("${ops.server.url}/api/v1" )
24+ private String base_url ;
2225
2326 private void callPost (String path ) {
2427 HttpHeaders headers = new HttpHeaders ();
2528 headers .setContentType (MediaType .APPLICATION_JSON );
2629 HttpEntity <Void > entity = new HttpEntity <>(headers );
2730
28- String url = BASE_URL + path ;
31+ String url = base_url + path ;
2932 try {
3033 restTemplate .postForEntity (url , entity , String .class );
3134 log .info ("POST 요청 성공: {}" , url );
@@ -42,7 +45,7 @@ private void callPost(String path, String template) {
4245 bM .put ("template" , template );
4346
4447 HttpEntity <Map <String , String >> entity = new HttpEntity <>(bM , headers );
45- String url = BASE_URL + path ;
48+ String url = base_url + path ;
4649
4750 try {
4851 restTemplate .postForEntity (url , entity , String .class );
@@ -53,7 +56,7 @@ private void callPost(String path, String template) {
5356 }
5457
5558 private void callGet (String path ) {
56- String url = BASE_URL + path ;
59+ String url = base_url + path ;
5760 try {
5861 restTemplate .getForEntity (url , String .class );
5962 log .info ("GET 요청 성공: {}" , url );
0 commit comments