From 8e7c404a37d26eb511fcb9980f0e4fb09c79ec01 Mon Sep 17 00:00:00 2001 From: seokjun jeon Date: Mon, 13 Jan 2025 14:45:58 +0900 Subject: [PATCH] 20250113_8 --- src/main/java/com/icomsys/MessagingConnector.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/icomsys/MessagingConnector.java b/src/main/java/com/icomsys/MessagingConnector.java index 10326af..63abf0d 100644 --- a/src/main/java/com/icomsys/MessagingConnector.java +++ b/src/main/java/com/icomsys/MessagingConnector.java @@ -9,6 +9,7 @@ import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.type.TypeReference; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.ApplicationContext; import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.*; import org.springframework.stereotype.Service; @@ -16,6 +17,7 @@ import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.web.client.RestTemplate; +import javax.annotation.PostConstruct; import java.io.UnsupportedEncodingException; import java.lang.reflect.Type; import java.time.LocalDate; @@ -28,9 +30,6 @@ public class MessagingConnector { public RestTemplate restTemplate; - @Autowired - public MessageSendServiceDsl messageSendServiceDsl; - private String sms; private String lms; @@ -41,6 +40,16 @@ public class MessagingConnector { private String apiKey; + @Autowired + private ApplicationContext applicationContext; + + private MessageSendServiceDsl messageSendServiceDsl; + + @PostConstruct + public void init() { + this.messageSendServiceDsl = applicationContext.getBean(MessageSendServiceDsl.class); + } + public MessagingConnector(String sms, String lms,String mms,String kakao,String apiKey){ this.sms = sms; this.lms = lms;