From d32005450fa0aa2327fb85f2a7a362d41c66f963 Mon Sep 17 00:00:00 2001 From: eastargh Date: Mon, 1 Jun 2026 17:34:15 +0900 Subject: [PATCH 1/4] =?UTF-8?q?DB=EC=8A=A4=ED=82=A4=EB=A7=88=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20EMSADM->EMSAPP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/eactive/ext/kjb/utils/KjbPropertyUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/eactive/ext/kjb/utils/KjbPropertyUtil.java b/src/main/java/com/eactive/ext/kjb/utils/KjbPropertyUtil.java index 4fb4359..224e430 100644 --- a/src/main/java/com/eactive/ext/kjb/utils/KjbPropertyUtil.java +++ b/src/main/java/com/eactive/ext/kjb/utils/KjbPropertyUtil.java @@ -17,11 +17,11 @@ public class KjbPropertyUtil { KjbPropertyValue anno = field.getAnnotation(KjbPropertyValue.class); if (anno != null) { - sbDelete.append("DELETE FROM EMSADM.TSEAIRM24 WHERE PRPTYGROUPNAME = 'Monitoring' AND PRPTYNAME = '"); + sbDelete.append("DELETE FROM EMSAPP.TSEAIRM24 WHERE PRPTYGROUPNAME = 'Monitoring' AND PRPTYNAME = '"); sbDelete.append(anno.key()); sbDelete.append("';\n"); - sb.append("insert into EMSADM.TSEAIRM24 (PRPTYGROUPNAME, PRPTYNAME, PRPTY2VAL) values ('Monitoring', "); + sb.append("insert into EMSAPP.TSEAIRM24 (PRPTYGROUPNAME, PRPTYNAME, PRPTY2VAL) values ('Monitoring', "); String key = anno.key(); String defValue = anno.defaultValue(); From 777ca3a6a6ad09246a63509d223bbef70cf708b2 Mon Sep 17 00:00:00 2001 From: eastargh Date: Tue, 2 Jun 2026 13:30:59 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=EC=A0=9C=EC=A3=BC=EC=9D=80=ED=96=89=20?= =?UTF-8?q?=EB=A9=94=EC=8B=A0=EC=A0=80=20=EB=B0=9C=EC=86=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DjbIncidentDetectionService.java | 41 ++++++ .../event/ApiStatusChangedEventHandler.java | 29 ++++ .../ext/djb/ums/DjbMessengerService.java | 131 ++++++++++++++++++ .../eactive/ext/kjb/common/KjbProperty.java | 11 ++ 4 files changed, 212 insertions(+) create mode 100644 src/main/java/com/eactive/ext/djb/apistatus/DjbIncidentDetectionService.java create mode 100644 src/main/java/com/eactive/ext/djb/apistatus/event/ApiStatusChangedEventHandler.java create mode 100644 src/main/java/com/eactive/ext/djb/ums/DjbMessengerService.java diff --git a/src/main/java/com/eactive/ext/djb/apistatus/DjbIncidentDetectionService.java b/src/main/java/com/eactive/ext/djb/apistatus/DjbIncidentDetectionService.java new file mode 100644 index 0000000..955d874 --- /dev/null +++ b/src/main/java/com/eactive/ext/djb/apistatus/DjbIncidentDetectionService.java @@ -0,0 +1,41 @@ +package com.eactive.ext.djb.apistatus; + +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +@Service +@Transactional +public class DjbIncidentDetectionService { + + private static final Logger log = LoggerFactory.getLogger(DjbIncidentDetectionService.class); + + /** + * 이벤트 감지 + * @param event "CONTROL_START" : 점검시작 + "CONTROL_END" : 점검종료 + "ERROR_START" : 장애시작 + "ERROR_END" : 장애종료 + "DELAY_START" : 지연시작 + "DELAY_END" : 지연종료 + * @param apiIds API IDs + */ + public void detect(String event, List apiIds) { + log.debug("이벤트 감지: {} {}", event, apiIds); + } + + // API FSM 내 아직 장애로 남아있는 API 목록 + public void remainDownApiIds() { + + } + + + // 정상 동작 - detect()에서 일괄 처리 (복구 = 점검종료, 장애종료, 지연종료) +// public void recovered(String event, String[] apiIds) { +// +// } + +} \ No newline at end of file diff --git a/src/main/java/com/eactive/ext/djb/apistatus/event/ApiStatusChangedEventHandler.java b/src/main/java/com/eactive/ext/djb/apistatus/event/ApiStatusChangedEventHandler.java new file mode 100644 index 0000000..ed1260e --- /dev/null +++ b/src/main/java/com/eactive/ext/djb/apistatus/event/ApiStatusChangedEventHandler.java @@ -0,0 +1,29 @@ +package com.eactive.ext.djb.apistatus.event; + +import java.util.HashMap; +import java.util.Map; + +import org.springframework.stereotype.Component; + +import com.eactive.apim.portal.template.entity.MessageCode; +import com.eactive.apim.portal.template.service.MessageEventHandler; +import com.eactive.apim.portal.template.service.MessageRecipient; +import com.eactive.apim.portal.template.service.MessageSendEvent; + +@Component +public class ApiStatusChangedEventHandler implements MessageEventHandler { + + @Override + public MessageCode getKey() { return MessageCode.API_STATUS_CHANGED; } + + @Override + public MessageSendEvent createEvent(Object source, MessageRecipient recipient, Map params) { + Map p = new HashMap<>(); + params.forEach((k, v) -> p.put(k, v != null ? v.toString() : null)); + return new MessageSendEvent(source, getKey(), recipient, p); + } + + @Override public boolean allowAdditionalRecipients() { return true; } + @Override public String getDisplayName() { return "API 상태 변경"; } + @Override public String getDescription() { return "API 상태가 변경되었습니다"; } +} diff --git a/src/main/java/com/eactive/ext/djb/ums/DjbMessengerService.java b/src/main/java/com/eactive/ext/djb/ums/DjbMessengerService.java new file mode 100644 index 0000000..7094fe3 --- /dev/null +++ b/src/main/java/com/eactive/ext/djb/ums/DjbMessengerService.java @@ -0,0 +1,131 @@ +package com.eactive.ext.djb.ums; + +import java.io.BufferedReader; +import java.net.HttpURLConnection; +import java.net.URL; +import java.nio.charset.Charset; + +import org.apache.commons.lang3.StringUtils; +import org.apache.hc.client5.http.config.RequestConfig; +import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; +import org.apache.hc.client5.http.impl.classic.HttpClients; +import org.apache.hc.core5.util.Timeout; + +import com.eactive.apim.portal.template.entity.MessageCode; +import com.eactive.apim.portal.template.entity.MessageRequest; +import com.eactive.ext.kjb.common.KjbProperty; +import com.eactive.ext.kjb.common.KjbPropertyHolder; + +import lombok.extern.slf4j.Slf4j; + +@Slf4j +public class DjbMessengerService { + public final static int[] ALLOW_CHANNELS = { MessageCode.Channels.MESSENGER.getValue() }; + + + private static volatile DjbMessengerService instance; + + + private DjbMessengerService() { + // 싱글톤 + } + + public static DjbMessengerService getInstance() { + if (instance == null) { + synchronized (DjbMessengerService.class) { + if (instance == null) { + instance = new DjbMessengerService(); + } + } + } + return instance; + } + + private KjbProperty getProperty() { + return KjbPropertyHolder.get(); + } + + private boolean isRealMode() { + String url = getProperty().getUmsHostUrl(); + return url != null && StringUtils.isNotEmpty(url.trim()); + } + + private CloseableHttpClient createHttpClient() { + return HttpClients.createDefault(); + } + + private RequestConfig createRequestConfig() { + KjbProperty prop = getProperty(); + return RequestConfig.custom() + .setConnectTimeout(Timeout.ofSeconds(prop.getUmsConnectionTimeout())) + .setResponseTimeout(Timeout.ofSeconds(prop.getUmsResponseTimeout())) + .build(); + } + + public static boolean isAllowChannel(MessageRequest message) { + for (int channel : ALLOW_CHANNELS) { + if ((message.getMessageCode().getChannels() & channel) == channel) { + return true; + } + } + return false; + } + + + public boolean send(MessageRequest messageRequest) throws Exception { + if (messageRequest == null) { + throw new IllegalArgumentException("messageRequest is null"); + } + + if (MessageCode.Channels.MESSENGER.getValue() != (messageRequest.getMessageCode().getChannels() & MessageCode.Channels.MESSENGER.getValue())) { + log.error("지원하지 않는 발송 채널 - {}", messageRequest.getMessageCode().toString()); + throw new IllegalArgumentException("지원하지 않는 발송 채널 - " + messageRequest.getMessageCode().toString()); + } + + this.httpConnection(messageRequest); + + return true; + } + + + private void httpConnection(MessageRequest messageRequest) throws Exception { + + URL url = new URL(getProperty().getSwingUrl()); + int timeoutvalue = 5 * 1000; // 타임아웃 설정을 위한 값 (단위: ms) + // Charset charset = Charset.forName("UTF-8"); + Charset charset = Charset.forName("MS949"); + HttpURLConnection conn = null; + BufferedReader br = null; + StringBuffer sb = null; +// String bodyData = this.makeBodyData(cnslDivCdval); + + +// String responseData = ""; +// String method = bodyData != "" ? "POST" : "GET"; +// conn " (HttpURL Connection) url.openConnection(); +// conn.setRequestMethod(method); // w #4 +// // conn.setRequestProperty("Content-Type", "application/json; charset=UTF-8"); +// conn.setRequestProperty("Content-Type", "application/json; charset=MS949"); +// conn.setConnectTimeout(timeoutValue); // Cz EGoR 48(5=) +// conn.setReadTimeout(timeoutValue); // 8 #gOR N8(5s) +// conn.setDoOutput(true); +// // POst 40 +// if (method.equals("POST")) ( +// Outputstream os = conn.getOutputStream(); +// byte requestData[] - bodyData.getBytes(charset); +// os.write(requestData); +// os.close(); +// ph +// System.out.println("getContentType():"t conn.getContentType()); +// System,out.println("getResponseCode();" t conn.getResponseCode()); +// System.out.println("getResponseMessage();" + conn.getResponseMessage()); +// if (LOG_DEBUG, isDebugEnabled()) ( +// LOG_DEBUG. debug("getContentType();" + conn.getContentType()); // 5 0= 5 #7 +// LOG_DEBUG. debug("getResponsecode();" + conn.getResponseCode()); // ## #5 7#7| +// LOG_DEBUG. debug("getResponseMessage():" + conn.getResponseMessage()); // + } + + private String makeBodyData() { + return ""; + } +} diff --git a/src/main/java/com/eactive/ext/kjb/common/KjbProperty.java b/src/main/java/com/eactive/ext/kjb/common/KjbProperty.java index 554da7b..ce2c61f 100644 --- a/src/main/java/com/eactive/ext/kjb/common/KjbProperty.java +++ b/src/main/java/com/eactive/ext/kjb/common/KjbProperty.java @@ -189,8 +189,19 @@ public class KjbProperty { defaultValue = "10000" ) private Integer apiGwMetricPageSize = 10000; + + + + + // 제주은행 swing chat (messenger) + @KjbPropertyValue(key = "djb.swing.url", defaultValue = "http://172.31.35.144:9021") + @NotEmpty + private String swingUrl = ""; + + + public String toJsonString(boolean isPretty) { return isPretty ? new GsonBuilder().setPrettyPrinting().create().toJson(this) From d42fd1d9be58b51005de66becd5e404188fb80b8 Mon Sep 17 00:00:00 2001 From: eastargh Date: Thu, 4 Jun 2026 17:39:35 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=EC=8A=A4=EC=9C=99=EC=B1=97=20=EB=B0=9C?= =?UTF-8?q?=EC=86=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ext/djb/ums/DjbMessengerService.java | 255 ++++++++++++++++-- .../eactive/ext/djb/ums/SwingCommonVO.java | 19 ++ .../com/eactive/ext/djb/ums/SwingDataVO.java | 21 ++ .../com/eactive/ext/djb/ums/SwingHeadVO.java | 63 +++++ .../ext/djb/ums/SwingReceiverDataVO.java | 22 ++ .../eactive/ext/kjb/common/KjbProperty.java | 16 +- 6 files changed, 367 insertions(+), 29 deletions(-) create mode 100644 src/main/java/com/eactive/ext/djb/ums/SwingCommonVO.java create mode 100644 src/main/java/com/eactive/ext/djb/ums/SwingDataVO.java create mode 100644 src/main/java/com/eactive/ext/djb/ums/SwingHeadVO.java create mode 100644 src/main/java/com/eactive/ext/djb/ums/SwingReceiverDataVO.java diff --git a/src/main/java/com/eactive/ext/djb/ums/DjbMessengerService.java b/src/main/java/com/eactive/ext/djb/ums/DjbMessengerService.java index 7094fe3..9323c13 100644 --- a/src/main/java/com/eactive/ext/djb/ums/DjbMessengerService.java +++ b/src/main/java/com/eactive/ext/djb/ums/DjbMessengerService.java @@ -1,9 +1,17 @@ package com.eactive.ext.djb.ums; import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; import java.nio.charset.Charset; +import java.security.SecureRandom; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Random; import org.apache.commons.lang3.StringUtils; import org.apache.hc.client5.http.config.RequestConfig; @@ -15,6 +23,7 @@ import com.eactive.apim.portal.template.entity.MessageCode; import com.eactive.apim.portal.template.entity.MessageRequest; import com.eactive.ext.kjb.common.KjbProperty; import com.eactive.ext.kjb.common.KjbPropertyHolder; +import com.google.gson.Gson; import lombok.extern.slf4j.Slf4j; @@ -22,6 +31,7 @@ import lombok.extern.slf4j.Slf4j; public class DjbMessengerService { public final static int[] ALLOW_CHANNELS = { MessageCode.Channels.MESSENGER.getValue() }; + private static final Gson gson = new Gson(); private static volatile DjbMessengerService instance; @@ -89,43 +99,234 @@ public class DjbMessengerService { private void httpConnection(MessageRequest messageRequest) throws Exception { + + KjbProperty prop = getProperty(); - URL url = new URL(getProperty().getSwingUrl()); - int timeoutvalue = 5 * 1000; // 타임아웃 설정을 위한 값 (단위: ms) + URL url = new URL(prop.getSwingUrl()); + int timeoutValue = 5 * 1000; // 타임아웃 설정을 위한 값 (단위: ms) // Charset charset = Charset.forName("UTF-8"); Charset charset = Charset.forName("MS949"); HttpURLConnection conn = null; BufferedReader br = null; StringBuffer sb = null; -// String bodyData = this.makeBodyData(cnslDivCdval); - - -// String responseData = ""; -// String method = bodyData != "" ? "POST" : "GET"; -// conn " (HttpURL Connection) url.openConnection(); -// conn.setRequestMethod(method); // w #4 -// // conn.setRequestProperty("Content-Type", "application/json; charset=UTF-8"); -// conn.setRequestProperty("Content-Type", "application/json; charset=MS949"); -// conn.setConnectTimeout(timeoutValue); // Cz EGoR 48(5=) -// conn.setReadTimeout(timeoutValue); // 8 #gOR N8(5s) -// conn.setDoOutput(true); -// // POst 40 -// if (method.equals("POST")) ( -// Outputstream os = conn.getOutputStream(); -// byte requestData[] - bodyData.getBytes(charset); -// os.write(requestData); -// os.close(); -// ph + String bodyData = this.makeBodyData(messageRequest); + + String responseData = ""; + String method = bodyData != "" ? "POST" : "GET"; + conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod(method); // 전송방식 + // conn.setRequestProperty("Content-Type", "application/json; charset=UTF-8"); + conn.setRequestProperty("Content-Type", "application/json; charset=MS949"); + conn.setConnectTimeout(timeoutValue); // 연결 타임아웃 설정(5초) + conn.setReadTimeout(timeoutValue); // 읽기 타임아웃 설정(5초) + conn.setDoOutput(true); + + // POst 방식인 경우에만 + if (method.equals("POST")) { + OutputStream os = conn.getOutputStream(); + byte requestData[] = bodyData.getBytes(charset); + os.write(requestData); + os.close(); + } // System.out.println("getContentType():"t conn.getContentType()); // System,out.println("getResponseCode();" t conn.getResponseCode()); // System.out.println("getResponseMessage();" + conn.getResponseMessage()); -// if (LOG_DEBUG, isDebugEnabled()) ( -// LOG_DEBUG. debug("getContentType();" + conn.getContentType()); // 5 0= 5 #7 -// LOG_DEBUG. debug("getResponsecode();" + conn.getResponseCode()); // ## #5 7#7| -// LOG_DEBUG. debug("getResponseMessage():" + conn.getResponseMessage()); // + if (log.isDebugEnabled()) { + log.debug("getContentType();" + conn.getContentType()); // 응답 콘텐츠 유형 구하기 + log.debug("getResponsecode();" + conn.getResponseCode()); // 응답 코드 구하기 + log.debug("getResponseMessage():" + conn.getResponseMessage()); // 응답 메세지 구하기 + } + + + // http 요청 후 응답 받은 데이타를 버퍼에 쌓는다 + if (conn.getResponseCode() >= 200 && conn.getResponseCode() <= 300) { + br = new BufferedReader(new InputStreamReader(conn.getInputStream(), charset)); + } else { + br = new BufferedReader(new InputStreamReader(conn.getErrorStream(), charset)); + } + + String inputLine; + sb = new StringBuffer(); + while ((inputLine = br.readLine()) != null) { + sb.append(inputLine); + } + + responseData = sb.toString(); + + // http 요청 및 응답 완료 후 BufferedReader를 닫는다 + if (br != null) { + br.close(); + conn.disconnect(); + } + } + + + private String makeBodyData(MessageRequest messageRequest) { + + KjbProperty prop = getProperty(); + + // 리턴값 + String rtnVal = ""; + + // 스윙챗 알림 헤더 + SwingHeadVO swiHeadVO = new SwingHeadVO(); + + // 스윙챗 알림 공용 + SwingCommonVO swiComVO = new SwingCommonVO(); + + // 스윙챗 알림 데이터 + SwingDataVO swiDataVO = new SwingDataVO(); + + // 스윙챗 알림 데이터 + List swiReDataVOList = new ArrayList(); + + // guID 및 날짜 시간 정보 + String jsonData[] = this.makeJsonDataInfo(); + + // 스윙챗 알림 헤더 설정 + swiHeadVO.setNxgn_stnd_idfr("JERA"); + swiHeadVO.setGuid(jsonData[2]); + swiHeadVO.setGuid_prgs_no("1"); + swiHeadVO.setStnd_mesg_ver("R10"); + swiHeadVO.setOrtr_guid(jsonData[2]); + swiHeadVO.setSect_ecrpt_yn("N"); + swiHeadVO.setFrst_trnm_ipad(prop.getSwingWasIpAddress()); + swiHeadVO.setFrst_trnm_ipv4_addr(prop.getSwingWasIpAddress()); + swiHeadVO.setFrst_trnm_mac(prop.getSwingMacIpAddress()); + swiHeadVO.setFrst_mesg_dman_dt(jsonData[0]); + swiHeadVO.setFrst_mesg_dman_time(jsonData[1]); + swiHeadVO.setFrst_trnm_sys_dvcd("EBG"); + swiHeadVO.setTrnm_sys_dvcd("FEP"); + swiHeadVO.setDman_rspn_dvcd("S"); + swiHeadVO.setSys_env_dvcd("TODO: 설정값 확인 할것!!!"); //TODO: EgovPropertiesUtils.getOptionalProp("SYS_ENV_DVCD")); + swiHeadVO.setTx_tycd("0"); + swiHeadVO.setSynz_dvcd("S"); + swiHeadVO.setTx_id("MSGSENDMSG1S"); + swiHeadVO.setXtis_cd(null); + swiHeadVO.setOsdch_dvcd(null); + swiHeadVO.setChnl_tycd("FEP"); + swiHeadVO.setIf_id("F2HMPSHGMSGSENDMSG1S"); + swiHeadVO.setHmab_dvcd("2"); + swiHeadVO.setTx_brcd("157"); + swiHeadVO.setTlrno("ET0001"); + swiHeadVO.setInsl_brcd("157"); + swiHeadVO.setBlng_brcd("157"); + swiHeadVO.setMgmt_brcd("157"); + swiComVO.setClientld(prop.getSwingClientId()); + swiComVO.setClientSecret(prop.getSwingClientSecret()); + swiComVO.setCompanyCode("CB"); + + // 랜던값(26) + String random26 = this.genrateRandomStringNumber26(); + swiComVO.setRequestUniqueKey(random26); + swiDataVO.setNotiCode("CNO_FEP_HMP_0002"); + swiDataVO.setNotiTitle("알림"); + swiDataVO.setNotiContent(messageRequest.getMessage()); + + SwingReceiverDataVO receiver = new SwingReceiverDataVO(); + receiver.setCode(messageRequest.getMessengerId()); + swiReDataVOList.add(receiver); + + swiDataVO.setReceiverInfo(swiReDataVOList); + + String header = gson.toJson(swiHeadVO); + String common = gson.toJson(swiComVO); + String data = gson.toJson(swiDataVO); + + // 헤더 + 데이터 + rtnVal = "{\"HEAD\":" + header + " ,\r\n" + "\"DATA\":\r\n" + " [" + "{\r\n" + + " \"data_dvcd\":\"IO\", \r\n" + " \"BIZ_DATA\":\r\n" + " {\r\n" + + " \"common\":\r\n" + common + ",\r\n" + " \"data\":" + data + + " }\r\n" + " }\r\n" + " ]\r\n" + "}"; + + log.debug(rtnVal); + + return rtnVal; } - private String makeBodyData() { - return ""; + private String[] makeJsonDataInfo() { + // 리턴값 + String rtnVal[] = new String[3]; + + // 현재시간 + Date currentDate = new Date(); + + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); + String formattedDate = sdf.format(currentDate); + + rtnVal[0] = formattedDate.substring(0,8); + rtnVal[1] = formattedDate.substring(8); + + // 랜던값 + String random20 = this.genrateRandomStringNumber20(); + + rtnVal[2] = formattedDate + "HMP" + random20; + + return rtnVal; + } + + + private String genrateRandomStringNumber20() { + String rtnVal= ""; + + StringBuilder buffer= new StringBuilder(10); + + // 랜덤값 + String characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + + // 랜덤객체 생성 + SecureRandom random = new SecureRandom(); + + // 반복문 + for (int i= 0;i< 10;i++) { + // 랜덤수 + int randomIndex = random.nextInt(characters.length()); + + // 생성된 랜덤값 + char randomChar = characters.charAt(randomIndex); + + // 랜덤값 저장 + buffer.append(randomChar); + } + + // 랜덤객체 재생성 + random = new SecureRandom(); + + // 난수 10개 생성 + int random10 = (int) (Math.pow(10, 9) + random.nextDouble() * Math.pow(10, 9)); + + // 문자 숫자 조합(10) + 숫자(10) + rtnVal = buffer.toString() + Integer.toString(random10); + + //리턴 + return rtnVal; + } + + private String genrateRandomStringNumber26() { + String rtnVal = ""; + + // 리턴값 + StringBuilder buffer = new StringBuilder(26); + + String characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789"; + + // 랜덤객체 생성 + Random random = new Random(); + + //반복문 + for (int i= 0; i < 26; i++) { + // 랜덤수 + int randomIndex = random.nextInt(characters.length()); + // 생성된 랜덤값 + char randomChar = characters.charAt(randomIndex); + // 랜덤값 저장 + buffer.append(randomChar); + } + + // 문자 숫자 조합(26) + rtnVal= buffer.toString(); + + // 리턴 + return rtnVal; } } diff --git a/src/main/java/com/eactive/ext/djb/ums/SwingCommonVO.java b/src/main/java/com/eactive/ext/djb/ums/SwingCommonVO.java new file mode 100644 index 0000000..0008449 --- /dev/null +++ b/src/main/java/com/eactive/ext/djb/ums/SwingCommonVO.java @@ -0,0 +1,19 @@ +package com.eactive.ext.djb.ums; + +import lombok.Data; + +@Data +public class SwingCommonVO { + + /** 클라이업트 D */ + private String clientld; + + /** 클라이언트 시크릿 */ + private String clientSecret; + + /** 회사코드 */ + private String companyCode; + + /** 요청고유키 */ + private String requestUniqueKey; +} diff --git a/src/main/java/com/eactive/ext/djb/ums/SwingDataVO.java b/src/main/java/com/eactive/ext/djb/ums/SwingDataVO.java new file mode 100644 index 0000000..134bca2 --- /dev/null +++ b/src/main/java/com/eactive/ext/djb/ums/SwingDataVO.java @@ -0,0 +1,21 @@ +package com.eactive.ext.djb.ums; + +import java.util.List; + +import lombok.Data; + +@Data +public class SwingDataVO { + + /** 알림코드 */ + private String notiCode; + + /** 알림제목 */ + private String notiTitle; + + /** 알림내용 */ + private String notiContent; + + /** 수신자정보 */ + private List receiverInfo; +} diff --git a/src/main/java/com/eactive/ext/djb/ums/SwingHeadVO.java b/src/main/java/com/eactive/ext/djb/ums/SwingHeadVO.java new file mode 100644 index 0000000..5cb10c7 --- /dev/null +++ b/src/main/java/com/eactive/ext/djb/ums/SwingHeadVO.java @@ -0,0 +1,63 @@ +package com.eactive.ext.djb.ums; + +import lombok.Data; + +@Data +public class SwingHeadVO { + + private String nxgn_stnd_idfr; + + private String guid; + + private String guid_prgs_no; + + private String stnd_mesg_ver; + + private String ortr_guid; + + private String sect_ecrpt_yn; + + private String frst_trnm_ipad; + + private String frst_trnm_ipv4_addr; + + private String frst_trnm_mac; + + private String frst_mesg_dman_dt; + + private String frst_mesg_dman_time; + + private String frst_trnm_sys_dvcd; + + private String trnm_sys_dvcd; + + private String dman_rspn_dvcd; + + private String sys_env_dvcd; + + private String tx_tycd; + + private String synz_dvcd; + + private String tx_id; + + private String xtis_cd; + + private String osdch_dvcd; + + private String chnl_tycd; + + private String if_id; + + private String hmab_dvcd; + + private String tx_brcd; + + private String tlrno; + + private String insl_brcd; + + private String blng_brcd; + + private String mgmt_brcd; +} diff --git a/src/main/java/com/eactive/ext/djb/ums/SwingReceiverDataVO.java b/src/main/java/com/eactive/ext/djb/ums/SwingReceiverDataVO.java new file mode 100644 index 0000000..293514c --- /dev/null +++ b/src/main/java/com/eactive/ext/djb/ums/SwingReceiverDataVO.java @@ -0,0 +1,22 @@ +package com.eactive.ext.djb.ums; + +import lombok.Data; + +@Data +public class SwingReceiverDataVO { + + /** 알림코드 */ + private String name; + + /** 알림제목 */ + private String type; + + /** 알림내용 */ + private String companyCode; + + /** 수신자정보 */ + private String code; + + /** 상품명 */ + private String prdNm; +} diff --git a/src/main/java/com/eactive/ext/kjb/common/KjbProperty.java b/src/main/java/com/eactive/ext/kjb/common/KjbProperty.java index ce2c61f..e86ae33 100644 --- a/src/main/java/com/eactive/ext/kjb/common/KjbProperty.java +++ b/src/main/java/com/eactive/ext/kjb/common/KjbProperty.java @@ -194,11 +194,23 @@ public class KjbProperty { // 제주은행 swing chat (messenger) - @KjbPropertyValue(key = "djb.swing.url", defaultValue = "http://172.31.35.144:9021") - @NotEmpty + + @KjbPropertyValue(key = "djb.swing.url", defaultValue = "http://127.0.0.1") private String swingUrl = ""; + @KjbPropertyValue(key = "djb.swing.was_ip_address", defaultValue = "http://127.0.0.1") + private String swingWasIpAddress = ""; + @KjbPropertyValue(key = "djb.swing.was_mac_address", defaultValue = "http://127.0.0.1") + private String swingMacIpAddress = ""; + + @KjbPropertyValue(key = "djb.swing.client_id", defaultValue = "12345") + private String swingClientId = ""; + + @KjbPropertyValue(key = "djb.swing.client_secret", defaultValue = "12345") + private String swingClientSecret = ""; + + From 6b49e518e5d1dda55d600ea3ba67b1d83d284ecf Mon Sep 17 00:00:00 2001 From: eastargh Date: Tue, 9 Jun 2026 15:39:39 +0900 Subject: [PATCH 4/4] =?UTF-8?q?UMS=EA=B4=80=EB=A0=A8=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DjbIncidentDetectionService.java | 41 ------------------- .../event/ApiStatusChangedEventHandler.java | 29 ------------- 2 files changed, 70 deletions(-) delete mode 100644 src/main/java/com/eactive/ext/djb/apistatus/DjbIncidentDetectionService.java delete mode 100644 src/main/java/com/eactive/ext/djb/apistatus/event/ApiStatusChangedEventHandler.java diff --git a/src/main/java/com/eactive/ext/djb/apistatus/DjbIncidentDetectionService.java b/src/main/java/com/eactive/ext/djb/apistatus/DjbIncidentDetectionService.java deleted file mode 100644 index 955d874..0000000 --- a/src/main/java/com/eactive/ext/djb/apistatus/DjbIncidentDetectionService.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.eactive.ext.djb.apistatus; - -import java.util.List; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -@Transactional -public class DjbIncidentDetectionService { - - private static final Logger log = LoggerFactory.getLogger(DjbIncidentDetectionService.class); - - /** - * 이벤트 감지 - * @param event "CONTROL_START" : 점검시작 - "CONTROL_END" : 점검종료 - "ERROR_START" : 장애시작 - "ERROR_END" : 장애종료 - "DELAY_START" : 지연시작 - "DELAY_END" : 지연종료 - * @param apiIds API IDs - */ - public void detect(String event, List apiIds) { - log.debug("이벤트 감지: {} {}", event, apiIds); - } - - // API FSM 내 아직 장애로 남아있는 API 목록 - public void remainDownApiIds() { - - } - - - // 정상 동작 - detect()에서 일괄 처리 (복구 = 점검종료, 장애종료, 지연종료) -// public void recovered(String event, String[] apiIds) { -// -// } - -} \ No newline at end of file diff --git a/src/main/java/com/eactive/ext/djb/apistatus/event/ApiStatusChangedEventHandler.java b/src/main/java/com/eactive/ext/djb/apistatus/event/ApiStatusChangedEventHandler.java deleted file mode 100644 index ed1260e..0000000 --- a/src/main/java/com/eactive/ext/djb/apistatus/event/ApiStatusChangedEventHandler.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.eactive.ext.djb.apistatus.event; - -import java.util.HashMap; -import java.util.Map; - -import org.springframework.stereotype.Component; - -import com.eactive.apim.portal.template.entity.MessageCode; -import com.eactive.apim.portal.template.service.MessageEventHandler; -import com.eactive.apim.portal.template.service.MessageRecipient; -import com.eactive.apim.portal.template.service.MessageSendEvent; - -@Component -public class ApiStatusChangedEventHandler implements MessageEventHandler { - - @Override - public MessageCode getKey() { return MessageCode.API_STATUS_CHANGED; } - - @Override - public MessageSendEvent createEvent(Object source, MessageRecipient recipient, Map params) { - Map p = new HashMap<>(); - params.forEach((k, v) -> p.put(k, v != null ? v.toString() : null)); - return new MessageSendEvent(source, getKey(), recipient, p); - } - - @Override public boolean allowAdditionalRecipients() { return true; } - @Override public String getDisplayName() { return "API 상태 변경"; } - @Override public String getDescription() { return "API 상태가 변경되었습니다"; } -}