|
|
@ -7,6 +7,7 @@ import com.icomsys.vo.*;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.codehaus.jackson.map.ObjectMapper;
|
|
|
|
import org.codehaus.jackson.map.ObjectMapper;
|
|
|
|
import org.codehaus.jackson.type.TypeReference;
|
|
|
|
import org.codehaus.jackson.type.TypeReference;
|
|
|
|
|
|
|
|
import org.mybatis.spring.annotation.MapperScan;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.core.ParameterizedTypeReference;
|
|
|
|
import org.springframework.core.ParameterizedTypeReference;
|
|
|
@ -24,6 +25,7 @@ import java.util.Objects;
|
|
|
|
import java.util.UUID;
|
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
@Service
|
|
|
|
|
|
|
|
@MapperScan(basePackages = "com.icomsys.mapper")
|
|
|
|
public class MessagingConnector {
|
|
|
|
public class MessagingConnector {
|
|
|
|
|
|
|
|
|
|
|
|
private final RestTemplate restTemplate;
|
|
|
|
private final RestTemplate restTemplate;
|
|
|
@ -151,10 +153,6 @@ public class MessagingConnector {
|
|
|
|
|
|
|
|
|
|
|
|
body.setAll(map);
|
|
|
|
body.setAll(map);
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println("Request URL: " + url);
|
|
|
|
|
|
|
|
System.out.println("Request Headers: " + headers);
|
|
|
|
|
|
|
|
System.out.println("Request Body: " + body);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 연동 API (메세지 전송)
|
|
|
|
// 연동 API (메세지 전송)
|
|
|
|
try{
|
|
|
|
try{
|
|
|
|
HttpEntity request = new HttpEntity<>(body, headers);
|
|
|
|
HttpEntity request = new HttpEntity<>(body, headers);
|
|
|
@ -165,7 +163,6 @@ public class MessagingConnector {
|
|
|
|
return super.getType();
|
|
|
|
return super.getType();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
System.out.println("response.getBody() : " + response.getBody());
|
|
|
|
|
|
|
|
if (response != null) {
|
|
|
|
if (response != null) {
|
|
|
|
System.out.println("Status Code: " + response.getStatusCode());
|
|
|
|
System.out.println("Status Code: " + response.getStatusCode());
|
|
|
|
if (response.hasBody()) {
|
|
|
|
if (response.hasBody()) {
|
|
|
@ -177,7 +174,7 @@ public class MessagingConnector {
|
|
|
|
System.out.println("Response is null");
|
|
|
|
System.out.println("Response is null");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sejongMessageSendResponse = response.getBody();
|
|
|
|
sejongMessageSendResponse = response.getBody();
|
|
|
|
|
|
|
|
System.out.println("sejongMessageSendResponse : " + response);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception e) {
|
|
|
|
catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
@ -186,13 +183,9 @@ public class MessagingConnector {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Response 변환
|
|
|
|
// Response 변환
|
|
|
|
messageSendResponse = this.responseChange(sejongMessageSendResponse, messageSendRequest);
|
|
|
|
messageSendResponse = this.responseChange(sejongMessageSendResponse, messageSendRequest);
|
|
|
|
System.out.println("sejongMessageSendResponse : " + sejongMessageSendResponse);
|
|
|
|
|
|
|
|
System.out.println("messageSendRequest : " + messageSendRequest);
|
|
|
|
|
|
|
|
System.out.println("messageSendResponse : " + messageSendResponse);
|
|
|
|
|
|
|
|
// 메시지 전송 Log Insert
|
|
|
|
// 메시지 전송 Log Insert
|
|
|
|
messageSendServiceDsl.insertSendLog(sejongMessageSendResponse, messageSendRequest, messageSendResponse);
|
|
|
|
messageSendServiceDsl.insertSendLog(sejongMessageSendResponse, messageSendRequest, messageSendResponse);
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println("insertSendLog123123123");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// log.info(String.valueOf(seq));
|
|
|
|
// log.info(String.valueOf(seq));
|
|
|
|
// 알림톡 발송 실패 시 SMS, LMS로 전송
|
|
|
|
// 알림톡 발송 실패 시 SMS, LMS로 전송
|
|
|
|