20250113
parent
518e390267
commit
9a6d4f1d08
@ -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);
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -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
|
||||
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue