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:
+4
-1
@@ -239,4 +239,7 @@ gradle-app.setting
|
||||
Doc/
|
||||
docs
|
||||
build-gf63.sh
|
||||
gradle-gf63.sh
|
||||
gradle-gf63.sh
|
||||
|
||||
|
||||
eapim-admin-kjb/
|
||||
@@ -2,14 +2,11 @@
|
||||
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
||||
<jta-data-source>jdbc/dsOBP_EMS</jta-data-source>
|
||||
<properties>
|
||||
<property name="hibernate.dialect"
|
||||
value="org.hibernate.dialect.Oracle12cDialect" />
|
||||
<property name="javax.persistence.validation.mode"
|
||||
value="NONE" />
|
||||
<property name="eclipselink.weaving.validation" value="false" />
|
||||
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle12cDialect" />
|
||||
<property name="javax.persistence.validation.mode" value="NONE" />
|
||||
<property name="eclipselink.weaving.validation" value="false" />
|
||||
</properties>
|
||||
<class>com.eactive.eai.rms.data.entity.onl.bzwkdstcd.UserBusiness
|
||||
</class>
|
||||
<class>com.eactive.eai.rms.data.entity.onl.bzwkdstcd.UserBusiness</class>
|
||||
<class>com.eactive.eai.data.entity.onl.unifbwk.UnifBwkTp</class>
|
||||
<exclude-unlisted-classes>false</exclude-unlisted-classes>
|
||||
</persistence-unit>
|
||||
@@ -17,14 +14,11 @@
|
||||
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
||||
<jta-data-source>jdbc/dsOBP_EMS</jta-data-source>
|
||||
<properties>
|
||||
<property name="hibernate.dialect"
|
||||
value="org.hibernate.dialect.Oracle12cDialect" />
|
||||
<property name="javax.persistence.validation.mode"
|
||||
value="NONE" />
|
||||
<property name="eclipselink.weaving.validation" value="false" />
|
||||
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle12cDialect" />
|
||||
<property name="javax.persistence.validation.mode" value="NONE" />
|
||||
<property name="eclipselink.weaving.validation" value="false" />
|
||||
</properties>
|
||||
<class>com.eactive.eai.rms.data.entity.onl.bzwkdstcd.UserBusiness
|
||||
</class>
|
||||
<class>com.eactive.eai.rms.data.entity.onl.bzwkdstcd.UserBusiness</class>
|
||||
<class>com.eactive.eai.data.entity.onl.unifbwk.UnifBwkTp</class>
|
||||
<exclude-unlisted-classes>false</exclude-unlisted-classes>
|
||||
</persistence-unit>
|
||||
@@ -41,9 +41,7 @@
|
||||
</context:component-scan>
|
||||
|
||||
<!-- elink-common 적용 후 추가 -->
|
||||
<context:component-scan
|
||||
base-package="com.eactive.eai.adapter.loader">
|
||||
</context:component-scan>
|
||||
<context:component-scan base-package="com.eactive.eai.adapter.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.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.unifbwk.loader"/>
|
||||
<context:component-scan base-package="com.eactive.eai.common.usedate.loader"/>
|
||||
<context:component-scan
|
||||
base-package="com.eactive.eai.flowcontrol.jms.loader">
|
||||
</context:component-scan>
|
||||
<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>
|
||||
<context:component-scan base-package="com.eactive.eai.flowcontrol.jms.loader" />
|
||||
<context:component-scan base-package="com.eactive.eai.inbound.error.loader" />
|
||||
<context:component-scan base-package="com.eactive.apim.portal" />
|
||||
|
||||
|
||||
<bean id="cacheManager"
|
||||
class="org.springframework.cache.ehcache.EhCacheCacheManager">
|
||||
|
||||
@@ -52,10 +52,10 @@
|
||||
</bean>
|
||||
<!-- <bean id="passwordEncoder"-->
|
||||
<!-- class="org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder" />-->
|
||||
<bean id="passwordEncoder"
|
||||
class="org.springframework.security.crypto.password.StandardPasswordEncoder" />
|
||||
<bean id="kjbSafedbPasswordEncoder"
|
||||
class="com.eactive.eai.custom.kjb.common.spring.KjbSafedbPasswordEncoder" />
|
||||
<bean id="passwordEncoder" class="org.springframework.security.crypto.password.StandardPasswordEncoder" />
|
||||
|
||||
<!-- 광주은행 전용 PasswordEncoder -->
|
||||
<bean id="kjbSafedbPasswordEncoder" class="com.eactive.ext.kjb.spring.KjbSafedbPasswordEncoder" />
|
||||
|
||||
<import resource="applicationContext-datasource-${eai.datasource.type}.xml"/>
|
||||
<import resource="applicationContext-jdbc-${eai.datasource.type}.xml"/>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -77,6 +77,7 @@ dependencies {
|
||||
implementation project(':elink-online-emsclient')
|
||||
implementation project(':elink-portal-common')
|
||||
implementation project(':kjb-safedb')
|
||||
implementation project(":eapim-admin-kjb")
|
||||
|
||||
/* Custom Libs */
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
@@ -64,3 +64,11 @@ gradle build -x test -Pprofile=weblogic
|
||||
## 광주은행 참고 사항
|
||||
### PORTAL Parameter
|
||||
- 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
@@ -7,13 +7,16 @@ include 'elink-online-common'
|
||||
include 'elink-online-emsclient'
|
||||
include 'elink-portal-common'
|
||||
|
||||
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-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-emsclient').projectDir = new File(settingsDir, "../eapim-online/elink-online-emsclient")
|
||||
project (':elink-portal-common').projectDir = new File(settingsDir, "../elink-portal-common")
|
||||
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-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-emsclient').projectDir = new File(settingsDir, "../eapim-online/elink-online-emsclient")
|
||||
project(':elink-portal-common').projectDir = new File(settingsDir, "../elink-portal-common")
|
||||
|
||||
|
||||
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() +"/login/") > -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() + "/login.do") > -1
|
||||
|| uri.indexOf(request.getContextPath() + "/ssoLogin.do") > -1
|
||||
|
||||
+14
@@ -35,6 +35,20 @@ public class MonitoringPropertyService
|
||||
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) {
|
||||
BooleanExpression predicate = QMonitoringProperty.monitoringProperty.id.prptyName.eq(prptyName);
|
||||
return repository.findAll(predicate);
|
||||
|
||||
+4
-2
@@ -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.statemachine.listener.ApprovalListener;
|
||||
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.MessageSendService;
|
||||
import com.eactive.eai.agent.command.CommonCommand;
|
||||
@@ -97,7 +98,6 @@ public class PortalAppApprovalListener implements ApprovalListener {
|
||||
|
||||
@Override
|
||||
public void execute(Approval approval, Map<String, Object> option1) throws ApprovalDeployException {
|
||||
|
||||
Optional<AppRequest> optRequest = appRequestRepository.findAppRequestByApproval(approval);
|
||||
|
||||
AppRequest appRequest = optRequest.orElseGet(null);
|
||||
@@ -135,7 +135,8 @@ public class PortalAppApprovalListener implements ApprovalListener {
|
||||
recipient.setUserId(appRequest.getApproval().getRequester().getEmailAddr());
|
||||
Map<String, String> params = new HashMap<>();
|
||||
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) {
|
||||
@@ -159,6 +160,7 @@ public class PortalAppApprovalListener implements ApprovalListener {
|
||||
}
|
||||
|
||||
private void syncTargetServer(String server, String action, CredentialUI credentialUI) throws ApprovalDeployException {
|
||||
//TODO: Proxy 제거 작업 필요
|
||||
|
||||
// 프록시를 통한 스테이징 서버 호출 추가
|
||||
Map<String, String> properties = portalPropertyService.getPortalPropertiesAsMap(PORTAL_PROPERTY_GROUP);
|
||||
|
||||
+42
-34
@@ -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.portaluser.entity.PortalUser;
|
||||
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.MessageSendService;
|
||||
import com.eactive.eai.rms.data.entity.onl.apim.portalorg.PortalOrgService;
|
||||
@@ -87,7 +88,7 @@ public class PortalUserApprovalListener implements ApprovalListener {
|
||||
portalOrg.setOrgStatus(OrgStatus.ACTIVE);
|
||||
portalOrgService.save(portalOrg);
|
||||
|
||||
syncStaging(portalOrgUIMapper.toVo(portalOrg));
|
||||
// syncStaging(portalOrgUIMapper.toVo(portalOrg));
|
||||
sendApprovalResult(portalUser);
|
||||
}
|
||||
|
||||
@@ -96,42 +97,49 @@ public class PortalUserApprovalListener implements ApprovalListener {
|
||||
recipient.setPhone(portalUser.getMobileNumber());
|
||||
recipient.setUserId(portalUser.getEmailAddr());
|
||||
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 {
|
||||
// 프록시를 통한 스테이징 서버 호출 추가
|
||||
Map<String, String> properties = portalPropertyService.getPortalPropertiesAsMap(PORTAL_PROPERTY_GROUP);
|
||||
String apiKey = properties.get("apiKey");
|
||||
String proxyUrl = properties.get("portal.url");
|
||||
String timeout = properties.getOrDefault("deploy.proxy_timeout", "10000");
|
||||
String proxyEndpoint = proxyUrl + "/_onl/apim/portalorg/portalOrgMan.json";
|
||||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
headers.set("X-API-KEY", apiKey);
|
||||
headers.set("target_host", "stg");
|
||||
headers.set("action", "insert");
|
||||
|
||||
portalOrgUI.setCompRegFile(null);
|
||||
HttpEntity<PortalOrgUI> request = new HttpEntity<>(portalOrgUI, headers);
|
||||
|
||||
try {
|
||||
ResponseEntity<String> response = createRestTemplateWithTimeout(Integer.parseInt(timeout)).exchange(
|
||||
proxyEndpoint,
|
||||
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("기관 정보 배포에 실패 했습니다.");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("Failed to sync with staging server. {}", e.getMessage());
|
||||
throw new 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");
|
||||
// String timeout = properties.getOrDefault("deploy.proxy_timeout", "10000");
|
||||
// String proxyEndpoint = proxyUrl + "/_onl/apim/portalorg/portalOrgMan.json";
|
||||
//
|
||||
// HttpHeaders headers = new HttpHeaders();
|
||||
// headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
// headers.set("X-API-KEY", apiKey);
|
||||
// headers.set("target_host", "stg");
|
||||
// headers.set("action", "insert");
|
||||
//
|
||||
// portalOrgUI.setCompRegFile(null);
|
||||
// HttpEntity<PortalOrgUI> request = new HttpEntity<>(portalOrgUI, headers);
|
||||
//
|
||||
// try {
|
||||
// ResponseEntity<String> response = createRestTemplateWithTimeout(Integer.parseInt(timeout)).exchange(
|
||||
// proxyEndpoint,
|
||||
// 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("기관 정보 배포에 실패 했습니다.");
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// logger.error("Failed to sync with staging server. {}", e.getMessage());
|
||||
// throw new ApprovalDeployException("기관 정보 배포에 실패 했습니다.");
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
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.eai.rms.common.base.BaseService;
|
||||
import com.eactive.eai.rms.data.entity.onl.apim.template.MessageTemplateSearch;
|
||||
|
||||
+1
-1
@@ -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 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)));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user