Merge remote-tracking branch 'origin/jenkins_with_weblogic' of C:/eactive/workspaces/eapim-bundle/bundles/251021/eapim-admin_incremental_2025-09-12.bundle into jenkins_with_weblogic

This commit is contained in:
Rinjae
2025-10-21 13:19:14 +09:00
15 changed files with 2485 additions and 76 deletions
+4 -1
View File
@@ -239,4 +239,7 @@ gradle-app.setting
Doc/ Doc/
docs docs
build-gf63.sh build-gf63.sh
gradle-gf63.sh gradle-gf63.sh
eapim-admin-kjb/
+8 -14
View File
@@ -2,14 +2,11 @@
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<jta-data-source>jdbc/dsOBP_EMS</jta-data-source> <jta-data-source>jdbc/dsOBP_EMS</jta-data-source>
<properties> <properties>
<property name="hibernate.dialect" <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle12cDialect" />
value="org.hibernate.dialect.Oracle12cDialect" /> <property name="javax.persistence.validation.mode" value="NONE" />
<property name="javax.persistence.validation.mode" <property name="eclipselink.weaving.validation" value="false" />
value="NONE" />
<property name="eclipselink.weaving.validation" value="false" />
</properties> </properties>
<class>com.eactive.eai.rms.data.entity.onl.bzwkdstcd.UserBusiness <class>com.eactive.eai.rms.data.entity.onl.bzwkdstcd.UserBusiness</class>
</class>
<class>com.eactive.eai.data.entity.onl.unifbwk.UnifBwkTp</class> <class>com.eactive.eai.data.entity.onl.unifbwk.UnifBwkTp</class>
<exclude-unlisted-classes>false</exclude-unlisted-classes> <exclude-unlisted-classes>false</exclude-unlisted-classes>
</persistence-unit> </persistence-unit>
@@ -17,14 +14,11 @@
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<jta-data-source>jdbc/dsOBP_EMS</jta-data-source> <jta-data-source>jdbc/dsOBP_EMS</jta-data-source>
<properties> <properties>
<property name="hibernate.dialect" <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle12cDialect" />
value="org.hibernate.dialect.Oracle12cDialect" /> <property name="javax.persistence.validation.mode" value="NONE" />
<property name="javax.persistence.validation.mode" <property name="eclipselink.weaving.validation" value="false" />
value="NONE" />
<property name="eclipselink.weaving.validation" value="false" />
</properties> </properties>
<class>com.eactive.eai.rms.data.entity.onl.bzwkdstcd.UserBusiness <class>com.eactive.eai.rms.data.entity.onl.bzwkdstcd.UserBusiness</class>
</class>
<class>com.eactive.eai.data.entity.onl.unifbwk.UnifBwkTp</class> <class>com.eactive.eai.data.entity.onl.unifbwk.UnifBwkTp</class>
<exclude-unlisted-classes>false</exclude-unlisted-classes> <exclude-unlisted-classes>false</exclude-unlisted-classes>
</persistence-unit> </persistence-unit>
+5 -12
View File
@@ -41,9 +41,7 @@
</context:component-scan> </context:component-scan>
<!-- elink-common 적용 후 추가 --> <!-- elink-common 적용 후 추가 -->
<context:component-scan <context:component-scan base-package="com.eactive.eai.adapter.loader" />
base-package="com.eactive.eai.adapter.loader">
</context:component-scan>
<context:component-scan base-package="com.eactive.eai.common.b2badaptermapping.loader"/> <context:component-scan base-package="com.eactive.eai.common.b2badaptermapping.loader"/>
<context:component-scan base-package="com.eactive.eai.common.b2bextractor.loader"/> <context:component-scan base-package="com.eactive.eai.common.b2bextractor.loader"/>
<context:component-scan base-package="com.eactive.eai.common.b2bservice.loader"/> <context:component-scan base-package="com.eactive.eai.common.b2bservice.loader"/>
@@ -66,15 +64,10 @@
<context:component-scan base-package="com.eactive.eai.common.sysdomain.loader"/> <context:component-scan base-package="com.eactive.eai.common.sysdomain.loader"/>
<context:component-scan base-package="com.eactive.eai.common.unifbwk.loader"/> <context:component-scan base-package="com.eactive.eai.common.unifbwk.loader"/>
<context:component-scan base-package="com.eactive.eai.common.usedate.loader"/> <context:component-scan base-package="com.eactive.eai.common.usedate.loader"/>
<context:component-scan <context:component-scan base-package="com.eactive.eai.flowcontrol.jms.loader" />
base-package="com.eactive.eai.flowcontrol.jms.loader"> <context:component-scan base-package="com.eactive.eai.inbound.error.loader" />
</context:component-scan> <context:component-scan base-package="com.eactive.apim.portal" />
<context:component-scan
base-package="com.eactive.eai.inbound.error.loader">
</context:component-scan>
<context:component-scan
base-package="com.eactive.apim.portal">
</context:component-scan>
<bean id="cacheManager" <bean id="cacheManager"
class="org.springframework.cache.ehcache.EhCacheCacheManager"> class="org.springframework.cache.ehcache.EhCacheCacheManager">
+4 -4
View File
@@ -52,10 +52,10 @@
</bean> </bean>
<!-- <bean id="passwordEncoder"--> <!-- <bean id="passwordEncoder"-->
<!-- class="org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder" />--> <!-- class="org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder" />-->
<bean id="passwordEncoder" <bean id="passwordEncoder" class="org.springframework.security.crypto.password.StandardPasswordEncoder" />
class="org.springframework.security.crypto.password.StandardPasswordEncoder" />
<bean id="kjbSafedbPasswordEncoder" <!-- 광주은행 전용 PasswordEncoder -->
class="com.eactive.eai.custom.kjb.common.spring.KjbSafedbPasswordEncoder" /> <bean id="kjbSafedbPasswordEncoder" class="com.eactive.ext.kjb.spring.KjbSafedbPasswordEncoder" />
<import resource="applicationContext-datasource-${eai.datasource.type}.xml"/> <import resource="applicationContext-datasource-${eai.datasource.type}.xml"/>
<import resource="applicationContext-jdbc-${eai.datasource.type}.xml"/> <import resource="applicationContext-jdbc-${eai.datasource.type}.xml"/>
File diff suppressed because it is too large Load Diff
+1
View File
@@ -77,6 +77,7 @@ dependencies {
implementation project(':elink-online-emsclient') implementation project(':elink-online-emsclient')
implementation project(':elink-portal-common') implementation project(':elink-portal-common')
implementation project(':kjb-safedb') implementation project(':kjb-safedb')
implementation project(":eapim-admin-kjb")
/* Custom Libs */ /* Custom Libs */
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
+8
View File
@@ -64,3 +64,11 @@ gradle build -x test -Pprofile=weblogic
## 광주은행 참고 사항 ## 광주은행 참고 사항
### PORTAL Parameter ### PORTAL Parameter
- deploy.prod_use_proxy = N (개발/운영 망 간 연동 없음) - deploy.prod_use_proxy = N (개발/운영 망 간 연동 없음)
- kjb.ums.eai_batch.url : EAI 배치 서버 URL (이메일 발송 용도)
- 개발 : http://172.31.32.111:10230/BATAppWeb/EaiBatCall
- QA : http://172.31.33.111:10430/BATAppWeb/EaiBatCall
- 운영 : http://172.21.1.40:10860/BATAppWeb/EaiBatCall
- 입력하지 않을 경우 EAI 배치 호출을 하지 않고 내부적으로 통신하지 않고 정상 처리(log 내 warning 로그)
- kjb.ums.eai_batch.send_dir : EAI 배치 서버 파일 송신 디렉토리
- Default : /Data/eapim/portal/sendmail
+10 -7
View File
@@ -7,13 +7,16 @@ include 'elink-online-common'
include 'elink-online-emsclient' include 'elink-online-emsclient'
include 'elink-portal-common' include 'elink-portal-common'
project (':elink-online-core-jpa').projectDir = new File(settingsDir, "../eapim-online/elink-online-core-jpa") project(':elink-online-core-jpa').projectDir = new File(settingsDir, "../eapim-online/elink-online-core-jpa")
project (':elink-online-core').projectDir = new File(settingsDir, "../eapim-online/elink-online-core") project(':elink-online-core').projectDir = new File(settingsDir, "../eapim-online/elink-online-core")
project (':elink-online-transformer').projectDir = new File(settingsDir, "../eapim-online/elink-online-transformer") project(':elink-online-transformer').projectDir = new File(settingsDir, "../eapim-online/elink-online-transformer")
project (':elink-online-common').projectDir = new File(settingsDir, "../eapim-online/elink-online-common") project(':elink-online-common').projectDir = new File(settingsDir, "../eapim-online/elink-online-common")
project (':elink-online-emsclient').projectDir = new File(settingsDir, "../eapim-online/elink-online-emsclient") project(':elink-online-emsclient').projectDir = new File(settingsDir, "../eapim-online/elink-online-emsclient")
project (':elink-portal-common').projectDir = new File(settingsDir, "../elink-portal-common") project(':elink-portal-common').projectDir = new File(settingsDir, "../elink-portal-common")
include 'kjb-safedb' include 'kjb-safedb'
project (':kjb-safedb').projectDir = new File(settingsDir, "../kjb-safedb") project(':kjb-safedb').projectDir = new File(settingsDir, "../kjb-safedb")
include 'eapim-admin-kjb'
project(':eapim-admin-kjb').projectDir = new File(settingsDir, "eapim-admin-kjb")
@@ -71,6 +71,7 @@ public class MonitoringFrontFilter implements Filter {
|| uri.indexOf(request.getContextPath() +"/LoginServlet") > -1 || uri.indexOf(request.getContextPath() +"/LoginServlet") > -1
|| uri.indexOf(request.getContextPath() +"/login/") > -1 || uri.indexOf(request.getContextPath() +"/login/") > -1
|| uri.indexOf(request.getContextPath() +"/dashboard") > -1 || uri.indexOf(request.getContextPath() +"/dashboard") > -1
|| uri.indexOf(request.getContextPath() +"/dashmain3.do") > -1
|| uri.indexOf(request.getContextPath() + "/loginForm.do") > -1 || uri.indexOf(request.getContextPath() + "/loginForm.do") > -1
|| uri.indexOf(request.getContextPath() + "/login.do") > -1 || uri.indexOf(request.getContextPath() + "/login.do") > -1
|| uri.indexOf(request.getContextPath() + "/ssoLogin.do") > -1 || uri.indexOf(request.getContextPath() + "/ssoLogin.do") > -1
@@ -35,6 +35,20 @@ public class MonitoringPropertyService
return property.map(MonitoringProperty::getPrpty2Val).orElse(null); return property.map(MonitoringProperty::getPrpty2Val).orElse(null);
} }
public String getPropertyValue(String prptyGroupName, String prptyName, String defaultValue) {
MonitoringPropertyId id = new MonitoringPropertyId();
id.setPrptyGroupName(prptyGroupName);
id.setPrptyName(prptyName);
Optional<MonitoringProperty> property = repository.findById(id);
if (property.isPresent() && !property.get().getPrpty2Val().isEmpty()) {
return property.get().getPrpty2Val();
} else {
return defaultValue;
}
}
public Iterable<MonitoringProperty> findAllByIdPrptyName(String prptyName) { public Iterable<MonitoringProperty> findAllByIdPrptyName(String prptyName) {
BooleanExpression predicate = QMonitoringProperty.monitoringProperty.id.prptyName.eq(prptyName); BooleanExpression predicate = QMonitoringProperty.monitoringProperty.id.prptyName.eq(prptyName);
return repository.findAll(predicate); return repository.findAll(predicate);
@@ -7,6 +7,7 @@ import com.eactive.apim.portal.approval.entity.Approval;
import com.eactive.apim.portal.approval.service.ApprovalDeployException; import com.eactive.apim.portal.approval.service.ApprovalDeployException;
import com.eactive.apim.portal.approval.statemachine.listener.ApprovalListener; import com.eactive.apim.portal.approval.statemachine.listener.ApprovalListener;
import com.eactive.apim.portal.portalproperty.service.PortalPropertyService; import com.eactive.apim.portal.portalproperty.service.PortalPropertyService;
import com.eactive.apim.portal.template.entity.MessageCode;
import com.eactive.apim.portal.template.service.MessageRecipient; import com.eactive.apim.portal.template.service.MessageRecipient;
import com.eactive.apim.portal.template.service.MessageSendService; import com.eactive.apim.portal.template.service.MessageSendService;
import com.eactive.eai.agent.command.CommonCommand; import com.eactive.eai.agent.command.CommonCommand;
@@ -97,7 +98,6 @@ public class PortalAppApprovalListener implements ApprovalListener {
@Override @Override
public void execute(Approval approval, Map<String, Object> option1) throws ApprovalDeployException { public void execute(Approval approval, Map<String, Object> option1) throws ApprovalDeployException {
Optional<AppRequest> optRequest = appRequestRepository.findAppRequestByApproval(approval); Optional<AppRequest> optRequest = appRequestRepository.findAppRequestByApproval(approval);
AppRequest appRequest = optRequest.orElseGet(null); AppRequest appRequest = optRequest.orElseGet(null);
@@ -135,7 +135,8 @@ public class PortalAppApprovalListener implements ApprovalListener {
recipient.setUserId(appRequest.getApproval().getRequester().getEmailAddr()); recipient.setUserId(appRequest.getApproval().getRequester().getEmailAddr());
Map<String, String> params = new HashMap<>(); Map<String, String> params = new HashMap<>();
params.put("apiKey", appRequest.getClientName()); params.put("apiKey", appRequest.getClientName());
messageSendService.sendMessage("APP_REGISTER_APPROVED", recipient, params); // messageSendService.sendMessage("APP_REGISTER_APPROVED", recipient, params);
messageSendService.sendMessage(MessageCode.APP_REGISTER_APPROVED, recipient, params);
} }
private String determineAction(AppRequestType type) { private String determineAction(AppRequestType type) {
@@ -159,6 +160,7 @@ public class PortalAppApprovalListener implements ApprovalListener {
} }
private void syncTargetServer(String server, String action, CredentialUI credentialUI) throws ApprovalDeployException { private void syncTargetServer(String server, String action, CredentialUI credentialUI) throws ApprovalDeployException {
//TODO: Proxy 제거 작업 필요
// 프록시를 통한 스테이징 서버 호출 추가 // 프록시를 통한 스테이징 서버 호출 추가
Map<String, String> properties = portalPropertyService.getPortalPropertiesAsMap(PORTAL_PROPERTY_GROUP); Map<String, String> properties = portalPropertyService.getPortalPropertiesAsMap(PORTAL_PROPERTY_GROUP);
@@ -9,6 +9,7 @@ import com.eactive.apim.portal.portalorg.entity.PortalOrgEnums.OrgStatus;
import com.eactive.apim.portal.portalproperty.service.PortalPropertyService; import com.eactive.apim.portal.portalproperty.service.PortalPropertyService;
import com.eactive.apim.portal.portaluser.entity.PortalUser; import com.eactive.apim.portal.portaluser.entity.PortalUser;
import com.eactive.apim.portal.portaluser.entity.PortalUserEnums; import com.eactive.apim.portal.portaluser.entity.PortalUserEnums;
import com.eactive.apim.portal.template.entity.MessageCode;
import com.eactive.apim.portal.template.service.MessageRecipient; import com.eactive.apim.portal.template.service.MessageRecipient;
import com.eactive.apim.portal.template.service.MessageSendService; import com.eactive.apim.portal.template.service.MessageSendService;
import com.eactive.eai.rms.data.entity.onl.apim.portalorg.PortalOrgService; import com.eactive.eai.rms.data.entity.onl.apim.portalorg.PortalOrgService;
@@ -87,7 +88,7 @@ public class PortalUserApprovalListener implements ApprovalListener {
portalOrg.setOrgStatus(OrgStatus.ACTIVE); portalOrg.setOrgStatus(OrgStatus.ACTIVE);
portalOrgService.save(portalOrg); portalOrgService.save(portalOrg);
syncStaging(portalOrgUIMapper.toVo(portalOrg)); // syncStaging(portalOrgUIMapper.toVo(portalOrg));
sendApprovalResult(portalUser); sendApprovalResult(portalUser);
} }
@@ -96,42 +97,49 @@ public class PortalUserApprovalListener implements ApprovalListener {
recipient.setPhone(portalUser.getMobileNumber()); recipient.setPhone(portalUser.getMobileNumber());
recipient.setUserId(portalUser.getEmailAddr()); recipient.setUserId(portalUser.getEmailAddr());
Map<String, String> params = new HashMap<>(); Map<String, String> params = new HashMap<>();
messageSendService.sendMessage("USER_REGISTER_APPROVED", recipient, params); messageSendService.sendMessage(MessageCode.MANAGER_WITH_ORG_REGISTER_APPROVED, recipient, params);
} }
/**
* @deprecated 광주은행에서는 사용하지 않음. (개발/운영 완전 분리)
* @param portalOrgUI
* @throws ApprovalDeployException
*/
private void syncStaging(PortalOrgUI portalOrgUI) throws ApprovalDeployException { private void syncStaging(PortalOrgUI portalOrgUI) throws ApprovalDeployException {
// 프록시를 통한 스테이징 서버 호출 추가 throw new RuntimeException("Unable use this method(syncStaging())");
Map<String, String> properties = portalPropertyService.getPortalPropertiesAsMap(PORTAL_PROPERTY_GROUP);
String apiKey = properties.get("apiKey"); // // 프록시를 통한 스테이징 서버 호출 추가
String proxyUrl = properties.get("portal.url"); // Map<String, String> properties = portalPropertyService.getPortalPropertiesAsMap(PORTAL_PROPERTY_GROUP);
String timeout = properties.getOrDefault("deploy.proxy_timeout", "10000"); // String apiKey = properties.get("apiKey");
String proxyEndpoint = proxyUrl + "/_onl/apim/portalorg/portalOrgMan.json"; // String proxyUrl = properties.get("portal.url");
// String timeout = properties.getOrDefault("deploy.proxy_timeout", "10000");
HttpHeaders headers = new HttpHeaders(); // String proxyEndpoint = proxyUrl + "/_onl/apim/portalorg/portalOrgMan.json";
headers.setContentType(MediaType.APPLICATION_JSON); //
headers.set("X-API-KEY", apiKey); // HttpHeaders headers = new HttpHeaders();
headers.set("target_host", "stg"); // headers.setContentType(MediaType.APPLICATION_JSON);
headers.set("action", "insert"); // headers.set("X-API-KEY", apiKey);
// headers.set("target_host", "stg");
portalOrgUI.setCompRegFile(null); // headers.set("action", "insert");
HttpEntity<PortalOrgUI> request = new HttpEntity<>(portalOrgUI, headers); //
// portalOrgUI.setCompRegFile(null);
try { // HttpEntity<PortalOrgUI> request = new HttpEntity<>(portalOrgUI, headers);
ResponseEntity<String> response = createRestTemplateWithTimeout(Integer.parseInt(timeout)).exchange( //
proxyEndpoint, // try {
HttpMethod.POST, // ResponseEntity<String> response = createRestTemplateWithTimeout(Integer.parseInt(timeout)).exchange(
request, // proxyEndpoint,
String.class // HttpMethod.POST,
); // request,
// String.class
if (!response.getStatusCode().is2xxSuccessful()) { // );
logger.error("Failed to sync with staging server. Status: {}, Body: {}", response.getStatusCode(), response.getBody()); //
throw new ApprovalDeployException("기관 정보 배포에 실패 했습니다."); // if (!response.getStatusCode().is2xxSuccessful()) {
} // logger.error("Failed to sync with staging server. Status: {}, Body: {}", response.getStatusCode(), response.getBody());
} catch (Exception e) { // throw new ApprovalDeployException("기관 정보 배포에 실패 했습니다.");
logger.error("Failed to sync with staging server. {}", e.getMessage()); // }
throw new ApprovalDeployException("기관 정보 배포에 실패 했습니다."); // } catch (Exception e) {
} // logger.error("Failed to sync with staging server. {}", e.getMessage());
// throw new ApprovalDeployException("기관 정보 배포에 실패 했습니다.");
// }
} }
@Override @Override
@@ -1,6 +1,5 @@
package com.eactive.eai.rms.onl.apim.template; package com.eactive.eai.rms.onl.apim.template;
import com.eactive.apim.portal.template.entity.MessageCode;
import com.eactive.apim.portal.template.entity.MessageTemplate; import com.eactive.apim.portal.template.entity.MessageTemplate;
import com.eactive.eai.rms.common.base.BaseService; import com.eactive.eai.rms.common.base.BaseService;
import com.eactive.eai.rms.data.entity.onl.apim.template.MessageTemplateSearch; import com.eactive.eai.rms.data.entity.onl.apim.template.MessageTemplateSearch;
@@ -1,4 +1,4 @@
package com.eactive.eai.custom.kjb.common.spring; package com.eactive.ext.kjb.spring;
import com.eactive.ext.kjb.safedb.KjbSafedbWrapper; import com.eactive.ext.kjb.safedb.KjbSafedbWrapper;
import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder;
@@ -0,0 +1,125 @@
package com.eactive.ext.kjb.ums;
import com.eactive.apim.portal.template.entity.MessageRequest;
import com.eactive.eai.rms.common.base.BaseService;
import com.eactive.eai.rms.data.entity.man.monitoringProperty.service.MonitoringPropertyService;
import com.eactive.ext.kjb.common.KjbProperty;
import com.eactive.ext.kjb.safedb.KjbSafedbWrapper;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.UnsupportedEncodingException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
@Service
@Transactional(transactionManager = "transactionManagerForEMS")
@Slf4j
public class KjbUmsService extends BaseService {
public static final String PROP_GORUP_ID = "Monitoring";
public static final String PROP_EAI_BATCH_URL = "kjb.ums.eai_batch.url";
public static final String PROP_EAI_BATCH_SEND_DIR = "kjb.ums.eai_batch.send_dir";
private final KjbSafedbWrapper kjbSafedbWrapper;
private final KjbProperty prop;
@Autowired
public KjbUmsService(KjbSafedbWrapper kjbSafedbWrapper,
MonitoringPropertyService monitoringPropertyService) {
this.kjbSafedbWrapper = kjbSafedbWrapper;
KjbProperty prop = new KjbProperty();
prop.setEaiBatchUrl(monitoringPropertyService.getPropertyValue(PROP_GORUP_ID, PROP_EAI_BATCH_URL, ""));
prop.setEaiBatchSendDir(monitoringPropertyService.getPropertyValue(PROP_GORUP_ID, PROP_EAI_BATCH_SEND_DIR, "/Data/files/send"));
this.prop = prop;
}
public KjbUmsService(KjbSafedbWrapper kjbSafedbWrapper,
KjbProperty property) {
this.kjbSafedbWrapper = kjbSafedbWrapper;
this.prop = property;
init();
}
private void init() {
if (prop.getEaiBatchUrl().isEmpty()) {
log.warn("{} 가 설정되지 않음. 실제 EAI 배치 연동 없이 동작함", PROP_EAI_BATCH_URL);
}
log.info("EAI Batch URL: {}", prop.getEaiBatchUrl());
log.info("EAI Batch Send Dir: {}", prop.getEaiBatchSendDir());
// 디렉토리 검사(쓰기 권한 포함)
Path sendDirPath = Paths.get(prop.getEaiBatchSendDir());
if (!sendDirPath.toFile().exists()) {
// 생성 시도
boolean created = sendDirPath.toFile().mkdirs();
if (!created) {
log.error("EAI_BATCH_SEND_DIR 디렉토리를 생성할 수 없음: {}", prop.getEaiBatchSendDir());
throw new IllegalStateException("EAI_BATCH_SEND_DIR 디렉토리를 생성할 수 없음: " + prop.getEaiBatchSendDir());
}
}
if (!sendDirPath.toFile().isDirectory()) {
log.error("EAI_BATCH_SEND_DIR 가 디렉토리가 아님: {}", prop.getEaiBatchSendDir());
throw new IllegalStateException("EAI_BATCH_SEND_DIR 가 디렉토리가 아님: " + prop.getEaiBatchSendDir());
}
if (!sendDirPath.toFile().canWrite()) {
log.error("EAI_BATCH_SEND_DIR 에 쓰기 권한이 없음: {}", prop.getEaiBatchSendDir());
throw new IllegalStateException("EAI_BATCH_SEND_DIR 에 쓰기 권한이 없음: " + prop.getEaiBatchSendDir());
}
}
public void sendEmail(MessageRequest messageRequest) {
log.debug("sendEmail() called - EAI_BATCH_URL: {}, EAI_BATCH_SEND_DIR: {}", prop.getEaiBatchUrl(), prop.getEaiBatchSendDir());
log.debug("MessageRequest ID: {}, Email: {}", messageRequest.getId(), messageRequest.getEmail());
if (StringUtils.isEmpty(messageRequest.getId())) {
log.warn("MessageRequest ID is empty");
throw new IllegalArgumentException("MessageRequest ID is required");
}
if (StringUtils.isEmpty(messageRequest.getEmail())) {
log.warn("MessageRequest Email is empty for ID: {}", messageRequest.getId());
throw new IllegalArgumentException("MessageRequest Email is required for ID: " + messageRequest.getId());
}
String filename = "EMAIL_" + messageRequest.getId() + ".json";
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("EMAIL", kjbSafedbWrapper.encryptNotRnnoString(messageRequest.getEmail()));
Gson gson = new GsonBuilder().setPrettyPrinting().create();
String jsonString = gson.toJson(jsonObject);
byte[] jsonBytes = null;
try {
jsonBytes = jsonString.getBytes("euc-kr");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
log.debug("Generated JSON({} bytes): {}", jsonBytes.length, jsonString);
log.debug("euc-kr first 10 bytes: {}...", Arrays.toString(Arrays.copyOfRange(jsonBytes, 0, 10)));
}
}