main
seokjun jeon 2 weeks ago
parent 518e390267
commit 9a6d4f1d08

@ -15,7 +15,7 @@
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="message-module" options="" />
<module name="message-module" options="-parameters" />
</option>
</component>
</project>

@ -3,7 +3,12 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.2.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.icomsys.message</groupId>
<artifactId>message-module</artifactId>
<version>0.0.1-SNAPSHOT</version>
@ -61,10 +66,37 @@
<artifactId>common-utils</artifactId>
<version>0.0.8-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.13</version>
</dependency>
</dependencies>
</project>

@ -1,203 +1,241 @@
package com.icomsys;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.icomsys.dsl.MessageSendServiceDsl;
import com.icomsys.util.CommonBeanUtils;
import com.icomsys.vo.*;
import org.mybatis.spring.annotation.MapperScan;
import lombok.extern.slf4j.Slf4j;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.type.TypeReference;
import org.springframework.beans.factory.annotation.Autowired;
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Type;
import java.time.LocalDate;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;
@MapperScan(basePackages = "com.icomsys.mapper")
@Service
@Slf4j
public class MessagingConnector {
private final String sms;
private final String lms;
private final String mms;
private final String kakao;
private final String apiKey;
private final MessageSendServiceDsl messageSendServiceDsl;
private final HttpClient httpClient;
public MessagingConnector(String sms, String lms, String mms, String kakao, String apiKey, MessageSendServiceDsl messageSendServiceDsl) {
this.sms = sms;
this.lms = lms;
this.mms = mms;
this.kakao = kakao;
this.apiKey = apiKey;
this.httpClient = HttpClient.newHttpClient();
this.messageSendServiceDsl = messageSendServiceDsl;
}
public MessageSendResponse messageDiv(MessageSendRequest messageSendRequest) throws IOException, InterruptedException {
@Autowired
private RestTemplate restTemplate;
@Autowired
private MessageSendServiceDsl messageSendServiceDsl;
@Value("${message.url.sms}")
private String sms;
@Value("${message.url.lms}")
private String lms;
@Value("${message.url.mms}")
private String mms;
@Value("${message.url.kakao}")
private String kakao;
@Value("${message.key.sejong}")
private String apiKey;
/**
* @Name messageDiv
* @Description API
* @Author EunGu. Lee
* @CreateDate 2024. 07. 22
*
* @param messageSendRequest
* @return messageSendResponse
*
* @ChangeDescription
*/
public MessageSendResponse messageDiv(MessageSendRequest messageSendRequest) throws UnsupportedEncodingException {
String url = sms;
String key = UUID.randomUUID().toString().substring(0, 6);
LocalDate now = LocalDate.now();
messageSendRequest.setUserKey(now.toString().substring(2).replace("-", "")+key);
if (messageSendRequest.getSendType() == null || messageSendRequest.getSendType().isEmpty()) {
if (messageSendRequest.getContents().getBytes(StandardCharsets.UTF_8).length < 91) {
// sendType(발송 타입)이 없는 경우 contents(메시지 내용)의 Byte를 체크하여 SMS, LMS로 전송
if (messageSendRequest.getSendType() == null || messageSendRequest.getSendType() == ""){
if (messageSendRequest.getContents().getBytes("euc-kr").length < 91) {
messageSendRequest.setSendType("SMS");
return this.messageSend(messageSendRequest, url);
} else {
}
else {
messageSendRequest.setSendType("LMS");
url = lms;
return this.messageSend(messageSendRequest, url);
}
} else {
switch (messageSendRequest.getSendType()) {
case "SMS":
}
// 발송 타입이 있는 경우
// 발송 타입이 SMS 일 때
else if (messageSendRequest.getSendType().equals("SMS")) {
return this.messageSend(messageSendRequest, url);
case "LMS":
}
// 발송 타입이 LMS 일 때
else if (messageSendRequest.getSendType().equals("LMS")) {
url = lms;
return this.messageSend(messageSendRequest, url);
case "MMS":
}
// 발송 타입이 MMS 일 때
else if (messageSendRequest.getSendType().equals("MMS")) {
url = mms;
return this.messageSend(messageSendRequest, url);
case "KAKAO":
}
// 발송 타입이 KAKAO(알림톡) 일 때
else if (messageSendRequest.getSendType().equals("KAKAO")) {
url = kakao;
return this.messageSend(messageSendRequest, url);
default:
return null;
}
}
return null;
}
public MessageSendResponse messageSend(MessageSendRequest messageSendRequest, String url) throws IOException, InterruptedException {
/**
* @Name messageSend
* @Description API
* @Author EunGu. Lee
* @CreateDate 2024. 07. 22
*
* @param messageSendRequest
* @return messageSendResponse
*
* @ChangeDescription
*/
public MessageSendResponse messageSend(MessageSendRequest messageSendRequest, String url) throws UnsupportedEncodingException {
MessageSendResponse messageSendResponse = new MessageSendResponse();
SejongMessageSendResponse sejongMessageSendResponse = null;
try {
// Header 정보 입력
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
headers.add("sejongApiKey", apiKey);
// Body MULTIPART_FORM_DATA로 변환
MultiValueMap<String, String> body = new LinkedMultiValueMap<>();
ObjectMapper objectMapper = new ObjectMapper();
Map<String, String> body = this.prepareRequestBody(messageSendRequest, objectMapper);
String boundary = "----WebKitFormBoundary" + System.currentTimeMillis();
// Multipart body 생성
HttpRequest.BodyPublisher bodyPublisher = createMultipartBody(body, boundary);
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Content-Type", "multipart/form-data; boundary=" + boundary)
.header("sejongApiKey", this.apiKey)
.POST(bodyPublisher)
.build();
HttpResponse<String> response = this.httpClient.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println("responseCode : " + response.statusCode());
System.out.println("responseBody : " + response.body());
System.out.println("responseFull : " + response);
if (response.statusCode() == 200) {
sejongMessageSendResponse = objectMapper.readValue(response.body(), SejongMessageSendResponse.class);
} else {
messageSendResponse.setCode("500");
messageSendResponse.setMessage("서버 통신 오류");
Map<String, String> map = null;
// SMS
if (messageSendRequest.getSendType().equals("SMS")) {
SejongSmsSendRequest smsSendRequest = CommonBeanUtils.convertType(messageSendRequest, SejongSmsSendRequest.class);
map = objectMapper.convertValue(smsSendRequest, new TypeReference<Map<String, String>>() {});
}
} catch (Exception e) {
e.printStackTrace();
messageSendResponse.setCode("500");
messageSendResponse.setMessage("서버 통신 오류");
// LMS
else if (messageSendRequest.getSendType().equals("LMS")) {
SejongLmsSendRequest lmsSendRequest = CommonBeanUtils.convertType(messageSendRequest, SejongLmsSendRequest.class);
map = objectMapper.convertValue(lmsSendRequest, new TypeReference<Map<String, String>>() {});
}
if (this.messageSendServiceDsl == null) {
System.out.println("messageSendServiceDsl is null");
throw new IllegalStateException("messageSendServiceDsl is not initialized.");
// MMS
else if (messageSendRequest.getSendType().equals("MMS")) {
SejongMmsSendRequest mmsSendRequest = CommonBeanUtils.convertType(messageSendRequest, SejongMmsSendRequest.class);
map = objectMapper.convertValue(mmsSendRequest, new TypeReference<Map<String, String>>() {});
}
if (sejongMessageSendResponse == null) {
System.out.println("sejongMessageSendResponse is null");
// KAKAO(알림톡)
else if (messageSendRequest.getSendType().equals("KAKAO")) {
SejongKakaoSendRequest kakaoSendRequest = CommonBeanUtils.convertType(messageSendRequest, SejongKakaoSendRequest.class);
map = objectMapper.convertValue(kakaoSendRequest, new TypeReference<Map<String, String>>() {});
}
if (messageSendRequest == null) {
System.out.println("messageSendRequest is null");
}
body.setAll(map);
if (messageSendResponse == null) {
System.out.println("messageSendResponse is null");
// 연동 API (메세지 전송)
try{
HttpEntity request = new HttpEntity<>(body, headers);
ResponseEntity<SejongMessageSendResponse> response =
restTemplate.exchange(url, HttpMethod.POST, request, new ParameterizedTypeReference<SejongMessageSendResponse>() {
@Override
public Type getType() {
return super.getType();
}
});
messageSendResponse = this.responseChange(sejongMessageSendResponse, messageSendRequest);
System.out.println("sejongMessageSendResponse : " + sejongMessageSendResponse);
System.out.println("messageSendRequest : " + messageSendRequest);
System.out.println("messageSendResponse : " + messageSendResponse);
this.messageSendServiceDsl.insertSendLog(sejongMessageSendResponse, messageSendRequest, messageSendResponse);
System.out.println("11111111111111111111");
if ("KAKAO".equals(messageSendRequest.getSendType()) && "Y".equals(messageSendRequest.getOptionYn()) &&
!Objects.equals(sejongMessageSendResponse.getCode(), "200")) {
messageSendRequest.setSendType("");
messageSendResponse = this.messageDiv(messageSendRequest);
sejongMessageSendResponse = response.getBody();
}
System.out.println("22222222222222222222");
return messageSendResponse;
catch (Exception e) {
messageSendResponse.setCode("500");
messageSendResponse.setMessage("서버 통신 오류");
}
// Response 변환
messageSendResponse = this.responseChange(sejongMessageSendResponse, messageSendRequest);
private Map<String, String> prepareRequestBody(MessageSendRequest messageSendRequest, ObjectMapper objectMapper) {
switch (messageSendRequest.getSendType()) {
case "SMS":
return objectMapper.convertValue(CommonBeanUtils.convertType(messageSendRequest, SejongSmsSendRequest.class), new TypeReference<>() {});
case "LMS":
return objectMapper.convertValue(CommonBeanUtils.convertType(messageSendRequest, SejongLmsSendRequest.class), new TypeReference<>() {});
case "MMS":
return objectMapper.convertValue(CommonBeanUtils.convertType(messageSendRequest, SejongMmsSendRequest.class), new TypeReference<>() {});
case "KAKAO":
return objectMapper.convertValue(CommonBeanUtils.convertType(messageSendRequest, SejongKakaoSendRequest.class), new TypeReference<>() {});
default:
throw new IllegalArgumentException("Unsupported send type");
}
}
// 메시지 전송 Log Insert
messageSendServiceDsl.insertSendLog(sejongMessageSendResponse, messageSendRequest, messageSendResponse);
private HttpRequest.BodyPublisher createMultipartBody(Map<String, String> body, String boundary) {
StringBuilder multipartBody = new StringBuilder();
// log.info(String.valueOf(seq));
// 알림톡 발송 실패 시 SMS, LMS로 전송
if (messageSendRequest.getSendType().equals("KAKAO") && messageSendRequest.getOptionYn().equals("Y")) {
for (Map.Entry<String, String> entry : body.entrySet()) {
multipartBody.append("--").append(boundary).append("\r\n");
multipartBody.append("Content-Disposition: form-data; name=\"").append(entry.getKey()).append("\"\r\n\r\n");
multipartBody.append(entry.getValue()).append("\r\n");
}
if (!Objects.equals(sejongMessageSendResponse.getCode(), "200")) {
messageSendRequest.setSendType("");
messageSendResponse = this.messageDiv(messageSendRequest);
// 마지막 바운더리 추가
multipartBody.append("--").append(boundary).append("--\r\n");
// messageSendServiceDsl.updateSendLog(seq);
}
}
return HttpRequest.BodyPublishers.ofString(multipartBody.toString());
return messageSendResponse;
}
/**
* @Name responseChange
* @Description response
* @Author EunGu. Lee
* @CreateDate 2024. 07. 29
*
* @param response, request
* @return messageSendResponse
*
* @ChangeDescription
*/
public MessageSendResponse responseChange(SejongMessageSendResponse response, MessageSendRequest request) {
MessageSendResponse messageSendResponse = new MessageSendResponse();
messageSendResponse.setSendType(request.getSendType());
messageSendResponse.setSendCode(response != null ? response.getSendCode() : null);
messageSendResponse.setSendCode(response.getSendCode());
if (response == null || response.getCode() == null) {
if (response.getCode().contains("S")) {
if (response.getCode().equals("S405")) {
messageSendResponse.setSendCode("300");
messageSendResponse.setMessage("Parameter 확인");
}
messageSendResponse.setCode("500");
messageSendResponse.setMessage("서버 오류");
return messageSendResponse;
}
int code = Integer.parseInt(response.getCode());
if (code == 200) {
else if (response.getCode().equals("200")) {
messageSendResponse.setCode("200");
messageSendResponse.setMessage("메세지 전송 요청 성공");
} else if (code >= 300 && code < 400) {
}
else if ((Integer.parseInt(response.getCode()) > 200
&& Integer.parseInt(response.getCode()) <= 300)) {
messageSendResponse.setCode("300");
messageSendResponse.setMessage("Parameter 확인");
} else if (code >= 400 && code < 500) {
}
else if (Integer.parseInt(response.getCode()) > 400
&& Integer.parseInt(response.getCode()) <= 500) {
messageSendResponse.setCode("400");
messageSendResponse.setMessage("서버 통신 실패");
} else if (code >= 500) {
messageSendResponse.setMessage("서버 통신에 실패했습니다.");
}
else if (Integer.parseInt(response.getCode()) > 500
&& Integer.parseInt(response.getCode()) <= 600) {
messageSendResponse.setCode("600");
messageSendResponse.setMessage("메세지 전송 오류");
}
else {
messageSendResponse.setCode("500");
messageSendResponse.setMessage("서버 오류");
}
return messageSendResponse;
}
}

@ -5,42 +5,49 @@ import com.icomsys.vo.MessageSendLogInfo;
import com.icomsys.vo.MessageSendRequest;
import com.icomsys.vo.MessageSendResponse;
import com.icomsys.vo.SejongMessageSendResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
@Service
@RequiredArgsConstructor
public class MessageSendServiceDslImpl implements MessageSendServiceDsl {
private final MessageSendLogMapper messageSendLogMapper;
public MessageSendServiceDslImpl(MessageSendLogMapper messageSendLogMapper) {
this.messageSendLogMapper = messageSendLogMapper;
}
@Override
public void insertSendLog(SejongMessageSendResponse response, MessageSendRequest request, MessageSendResponse messageSendResponse) {
String sendYn = messageSendResponse.getCode().equals("200") ? "Y" : "N";
MessageSendLogInfo messageSendLogInfo = new MessageSendLogInfo.Builder()
.setSendYn(sendYn)
.setUserKey(request.getUserKey())
.setCallBack(request.getCallback())
.setReceiverTelNo(request.getReceiverTelNo())
.setSendType(messageSendResponse.getSendType())
.setContents(request.getContents())
.setAdvertisementYn(request.getAdvertisementYn())
.setImageFile1("")
.setImageFile2("")
.setImageFile3("")
.setVideoFile("")
.setSenderKey(request.getSenderKey())
.setTemplateCode(request.getTemplateCode())
.setInitCallNo("")
.setApiResponseCode(response.getCode())
.setResultCode(messageSendResponse.getCode())
.setRegistDate(LocalDateTime.now())
.setOptionYn(request.getOptionYn())
String sendYn;
if (messageSendResponse.getCode().equals("200")) {
sendYn = "Y";
}
else {
sendYn = "N";
}
MessageSendLogInfo messageSendLogInfo = MessageSendLogInfo.builder()
.sendYn(sendYn)
.userKey(request.getUserKey())
.callBack(request.getCallback())
.receiverTelNo(request.getReceiverTelNo())
.sendType(messageSendResponse.getSendType())
.contents(request.getContents())
.advertisementYn(request.getAdvertisementYn())
.imageFile1("")
.imageFile2("")
.imageFile3("")
.videoFile("")
.senderKey(request.getSenderKey())
.templateCode(request.getTemplateCode())
.initCallNo(request.getInitCallNo())
.initCallNo("")
.apiResponseCode(response.getCode())
.resultCode(messageSendResponse.getCode())
.registDate(LocalDateTime.now())
.optionYn(request.getOptionYn())
.build();
messageSendLogMapper.insertSendLog(messageSendLogInfo);
}

@ -3,9 +3,11 @@ package com.icomsys.mapper;
import com.icomsys.vo.MessageSendLogInfo;
import com.icomsys.vo.MessageSendRequest;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
@Mapper
public interface MessageSendLogMapper {

@ -1,7 +1,16 @@
package com.icomsys.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
@Getter
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class MessageSendLogInfo {
private String seqNo;
@ -23,147 +32,4 @@ public class MessageSendLogInfo {
private String resultCode;
private LocalDateTime registDate;
private String optionYn;
private MessageSendLogInfo(Builder builder) {
this.seqNo = builder.seqNo;
this.sendYn = builder.sendYn;
this.userKey = builder.userKey;
this.callBack = builder.callBack;
this.receiverTelNo = builder.receiverTelNo;
this.sendType = builder.sendType;
this.contents = builder.contents;
this.advertisementYn = builder.advertisementYn;
this.imageFile1 = builder.imageFile1;
this.imageFile2 = builder.imageFile2;
this.imageFile3 = builder.imageFile3;
this.videoFile = builder.videoFile;
this.senderKey = builder.senderKey;
this.templateCode = builder.templateCode;
this.initCallNo = builder.initCallNo;
this.apiResponseCode = builder.apiResponseCode;
this.resultCode = builder.resultCode;
this.registDate = builder.registDate;
this.optionYn = builder.optionYn;
}
public static class Builder {
private String seqNo;
private String sendYn;
private String userKey;
private String callBack;
private String receiverTelNo;
private String sendType;
private String contents;
private String advertisementYn;
private String imageFile1;
private String imageFile2;
private String imageFile3;
private String videoFile;
private String senderKey;
private String templateCode;
private String initCallNo;
private String apiResponseCode;
private String resultCode;
private LocalDateTime registDate;
private String optionYn;
public Builder setSeqNo(String seqNo) {
this.seqNo = seqNo;
return this;
}
public Builder setSendYn(String sendYn) {
this.sendYn = sendYn;
return this;
}
public Builder setUserKey(String userKey) {
this.userKey = userKey;
return this;
}
public Builder setCallBack(String callBack) {
this.callBack = callBack;
return this;
}
public Builder setReceiverTelNo(String receiverTelNo) {
this.receiverTelNo = receiverTelNo;
return this;
}
public Builder setSendType(String sendType) {
this.sendType = sendType;
return this;
}
public Builder setContents(String contents) {
this.contents = contents;
return this;
}
public Builder setAdvertisementYn(String advertisementYn) {
this.advertisementYn = advertisementYn;
return this;
}
public Builder setImageFile1(String imageFile1) {
this.imageFile1 = imageFile1;
return this;
}
public Builder setImageFile2(String imageFile2) {
this.imageFile2 = imageFile2;
return this;
}
public Builder setImageFile3(String imageFile3) {
this.imageFile3 = imageFile3;
return this;
}
public Builder setVideoFile(String videoFile) {
this.videoFile = videoFile;
return this;
}
public Builder setSenderKey(String senderKey) {
this.senderKey = senderKey;
return this;
}
public Builder setTemplateCode(String templateCode) {
this.templateCode = templateCode;
return this;
}
public Builder setInitCallNo(String initCallNo) {
this.initCallNo = initCallNo;
return this;
}
public Builder setApiResponseCode(String apiResponseCode) {
this.apiResponseCode = apiResponseCode;
return this;
}
public Builder setResultCode(String resultCode) {
this.resultCode = resultCode;
return this;
}
public Builder setRegistDate(LocalDateTime registDate) {
this.registDate = registDate;
return this;
}
public Builder setOptionYn(String optionYn) {
this.optionYn = optionYn;
return this;
}
public MessageSendLogInfo build() {
return new MessageSendLogInfo(this);
}
}
}

@ -1,5 +1,14 @@
package com.icomsys.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MessageSendRequest {
private String callback;
private String contents;
@ -16,254 +25,4 @@ public class MessageSendRequest {
private String initCallNo;
private String optionYn;
public MessageSendRequest() {}
public MessageSendRequest(
String callback, String contents, String receiverTelNo, String userKey,
String advertisementYn, String sendType, String senderKey, String templateCode,
byte[] imageFile1, byte[] imageFile2, byte[] imageFile3, byte[] videoFile,
String initCallNo, String optionYn
) {
this.callback = callback;
this.contents = contents;
this.receiverTelNo = receiverTelNo;
this.userKey = userKey;
this.advertisementYn = advertisementYn;
this.sendType = sendType;
this.senderKey = senderKey;
this.templateCode = templateCode;
this.imageFile1 = imageFile1;
this.imageFile2 = imageFile2;
this.imageFile3 = imageFile3;
this.videoFile = videoFile;
this.initCallNo = initCallNo;
this.optionYn = optionYn;
}
public String getCallback() {
return callback;
}
public void setCallback(String callback) {
this.callback = callback;
}
public String getContents() {
return contents;
}
public void setContents(String contents) {
this.contents = contents;
}
public String getReceiverTelNo() {
return receiverTelNo;
}
public void setReceiverTelNo(String receiverTelNo) {
this.receiverTelNo = receiverTelNo;
}
public String getUserKey() {
return userKey;
}
public void setUserKey(String userKey) {
this.userKey = userKey;
}
public String getAdvertisementYn() {
return advertisementYn;
}
public void setAdvertisementYn(String advertisementYn) {
this.advertisementYn = advertisementYn;
}
public String getSendType() {
return sendType;
}
public void setSendType(String sendType) {
this.sendType = sendType;
}
public String getSenderKey() {
return senderKey;
}
public void setSenderKey(String senderKey) {
this.senderKey = senderKey;
}
public String getTemplateCode() {
return templateCode;
}
public void setTemplateCode(String templateCode) {
this.templateCode = templateCode;
}
public byte[] getImageFile1() {
return imageFile1;
}
public void setImageFile1(byte[] imageFile1) {
this.imageFile1 = imageFile1;
}
public byte[] getImageFile2() {
return imageFile2;
}
public void setImageFile2(byte[] imageFile2) {
this.imageFile2 = imageFile2;
}
public byte[] getImageFile3() {
return imageFile3;
}
public void setImageFile3(byte[] imageFile3) {
this.imageFile3 = imageFile3;
}
public byte[] getVideoFile() {
return videoFile;
}
public void setVideoFile(byte[] videoFile) {
this.videoFile = videoFile;
}
public String getInitCallNo() {
return initCallNo;
}
public void setInitCallNo(String initCallNo) {
this.initCallNo = initCallNo;
}
public String getOptionYn() {
return optionYn;
}
public void setOptionYn(String optionYn) {
this.optionYn = optionYn;
}
@Override
public String toString() {
return "MessageSendRequest{" +
"callback='" + callback + '\'' +
", contents='" + contents + '\'' +
", receiverTelNo='" + receiverTelNo + '\'' +
", userKey='" + userKey + '\'' +
", advertisementYn='" + advertisementYn + '\'' +
", sendType='" + sendType + '\'' +
", senderKey='" + senderKey + '\'' +
", templateCode='" + templateCode + '\'' +
", imageFile1=" + (imageFile1 != null ? "not null" : "null") +
", imageFile2=" + (imageFile2 != null ? "not null" : "null") +
", imageFile3=" + (imageFile3 != null ? "not null" : "null") +
", videoFile=" + (videoFile != null ? "not null" : "null") +
", initCallNo='" + initCallNo + '\'' +
", optionYn='" + optionYn + '\'' +
'}';
}
public static class Builder {
private String callback;
private String contents;
private String receiverTelNo;
private String userKey;
private String advertisementYn;
private String sendType;
private String senderKey;
private String templateCode;
private byte[] imageFile1;
private byte[] imageFile2;
private byte[] imageFile3;
private byte[] videoFile;
private String initCallNo;
private String optionYn;
public Builder callback(String callback) {
this.callback = callback;
return this;
}
public Builder contents(String contents) {
this.contents = contents;
return this;
}
public Builder receiverTelNo(String receiverTelNo) {
this.receiverTelNo = receiverTelNo;
return this;
}
public Builder userKey(String userKey) {
this.userKey = userKey;
return this;
}
public Builder advertisementYn(String advertisementYn) {
this.advertisementYn = advertisementYn;
return this;
}
public Builder sendType(String sendType) {
this.sendType = sendType;
return this;
}
public Builder senderKey(String senderKey) {
this.senderKey = senderKey;
return this;
}
public Builder templateCode(String templateCode) {
this.templateCode = templateCode;
return this;
}
public Builder imageFile1(byte[] imageFile1) {
this.imageFile1 = imageFile1;
return this;
}
public Builder imageFile2(byte[] imageFile2) {
this.imageFile2 = imageFile2;
return this;
}
public Builder imageFile3(byte[] imageFile3) {
this.imageFile3 = imageFile3;
return this;
}
public Builder videoFile(byte[] videoFile) {
this.videoFile = videoFile;
return this;
}
public Builder initCallNo(String initCallNo) {
this.initCallNo = initCallNo;
return this;
}
public Builder optionYn(String optionYn) {
this.optionYn = optionYn;
return this;
}
public MessageSendRequest build() {
return new MessageSendRequest(
callback, contents, receiverTelNo, userKey, advertisementYn,
sendType, senderKey, templateCode, imageFile1, imageFile2,
imageFile3, videoFile, initCallNo, optionYn
);
}
}
}

@ -1,92 +1,17 @@
package com.icomsys.vo;
import java.util.Objects;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MessageSendResponse {
private String code;
private String sendCode;
private String message;
private String sendType;
public MessageSendResponse() {}
public MessageSendResponse(String code, String sendCode, String message, String sendType) {
this.code = code;
this.sendCode = sendCode;
this.message = message;
this.sendType = sendType;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getSendCode() {
return sendCode;
}
public void setSendCode(String sendCode) {
this.sendCode = sendCode;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getSendType() {
return sendType;
}
public void setSendType(String sendType) {
this.sendType = sendType;
}
@Override
public String toString() {
return "MessageSendResponse{" +
"code='" + code + '\'' +
", sendCode='" + sendCode + '\'' +
", message='" + message + '\'' +
", sendType='" + sendType + '\'' +
'}';
}
public static class Builder {
private String code;
private String sendCode;
private String message;
private String sendType;
public Builder code(String code) {
this.code = code;
return this;
}
public Builder sendCode(String sendCode) {
this.sendCode = sendCode;
return this;
}
public Builder message(String message) {
this.message = message;
return this;
}
public Builder sendType(String sendType) {
this.sendType = sendType;
return this;
}
public MessageSendResponse build() {
return new MessageSendResponse(code, sendCode, message, sendType);
}
}
}

@ -1,107 +1,20 @@
package com.icomsys.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SejongKakaoSendRequest {
private String senderKey;
private String templateCode;
private String contents;
private String receiverTelNo;
private String userKey;
public SejongKakaoSendRequest() {}
public SejongKakaoSendRequest(String senderKey, String templateCode, String contents, String receiverTelNo, String userKey) {
this.senderKey = senderKey;
this.templateCode = templateCode;
this.contents = contents;
this.receiverTelNo = receiverTelNo;
this.userKey = userKey;
}
public String getSenderKey() {
return senderKey;
}
public void setSenderKey(String senderKey) {
this.senderKey = senderKey;
}
public String getTemplateCode() {
return templateCode;
}
public void setTemplateCode(String templateCode) {
this.templateCode = templateCode;
}
public String getContents() {
return contents;
}
public void setContents(String contents) {
this.contents = contents;
}
public String getReceiverTelNo() {
return receiverTelNo;
}
public void setReceiverTelNo(String receiverTelNo) {
this.receiverTelNo = receiverTelNo;
}
public String getUserKey() {
return userKey;
}
public void setUserKey(String userKey) {
this.userKey = userKey;
}
@Override
public String toString() {
return "SejongKakaoSendRequest{" +
"senderKey='" + senderKey + '\'' +
", templateCode='" + templateCode + '\'' +
", contents='" + contents + '\'' +
", receiverTelNo='" + receiverTelNo + '\'' +
", userKey='" + userKey + '\'' +
'}';
}
public static class Builder {
private String senderKey;
private String templateCode;
private String contents;
private String receiverTelNo;
private String userKey;
public Builder senderKey(String senderKey) {
this.senderKey = senderKey;
return this;
}
public Builder templateCode(String templateCode) {
this.templateCode = templateCode;
return this;
}
public Builder contents(String contents) {
this.contents = contents;
return this;
}
public Builder receiverTelNo(String receiverTelNo) {
this.receiverTelNo = receiverTelNo;
return this;
}
public Builder userKey(String userKey) {
this.userKey = userKey;
return this;
}
public SejongKakaoSendRequest build() {
return new SejongKakaoSendRequest(senderKey, templateCode, contents, receiverTelNo, userKey);
}
}
}

@ -1,77 +1,15 @@
package com.icomsys.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class SejongLmsSendRequest extends SejongSmsSendRequest {
private String title;
public SejongLmsSendRequest() {
super();
}
public SejongLmsSendRequest(String callback, String contents, String receiverTelNo, String userKey, String advertisementYn, String title) {
super(callback, contents, receiverTelNo, userKey, advertisementYn);
this.title = title;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
@Override
public String toString() {
return "SejongLmsSendRequest{" +
"title='" + title + '\'' +
", callback='" + getCallback() + '\'' +
", contents='" + getContents() + '\'' +
", receiverTelNo='" + getReceiverTelNo() + '\'' +
", userKey='" + getUserKey() + '\'' +
", advertisementYn='" + getAdvertisementYn() + '\'' +
'}';
}
public static class Builder {
private String callback;
private String contents;
private String receiverTelNo;
private String userKey;
private String advertisementYn;
private String title;
public Builder callback(String callback) {
this.callback = callback;
return this;
}
public Builder contents(String contents) {
this.contents = contents;
return this;
}
public Builder receiverTelNo(String receiverTelNo) {
this.receiverTelNo = receiverTelNo;
return this;
}
public Builder userKey(String userKey) {
this.userKey = userKey;
return this;
}
public Builder advertisementYn(String advertisementYn) {
this.advertisementYn = advertisementYn;
return this;
}
public Builder title(String title) {
this.title = title;
return this;
}
public SejongLmsSendRequest build() {
return new SejongLmsSendRequest(callback, contents, receiverTelNo, userKey, advertisementYn, title);
}
}
}

@ -1,73 +1,17 @@
package com.icomsys.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SejongMessageSendResponse {
private String code;
private String sendCode;
private String message;
public SejongMessageSendResponse() {}
public SejongMessageSendResponse(String code, String sendCode, String message) {
this.code = code;
this.sendCode = sendCode;
this.message = message;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getSendCode() {
return sendCode;
}
public void setSendCode(String sendCode) {
this.sendCode = sendCode;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public String toString() {
return "SejongMessageSendResponse{" +
"code='" + code + '\'' +
", sendCode='" + sendCode + '\'' +
", message='" + message + '\'' +
'}';
}
public static class Builder {
private String code;
private String sendCode;
private String message;
public Builder code(String code) {
this.code = code;
return this;
}
public Builder sendCode(String sendCode) {
this.sendCode = sendCode;
return this;
}
public Builder message(String message) {
this.message = message;
return this;
}
public SejongMessageSendResponse build() {
return new SejongMessageSendResponse(code, sendCode, message);
}
}
}

@ -1,69 +1,19 @@
package com.icomsys.vo;
import java.util.Arrays;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class SejongMmsSendRequest extends SejongLmsSendRequest {
private byte[] imageFile1;
private byte[] imageFile2;
private byte[] imageFile3;
private byte[] videoFile;
public SejongMmsSendRequest() {}
public SejongMmsSendRequest(String callback, String contents, String receiverTelNo, String userKey, String advertisementYn,
String title, byte[] imageFile1, byte[] imageFile2, byte[] imageFile3, byte[] videoFile) {
super(callback, contents, receiverTelNo, userKey, advertisementYn, title); // 부모 클래스 생성자 호출
this.imageFile1 = imageFile1;
this.imageFile2 = imageFile2;
this.imageFile3 = imageFile3;
this.videoFile = videoFile;
}
public byte[] getImageFile1() {
return imageFile1;
}
public void setImageFile1(byte[] imageFile1) {
this.imageFile1 = imageFile1;
}
public byte[] getImageFile2() {
return imageFile2;
}
public void setImageFile2(byte[] imageFile2) {
this.imageFile2 = imageFile2;
}
public byte[] getImageFile3() {
return imageFile3;
}
public void setImageFile3(byte[] imageFile3) {
this.imageFile3 = imageFile3;
}
public byte[] getVideoFile() {
return videoFile;
}
public void setVideoFile(byte[] videoFile) {
this.videoFile = videoFile;
}
@Override
public String toString() {
return "SejongMmsSendRequest{" +
"imageFile1=" + Arrays.toString(imageFile1) +
", imageFile2=" + Arrays.toString(imageFile2) +
", imageFile3=" + Arrays.toString(imageFile3) +
", videoFile=" + Arrays.toString(videoFile) +
", title='" + getTitle() + '\'' +
", callback='" + getCallback() + '\'' +
", contents='" + getContents() + '\'' +
", receiverTelNo='" + getReceiverTelNo() + '\'' +
", userKey='" + getUserKey() + '\'' +
", advertisementYn='" + getAdvertisementYn() + '\'' +
'}';
}
}

@ -1,109 +1,21 @@
package com.icomsys.vo;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class SejongSmsSendRequest {
private String callback;
private String contents;
private String receiverTelNo;
private String userKey;
private String advertisementYn;
public SejongSmsSendRequest() {}
public SejongSmsSendRequest(String callback, String contents, String receiverTelNo, String userKey, String advertisementYn) {
this.callback = callback;
this.contents = contents;
this.receiverTelNo = receiverTelNo;
this.userKey = userKey;
this.advertisementYn = advertisementYn;
}
public String getCallback() {
return callback;
}
public void setCallback(String callback) {
this.callback = callback;
}
public String getContents() {
return contents;
}
public void setContents(String contents) {
this.contents = contents;
}
public String getReceiverTelNo() {
return receiverTelNo;
}
public void setReceiverTelNo(String receiverTelNo) {
this.receiverTelNo = receiverTelNo;
}
public String getUserKey() {
return userKey;
}
public void setUserKey(String userKey) {
this.userKey = userKey;
}
public String getAdvertisementYn() {
return advertisementYn;
}
public void setAdvertisementYn(String advertisementYn) {
this.advertisementYn = advertisementYn;
}
@Override
public String toString() {
return "SejongSmsSendRequest{" +
"callback='" + callback + '\'' +
", contents='" + contents + '\'' +
", receiverTelNo='" + receiverTelNo + '\'' +
", userKey='" + userKey + '\'' +
", advertisementYn='" + advertisementYn + '\'' +
'}';
}
public static class Builder {
private String callback;
private String contents;
private String receiverTelNo;
private String userKey;
private String advertisementYn;
public Builder callback(String callback) {
this.callback = callback;
return this;
}
public Builder contents(String contents) {
this.contents = contents;
return this;
}
public Builder receiverTelNo(String receiverTelNo) {
this.receiverTelNo = receiverTelNo;
return this;
}
public Builder userKey(String userKey) {
this.userKey = userKey;
return this;
}
public Builder advertisementYn(String advertisementYn) {
this.advertisementYn = advertisementYn;
return this;
}
public SejongSmsSendRequest build() {
return new SejongSmsSendRequest(callback, contents, receiverTelNo, userKey, advertisementYn);
}
}
}

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.icomsys.cinnamon.share.mapper.message.MessageSendLogMapper">
<mapper namespace="com.icomsys.mapper.MessageSendLogMapper">
<insert id="insertSendLog" parameterType="com.icomsys.cinnamon.core.api.informal.message.vo.MessageSendLogInfo"> <!--useGeneratedKeys="true" keyProperty="seqNo"-->
<insert id="insertSendLog" parameterType="com.icomsys.vo.MessageSendLogInfo"> <!--useGeneratedKeys="true" keyProperty="seqNo"-->
INSERT INTO TB_UMS_SEND_LOG
(SEND_YN, USER_KEY, CALL_BACK, RECEIVER_TEL_NO, SEND_TYPE, CONTENTS, ADVERTISEMENT_YN,
IMAGE_FILE1, IMAGE_FILE2, IMAGE_FILE3, VIDEO_FILE, SENDER_KEY, TEMPLATE_CODE, INIT_CALL_NO,
@ -13,7 +13,7 @@
#{apiResponseCode}, #{resultCode}, #{registDate}, #{optionYn})
</insert>
<select id="selectSendLog" parameterType="String" resultType="com.icomsys.cinnamon.core.api.informal.message.vo.MessageSendRequest">
<select id="selectSendLog" parameterType="String" resultType="com.icomsys.vo.MessageSendRequest">
SELECT CALL_BACK, CONTENTS, RECEIVER_TEL_NO, USER_KEY, ADVERTISEMENT_YN, SEND_TYPE, SENDER_KEY,
TEMPLATE_CODE, IMAGE_FILE1, IMAGE_FILE2, IMAGE_FILE3, VIDEO_FILE, INIT_CALL_NO, OPTION_YN
FROM TB_UMS_SEND_LOG

@ -1,5 +1,3 @@
#Generated by Maven
#Fri Jan 03 14:29:58 KST 2025
groupId=com.icomsys.message
artifactId=message-module
version=0.0.8-SNAPSHOT
groupId=com.icomsys.message
version=0.0.1-SNAPSHOT

@ -1,24 +1,29 @@
com\icomsys\vo\SejongMessageSendResponse$Builder.class
com\icomsys\vo\MessageSendRequest$Builder.class
com\icomsys\vo\SejongKakaoSendRequest$Builder.class
com\icomsys\vo\SejongMessageSendResponse$SejongMessageSendResponseBuilder.class
com\icomsys\vo\SejongMessageSendResponse.class
com\icomsys\MessagingConnector$1.class
com\icomsys\vo\MessageSendLogInfo$Builder.class
com\icomsys\dsl\MessageSendServiceDslImpl.class
com\icomsys\vo\SejongMmsSendRequest$SejongMmsSendRequestBuilder.class
com\icomsys\vo\SejongLmsSendRequest$SejongLmsSendRequestBuilderImpl.class
com\icomsys\MessagingConnector$3.class
com\icomsys\vo\SejongKakaoSendRequest.class
com\icomsys\vo\SejongLmsSendRequest$Builder.class
com\icomsys\vo\MessageSendLogInfo$MessageSendLogInfoBuilder.class
com\icomsys\vo\SejongLmsSendRequest$SejongLmsSendRequestBuilder.class
com\icomsys\vo\MessageSendResponse$MessageSendResponseBuilder.class
com\icomsys\vo\SejongKakaoSendRequest$SejongKakaoSendRequestBuilder.class
com\icomsys\vo\MessageSendResponse.class
com\icomsys\message\MessageSendLogMapper.class
com\icomsys\vo\MessageSendLogInfo.class
com\icomsys\util\CommonBeanUtils.class
com\icomsys\vo\SejongSmsSendRequest$Builder.class
com\icomsys\MessagingConnector$5.class
com\icomsys\vo\SejongMmsSendRequest.class
com\icomsys\MessagingConnector$2.class
com\icomsys\vo\SejongMmsSendRequest$SejongMmsSendRequestBuilderImpl.class
com\icomsys\vo\MessageSendRequest.class
com\icomsys\vo\MessageSendResponse$Builder.class
com\icomsys\vo\SejongSmsSendRequest$SejongSmsSendRequestBuilder.class
com\icomsys\MessagingConnector.class
com\icomsys\vo\SejongLmsSendRequest.class
com\icomsys\vo\SejongSmsSendRequest$SejongSmsSendRequestBuilderImpl.class
com\icomsys\mapper\MessageSendLogMapper.class
com\icomsys\vo\SejongSmsSendRequest.class
com\icomsys\dsl\MessageSendServiceDsl.class
com\icomsys\vo\MessageSendRequest$MessageSendRequestBuilder.class
com\icomsys\MessagingConnector$4.class

@ -1,13 +1,13 @@
C:\workspace\message\untitled1\src\main\java\com\icomsys\vo\SejongKakaoSendRequest.java
C:\workspace\message\untitled1\src\main\java\com\icomsys\vo\SejongMmsSendRequest.java
C:\workspace\message\untitled1\src\main\java\com\icomsys\vo\MessageSendLogInfo.java
C:\workspace\message\untitled1\src\main\java\com\icomsys\message\MessageSendLogMapper.java
C:\workspace\message\untitled1\src\main\java\com\icomsys\MessagingConnector.java
C:\workspace\message\untitled1\src\main\java\com\icomsys\vo\SejongSmsSendRequest.java
C:\workspace\message\untitled1\src\main\java\com\icomsys\vo\MessageSendRequest.java
C:\workspace\message\untitled1\src\main\java\com\icomsys\dsl\MessageSendServiceDsl.java
C:\workspace\message\untitled1\src\main\java\com\icomsys\vo\MessageSendResponse.java
C:\workspace\message\untitled1\src\main\java\com\icomsys\vo\SejongMessageSendResponse.java
C:\workspace\message\untitled1\src\main\java\com\icomsys\dsl\MessageSendServiceDslImpl.java
C:\workspace\message\untitled1\src\main\java\com\icomsys\util\CommonBeanUtils.java
C:\workspace\message\untitled1\src\main\java\com\icomsys\vo\SejongLmsSendRequest.java
C:\workspace\message\project\src\main\java\com\icomsys\dsl\MessageSendServiceDslImpl.java
C:\workspace\message\project\src\main\java\com\icomsys\vo\MessageSendLogInfo.java
C:\workspace\message\project\src\main\java\com\icomsys\MessagingConnector.java
C:\workspace\message\project\src\main\java\com\icomsys\util\CommonBeanUtils.java
C:\workspace\message\project\src\main\java\com\icomsys\vo\SejongSmsSendRequest.java
C:\workspace\message\project\src\main\java\com\icomsys\mapper\MessageSendLogMapper.java
C:\workspace\message\project\src\main\java\com\icomsys\vo\MessageSendResponse.java
C:\workspace\message\project\src\main\java\com\icomsys\vo\SejongMmsSendRequest.java
C:\workspace\message\project\src\main\java\com\icomsys\dsl\MessageSendServiceDsl.java
C:\workspace\message\project\src\main\java\com\icomsys\vo\MessageSendRequest.java
C:\workspace\message\project\src\main\java\com\icomsys\vo\SejongKakaoSendRequest.java
C:\workspace\message\project\src\main\java\com\icomsys\vo\SejongLmsSendRequest.java
C:\workspace\message\project\src\main\java\com\icomsys\vo\SejongMessageSendResponse.java

Loading…
Cancel
Save