Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fc70560f05 |
@@ -1,140 +0,0 @@
|
|||||||
name: eapim-admin CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
- develop
|
|
||||||
- stage
|
|
||||||
- feats/ci-test
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: [self-hosted, linux, eapim-admin]
|
|
||||||
env:
|
|
||||||
JAVA_HOME: /apps/opts/jdk8
|
|
||||||
JAVA_HOME_TOMCAT: /apps/opts/jdk17
|
|
||||||
CATALINA_BASE: /prod/eapim/adminportal
|
|
||||||
CATALINA_HOME: /prod/eapim/apache-tomcat-9.0.116
|
|
||||||
CATALINA_PID: /prod/eapim/adminportal/temp/catalina.pid
|
|
||||||
DEPLOY_HTTP_PORT: "39120"
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
working-directory: eapim-admin
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout eapim-admin (trigger SHA)
|
|
||||||
uses: http://172.30.1.50:3000/actions/checkout@v4
|
|
||||||
with:
|
|
||||||
path: eapim-admin
|
|
||||||
|
|
||||||
- name: Checkout sibling modules (master)
|
|
||||||
working-directory: ${{ github.workspace }}
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
mkdir -p eapim-online
|
|
||||||
|
|
||||||
# eapim-online/* — 5 modules referenced from settings.gradle
|
|
||||||
for REPO in elink-online-core elink-online-core-jpa elink-online-transformer elink-online-common elink-online-emsclient; do
|
|
||||||
rm -rf "eapim-online/$REPO"
|
|
||||||
git clone --depth=1 --branch master \
|
|
||||||
http://oauth2:${{ secrets.CI_TOKEN }}@172.30.1.50:3000/djb-eapim/$REPO.git \
|
|
||||||
"eapim-online/$REPO"
|
|
||||||
done
|
|
||||||
|
|
||||||
# standalone siblings
|
|
||||||
for REPO in elink-portal-common eapim-admin-djb; do
|
|
||||||
rm -rf "$REPO"
|
|
||||||
git clone --depth=1 --branch master \
|
|
||||||
http://oauth2:${{ secrets.CI_TOKEN }}@172.30.1.50:3000/djb-eapim/$REPO.git \
|
|
||||||
"$REPO"
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: Verify toolchain
|
|
||||||
run: |
|
|
||||||
java -version
|
|
||||||
gradle --version
|
|
||||||
|
|
||||||
- name: Gradle build (no tests)
|
|
||||||
run: gradle clean build -x test --no-daemon
|
|
||||||
|
|
||||||
- name: Upload WAR artifact
|
|
||||||
uses: http://172.30.1.50:3000/actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: eapim-admin-war-${{ github.sha }}
|
|
||||||
path: eapim-admin/build/libs/eapim-admin.war
|
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
- name: Stop tomcat (pre-clean)
|
|
||||||
working-directory: ${{ github.workspace }}
|
|
||||||
run: |
|
|
||||||
# 1) systemd 관리 인스턴스 정지 (이번 워크플로가 띄운 것)
|
|
||||||
systemctl --user stop eapim-admin 2>/dev/null || true
|
|
||||||
|
|
||||||
# 2) systemd 외부 detached 인스턴스 정리
|
|
||||||
if [ -f "$CATALINA_PID" ] && kill -0 "$(cat $CATALINA_PID)" 2>/dev/null; then
|
|
||||||
JAVA_HOME=$JAVA_HOME_TOMCAT "$CATALINA_HOME/bin/shutdown.sh" 30 -force || true
|
|
||||||
for i in $(seq 1 30); do
|
|
||||||
[ -f "$CATALINA_PID" ] && kill -0 "$(cat $CATALINA_PID)" 2>/dev/null || break
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
rm -f "$CATALINA_PID"
|
|
||||||
|
|
||||||
- name: Deploy war as /monitoring
|
|
||||||
working-directory: ${{ github.workspace }}
|
|
||||||
run: |
|
|
||||||
DEPLOY_DIR="$CATALINA_BASE/webapps"
|
|
||||||
rm -rf "$DEPLOY_DIR/monitoring" "$DEPLOY_DIR/monitoring.war"
|
|
||||||
cp eapim-admin/build/libs/eapim-admin.war "$DEPLOY_DIR/monitoring.war"
|
|
||||||
ls -la "$DEPLOY_DIR"
|
|
||||||
|
|
||||||
- name: Start tomcat and readiness probe (timeout 300s)
|
|
||||||
working-directory: ${{ github.workspace }}
|
|
||||||
run: |
|
|
||||||
LOG="$CATALINA_BASE/logs/catalina.$(date +%Y-%m-%d).log"
|
|
||||||
BEFORE=0
|
|
||||||
[ -f "$LOG" ] && BEFORE=$(stat -c %s "$LOG")
|
|
||||||
|
|
||||||
# systemd 가 Tomcat 을 새 cgroup 으로 띄움 — runner step 종료와 무관하게 살아남음
|
|
||||||
systemctl --user start eapim-admin
|
|
||||||
|
|
||||||
# /loginForm.do 는 GET 매핑(MainController#loginForm) → tomcat·webapp 양쪽 살아있으면 200
|
|
||||||
# /login.do 는 POST 처리 — GET 으로 probe 시 405/잘못된 응답 가능성 있어 회피
|
|
||||||
PROBE_URL="http://localhost:$DEPLOY_HTTP_PORT/monitoring/loginForm.do"
|
|
||||||
DEADLINE=$(($(date +%s) + 300))
|
|
||||||
STATUS=000
|
|
||||||
while [ $(date +%s) -lt $DEADLINE ]; do
|
|
||||||
STATUS=$(curl -sS -o /dev/null -w '%{http_code}' --max-time 3 \
|
|
||||||
"$PROBE_URL" 2>/dev/null || echo "000")
|
|
||||||
case "$STATUS" in
|
|
||||||
200|302|401)
|
|
||||||
echo "Readiness OK ($PROBE_URL HTTP $STATUS)"
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -f "$LOG" ] && tail -c +$((BEFORE+1)) "$LOG" | grep -qE "Application listener .* Exception|SEVERE.*startup.Catalina"; then
|
|
||||||
echo "::error::Startup error detected in log"
|
|
||||||
tail -c +$((BEFORE+1)) "$LOG" | tail -80
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
sleep 2
|
|
||||||
done
|
|
||||||
|
|
||||||
case "$STATUS" in
|
|
||||||
200|302|401) ;;
|
|
||||||
*)
|
|
||||||
echo "::error::Readiness probe failed within 300s (last HTTP status: $STATUS)"
|
|
||||||
echo "--- last 300 lines of catalina log ---"
|
|
||||||
[ -f "$LOG" ] && tail -c +$((BEFORE+1)) "$LOG" | tail -300
|
|
||||||
echo "--- systemd unit status ---"
|
|
||||||
systemctl --user status eapim-admin --no-pager || true
|
|
||||||
echo "--- listening ports ---"
|
|
||||||
ss -tlnp 2>/dev/null | grep -E ":$DEPLOY_HTTP_PORT\b" || echo "(port $DEPLOY_HTTP_PORT 미점유)"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
echo "--- key boot log lines ---"
|
|
||||||
tail -c +$((BEFORE+1)) "$LOG" | grep -E "Server startup|Deployment of web" | head -10 || true
|
|
||||||
@@ -115,7 +115,7 @@
|
|||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="ioAcceptor" class="com.eactive.eai.rms.onl.server.UdpServer" init-method="init" destroy-method="destory">
|
<bean id="ioAcceptor" class="com.eactive.eai.rms.onl.server.UdpServer" init-method="init" destroy-method="destory">
|
||||||
<property name="port" value="39126" />
|
<property name="port" value="10800" />
|
||||||
<property name="handler" ref="handler"/>
|
<property name="handler" ref="handler"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
|||||||
@@ -353,10 +353,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- SSO 로그인 버튼 (비상모드 시 숨김) -->
|
<!-- SSO 로그인 버튼 (비상모드 시 숨김) -->
|
||||||
<c:if test="${not emergencyMode}">
|
<c:if test="${not emergencyMode}">
|
||||||
<!-- <div class="form-group">
|
<div class="form-group">
|
||||||
<input type="button" id="btn_sso_login" class="form-control btn btn-success rounded submit px-3"
|
<input type="button" id="btn_sso_login" class="form-control btn btn-success rounded submit px-3"
|
||||||
value="SSO Login">
|
value="SSO Login">
|
||||||
</div> -->
|
</div>
|
||||||
</c:if>
|
</c:if>
|
||||||
<p style="color:red;"><%=resultMsg %></p>
|
<p style="color:red;"><%=resultMsg %></p>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -551,9 +551,9 @@
|
|||||||
</h1><!-- /monitoring/images/top_logo.png -->
|
</h1><!-- /monitoring/images/top_logo.png -->
|
||||||
<div class="topmenu_box">
|
<div class="topmenu_box">
|
||||||
<ul>
|
<ul>
|
||||||
<li style="width:240px;" id="newDashboardShow">
|
<li style="width:240px;" id="newDashboardShow">
|
||||||
<a style="width:240px;"
|
<a style="width:240px;"
|
||||||
href="#"><span><%=SessionManager.getUserName(request) %>(<%=SessionManager.getUserId(request) %>-<%=System.getProperty("inst.Name") %>)</span>
|
href="#"><span><%=SessionManager.getUserName(request) %>(<%=SessionManager.getUserId(request) %>)</span>
|
||||||
<span onClick="javascript:openColorPopup();"><%=localeMessage.getString("screen.customer") %></span>
|
<span onClick="javascript:openColorPopup();"><%=localeMessage.getString("screen.customer") %></span>
|
||||||
<% if (!"".equals(LastLoginYms.trim())) { %>
|
<% if (!"".equals(LastLoginYms.trim())) { %>
|
||||||
<span style="display:block;font-size:10px;"><%=localeMessage.getString("screen.lastLogin") %> : <%=LastLoginYms%> [ <%=LastLoginIp%> ]</span>
|
<span style="display:block;font-size:10px;"><%=localeMessage.getString("screen.lastLogin") %> : <%=LastLoginYms%> [ <%=LastLoginIp%> ]</span>
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
, {id:'LLLVAR',name:'[ISO8583] LLLVAR'}, {id:'LLLLVAR',name:'[ISO8583] LLLLVAR'}, {id:'BINARY',name:'[ISO8583] BINARY'}, {id:'LLBIN',name:'[ISO8583] LLBIN'}
|
, {id:'LLLVAR',name:'[ISO8583] LLLVAR'}, {id:'LLLLVAR',name:'[ISO8583] LLLLVAR'}, {id:'BINARY',name:'[ISO8583] BINARY'}, {id:'LLBIN',name:'[ISO8583] LLBIN'}
|
||||||
, {id:'LLLBIN',name:'[ISO8583] LLLBIN'}];
|
, {id:'LLLBIN',name:'[ISO8583] LLLBIN'}];
|
||||||
|
|
||||||
const basicDataTypes = [{id:'BigDecimal',name:'BigDecimal'},{id:'String',name:'String'},{id:'Boolean',name:'Boolean'}];
|
const basicDataTypes = [{id:'BigDecimal',name:'BigDecimal'},{id:'String',name:'String'}];
|
||||||
|
|
||||||
function gridRenderingInit() {
|
function gridRenderingInit() {
|
||||||
$('#effectGrid').jqGrid({
|
$('#effectGrid').jqGrid({
|
||||||
|
|||||||
@@ -44,16 +44,14 @@
|
|||||||
'<%=localeMessage.getString("stdDefaultMan.columDesc")%>',
|
'<%=localeMessage.getString("stdDefaultMan.columDesc")%>',
|
||||||
'<%=localeMessage.getString("stdDefaultMan.columLen")%>',
|
'<%=localeMessage.getString("stdDefaultMan.columLen")%>',
|
||||||
'<%=localeMessage.getString("stdDefaultMan.keyOr")%>',
|
'<%=localeMessage.getString("stdDefaultMan.keyOr")%>',
|
||||||
'<%=localeMessage.getString("stdDefaultMan.ifOr")%>',
|
'<%=localeMessage.getString("stdDefaultMan.ifOr")%>'
|
||||||
'<%=localeMessage.getString("stdDefaultMan.orderSeq")%>'
|
|
||||||
],
|
],
|
||||||
colModel:[
|
colModel:[
|
||||||
{ name : 'COLUMNNAME' , align:'left' , width: '200px', sortable:false },
|
{ name : 'COLUMNNAME' , align:'left' , sortable:false },
|
||||||
{ name : 'COLUMNDESC' , align:'left' , width: '200px' },
|
{ name : 'COLUMNDESC' , align:'left' },
|
||||||
{ name : 'COLUMNLENGTH' , align:'center' , width: '100px' },
|
{ name : 'COLUMNLENGTH' , align:'right' },
|
||||||
{ name : 'ISKEY' , align:'center', width: '100px' },
|
{ name : 'ISKEY' , align:'center' },
|
||||||
{ name : 'ISINTERFACE' , align:'center', width: '100px' },
|
{ name : 'ISINTERFACE' , align:'center' }
|
||||||
{ name : 'ORDERSEQ' , align:'center', width: '100px' }
|
|
||||||
],
|
],
|
||||||
jsonReader: {
|
jsonReader: {
|
||||||
repeatitems:false
|
repeatitems:false
|
||||||
|
|||||||
@@ -1686,7 +1686,7 @@
|
|||||||
<option value="none" selected>NONE</option>
|
<option value="none" selected>NONE</option>
|
||||||
<option value="oauth">OAUTH</option>
|
<option value="oauth">OAUTH</option>
|
||||||
<option value="api_key">API_KEY</option>
|
<option value="api_key">API_KEY</option>
|
||||||
<!-- <option value="ca">CA</option> -->
|
<option value="ca">CA</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,51 +0,0 @@
|
|||||||
# DJBank EAPIM Admin — user-scope systemd unit
|
|
||||||
#
|
|
||||||
# Install (one-time, on the host as `djb`):
|
|
||||||
# sudo loginctl enable-linger djb # allow services to outlive ssh logout
|
|
||||||
# mkdir -p ~/.config/systemd/user
|
|
||||||
# # workflow copies this file in on each deploy; for first boot you can also do:
|
|
||||||
# # cp /prod/.../deploy/systemd/eapim-admin.service ~/.config/systemd/user/
|
|
||||||
# systemctl --user daemon-reload
|
|
||||||
# systemctl --user enable eapim-admin
|
|
||||||
# systemctl --user start eapim-admin
|
|
||||||
#
|
|
||||||
# Why this exists:
|
|
||||||
# - `catalina.sh start` + `nohup &` does NOT escape the Gitea Actions runner
|
|
||||||
# process group. When the workflow step finishes, the runner sends SIGTERM
|
|
||||||
# to the process tree and Tomcat dies seconds after boot.
|
|
||||||
# - Running Tomcat as a systemd user service detaches lifecycle from the
|
|
||||||
# runner entirely. The workflow just calls `systemctl --user restart` and
|
|
||||||
# systemd owns the process.
|
|
||||||
|
|
||||||
[Unit]
|
|
||||||
Description=DJBank EAPIM Admin (Tomcat 9)
|
|
||||||
After=network-online.target
|
|
||||||
Wants=network-online.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
|
|
||||||
Environment=JAVA_HOME=/apps/opts/jdk17
|
|
||||||
Environment=CATALINA_BASE=/prod/eapim/adminportal
|
|
||||||
Environment=CATALINA_HOME=/prod/eapim/apache-tomcat-9.0.116
|
|
||||||
Environment=CATALINA_PID=/prod/eapim/adminportal/temp/catalina.pid
|
|
||||||
|
|
||||||
# `catalina.sh run` keeps Tomcat in the foreground so systemd can supervise it.
|
|
||||||
ExecStart=/prod/eapim/apache-tomcat-9.0.116/bin/catalina.sh run
|
|
||||||
|
|
||||||
# Graceful shutdown via Tomcat's shutdown port, 30s window.
|
|
||||||
ExecStop=/prod/eapim/apache-tomcat-9.0.116/bin/catalina.sh stop 30
|
|
||||||
|
|
||||||
# Tomcat returns 143 on SIGTERM during normal stop — treat as success.
|
|
||||||
SuccessExitStatus=143
|
|
||||||
TimeoutStartSec=180
|
|
||||||
TimeoutStopSec=60
|
|
||||||
|
|
||||||
Restart=on-failure
|
|
||||||
RestartSec=10
|
|
||||||
|
|
||||||
# Memory / fd limits — adjust as needed.
|
|
||||||
LimitNOFILE=65535
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=default.target
|
|
||||||
@@ -35,7 +35,6 @@ public class MonitoringPropertyManService extends BaseService {
|
|||||||
|
|
||||||
public MonitoringPropertyGroupUI selectDetail(String prptyGroupName) {
|
public MonitoringPropertyGroupUI selectDetail(String prptyGroupName) {
|
||||||
MonitoringPropertyGroup propertyGroup = propertyGroupService.getById(prptyGroupName);
|
MonitoringPropertyGroup propertyGroup = propertyGroupService.getById(prptyGroupName);
|
||||||
propertyGroup.getMonitoringProperties().sort(Comparator.comparing(p -> p.getId().getPrptyName()));
|
|
||||||
return propertyGroupMapper.toVo(propertyGroup);
|
return propertyGroupMapper.toVo(propertyGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-8
@@ -5,9 +5,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.PageRequest;
|
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.data.domain.Sort;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@@ -44,12 +42,7 @@ public class ExtendedColumnDefinitionService
|
|||||||
predicate = predicate.and(qExtendedColumnDefinition.columnDesc.containsIgnoreCase(searchColumnDesc));
|
predicate = predicate.and(qExtendedColumnDefinition.columnDesc.containsIgnoreCase(searchColumnDesc));
|
||||||
}
|
}
|
||||||
|
|
||||||
Pageable orderedPageable = PageRequest.of(
|
return repository.findAll(predicate, pageable);
|
||||||
pageable.getPageNumber(),
|
|
||||||
pageable.getPageSize(),
|
|
||||||
Sort.by(Sort.Order.asc("orderSeq"), Sort.Order.asc("columnName")));
|
|
||||||
|
|
||||||
return repository.findAll(predicate, orderedPageable);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import com.eactive.apim.portal.template.entity.MessageCode;
|
|||||||
import com.eactive.eai.rms.data.entity.man.role.Role;
|
import com.eactive.eai.rms.data.entity.man.role.Role;
|
||||||
import com.eactive.eai.rms.data.entity.onl.djb.apistatus.ApiStatus;
|
import com.eactive.eai.rms.data.entity.onl.djb.apistatus.ApiStatus;
|
||||||
import com.eactive.eai.rms.data.entity.onl.djb.apistatus.ApiStatusEvent;
|
import com.eactive.eai.rms.data.entity.onl.djb.apistatus.ApiStatusEvent;
|
||||||
import com.eactive.eai.rms.ext.djb.ums.UmsManager;
|
import com.eactive.eai.rms.ext.djb.util.UmsManager;
|
||||||
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import com.eactive.apim.portal.template.entity.MessageCode;
|
import com.eactive.apim.portal.template.entity.MessageCode;
|
||||||
import com.eactive.eai.rms.data.entity.man.role.Role;
|
import com.eactive.eai.rms.data.entity.man.role.Role;
|
||||||
import com.eactive.eai.rms.data.entity.onl.djb.inflow.InflowTokenInsufficient;
|
import com.eactive.eai.rms.data.entity.onl.djb.inflow.InflowTokenInsufficient;
|
||||||
import com.eactive.eai.rms.ext.djb.ums.UmsManager;
|
import com.eactive.eai.rms.ext.djb.util.UmsManager;
|
||||||
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
|||||||
@@ -1,43 +0,0 @@
|
|||||||
package com.eactive.eai.rms.ext.djb.ums.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 boolean allowAdditionalRecipients() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getDisplayName() {
|
|
||||||
return "API 상태 변화";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getDescription() {
|
|
||||||
return "<div>사용 가능 변수: </div><br/>"
|
|
||||||
+ "<div> - message 알림 메시지 </div><br/>";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public MessageSendEvent createEvent(Object source, MessageRecipient recipient, Map<String, Object> params) {
|
|
||||||
Map<String, String> eventParams = new HashMap<>();
|
|
||||||
eventParams.put("message", (String) params.get("message"));
|
|
||||||
return new MessageSendEvent(source, MessageCode.API_STATUS_CHANGED, recipient, eventParams);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-43
@@ -1,43 +0,0 @@
|
|||||||
package com.eactive.eai.rms.ext.djb.ums.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 InflowTokenFailedEventHandler implements MessageEventHandler {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public MessageCode getKey() {
|
|
||||||
return MessageCode.INFLOW_TOKEN_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean allowAdditionalRecipients() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getDisplayName() {
|
|
||||||
return "유량제어 토큰 획득 실패";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getDescription() {
|
|
||||||
return "<div>사용 가능 변수: </div><br/>"
|
|
||||||
+ "<div> - message 알림 메시지 </div><br/>";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public MessageSendEvent createEvent(Object source, MessageRecipient recipient, Map<String, Object> params) {
|
|
||||||
Map<String, String> eventParams = new HashMap<>();
|
|
||||||
eventParams.put("message", (String) params.get("message"));
|
|
||||||
return new MessageSendEvent(source, MessageCode.INFLOW_TOKEN_FAILED, recipient, eventParams);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,344 +0,0 @@
|
|||||||
package com.eactive.eai.rms.ext.djb.ums.service;
|
|
||||||
|
|
||||||
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.Map;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import com.eactive.apim.portal.portalproperty.service.PortalPropertyService;
|
|
||||||
import com.eactive.apim.portal.template.entity.MessageRequest;
|
|
||||||
import com.eactive.eai.common.util.SystemUtil;
|
|
||||||
import com.eactive.eai.rms.data.entity.man.monitoringProperty.service.MonitoringPropertyService;
|
|
||||||
import com.eactive.eai.rms.ext.djb.ums.vo.EmailDataVO;
|
|
||||||
import com.eactive.eai.rms.ext.djb.ums.vo.SmsDataVO;
|
|
||||||
import com.eactive.eai.rms.ext.djb.ums.vo.StdHeadVO;
|
|
||||||
import com.eactive.eai.rms.ext.djb.ums.vo.SwingCommonVO;
|
|
||||||
import com.eactive.eai.rms.ext.djb.ums.vo.SwingDataVO;
|
|
||||||
import com.eactive.eai.rms.ext.djb.ums.vo.SwingReceiverDataVO;
|
|
||||||
import com.google.gson.Gson;
|
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
public class UmsService {
|
|
||||||
|
|
||||||
private static final Gson gson = new Gson();
|
|
||||||
|
|
||||||
private static final String SYS_DVCD = "OPA";
|
|
||||||
private final MonitoringPropertyService propertyService;
|
|
||||||
|
|
||||||
public UmsService(MonitoringPropertyService propertyService) {
|
|
||||||
this.propertyService = propertyService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean send(MessageRequest messageRequest) throws Exception {
|
|
||||||
if (messageRequest == null) {
|
|
||||||
throw new IllegalArgumentException("messageRequest is null");
|
|
||||||
}
|
|
||||||
|
|
||||||
this.httpConnection(messageRequest);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void httpConnection(MessageRequest messageRequest) throws Exception {
|
|
||||||
HttpURLConnection conn = null;
|
|
||||||
BufferedReader br = null;
|
|
||||||
log.debug("<<<HTTP Connection>>>:" + messageRequest.toString());
|
|
||||||
try {
|
|
||||||
String host = propertyService.getPropertyValue("Monitoring", "djb.ums."+messageRequest.getMessageType().toLowerCase()+".url", "");
|
|
||||||
|
|
||||||
URL url = new URL(host);
|
|
||||||
int timeoutValue = 5 * 1000; // 타임아웃 설정을 위한 값 (단위: ms)
|
|
||||||
// Charset charset = Charset.forName("UTF-8");
|
|
||||||
Charset charset = Charset.forName("MS949");
|
|
||||||
|
|
||||||
StringBuffer sb = null;
|
|
||||||
String bodyData = this.makeBodyData(messageRequest);
|
|
||||||
|
|
||||||
String responseData = "";
|
|
||||||
String method = bodyData.isEmpty() ? "GET" : "POST";
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
|
|
||||||
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();
|
|
||||||
} finally {
|
|
||||||
// http 요청 및 응답 완료 후 BufferedReader를 닫는다
|
|
||||||
if (br != null) {
|
|
||||||
br.close();
|
|
||||||
}
|
|
||||||
if (conn != null) {
|
|
||||||
conn.disconnect();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private String makeBodyData(MessageRequest messageRequest) {
|
|
||||||
// 리턴값
|
|
||||||
String rtnVal = "";
|
|
||||||
|
|
||||||
// guID 및 날짜 시간 정보
|
|
||||||
String jsonData[] = this.makeStdGuidInfo();
|
|
||||||
|
|
||||||
// 표준 헤더
|
|
||||||
StdHeadVO stdHeadVO = new StdHeadVO();
|
|
||||||
stdHeadVO.setNxgn_stnd_idfr("JERA");
|
|
||||||
stdHeadVO.setGuid(jsonData[2]);
|
|
||||||
stdHeadVO.setGuid_prgs_no("1");
|
|
||||||
stdHeadVO.setStnd_mesg_ver("R10");
|
|
||||||
stdHeadVO.setOrtr_guid(jsonData[2]);
|
|
||||||
stdHeadVO.setSect_ecrpt_yn("N");
|
|
||||||
stdHeadVO.setFrst_trnm_ipad(propertyService.getPropertyValue("Monitoring", "djb.ums.was_ip_address", ""));
|
|
||||||
stdHeadVO.setFrst_trnm_ipv4_addr(propertyService.getPropertyValue("Monitoring", "djb.ums.was_ip_address", ""));
|
|
||||||
stdHeadVO.setFrst_trnm_mac(propertyService.getPropertyValue("Monitoring", "djb.ums.was_mac_address", ""));
|
|
||||||
stdHeadVO.setFrst_mesg_dman_dt(jsonData[0]);
|
|
||||||
stdHeadVO.setFrst_mesg_dman_time(jsonData[1]);
|
|
||||||
stdHeadVO.setFrst_trnm_sys_dvcd(SYS_DVCD);
|
|
||||||
stdHeadVO.setTrnm_sys_dvcd(SYS_DVCD);
|
|
||||||
stdHeadVO.setDman_rspn_dvcd("S"); // 요청응답구분코드 S:요청 R:응답
|
|
||||||
stdHeadVO.setSys_env_dvcd(SystemUtil.getSysOperEvirnDstcd()); // D:개발 T:테스트 P:운영
|
|
||||||
stdHeadVO.setTx_tycd("O"); // O:온라인 B:배치
|
|
||||||
stdHeadVO.setSynz_dvcd("S"); // S:동기 A:비동기
|
|
||||||
stdHeadVO.setChnl_tycd(""); // 채널유형코드
|
|
||||||
stdHeadVO.setHmab_dvcd("1"); // 내외구분코드 1:내부 2:외부(타발)
|
|
||||||
stdHeadVO.setIf_id(messageRequest.getEaiInterfaceId()); // 인터페이스ID
|
|
||||||
stdHeadVO.setTx_id(messageRequest.getServiceId()); // 거래ID
|
|
||||||
|
|
||||||
if ("MESSENGER".equals(messageRequest.getMessageType()) ) {
|
|
||||||
|
|
||||||
// 스윙챗 알림 공용
|
|
||||||
SwingCommonVO swiComVO = new SwingCommonVO();
|
|
||||||
swiComVO.setClientld(propertyService.getPropertyValue("Monitoring", "djb.ums.messenger.client_id", ""));
|
|
||||||
swiComVO.setClientSecret(propertyService.getPropertyValue("Monitoring", "djb.ums.messenger.client_secret", ""));
|
|
||||||
swiComVO.setCompanyCode("CB");
|
|
||||||
swiComVO.setRequestUniqueKey(this.genrateRandomStringNumber26());
|
|
||||||
|
|
||||||
// 스윙챗 알림 데이터
|
|
||||||
SwingDataVO swiDataVO = new SwingDataVO();
|
|
||||||
swiDataVO.setNotiCode("CNO_FEP_HMP_0002");
|
|
||||||
swiDataVO.setNotiTitle("알림");
|
|
||||||
swiDataVO.setNotiContent(messageRequest.getMessage());
|
|
||||||
|
|
||||||
// 스윙챗 알림 데이터
|
|
||||||
List<SwingReceiverDataVO> swiReDataVOList = new ArrayList<SwingReceiverDataVO>();
|
|
||||||
SwingReceiverDataVO receiver = new SwingReceiverDataVO();
|
|
||||||
receiver.setCode(messageRequest.getMessengerId());
|
|
||||||
swiReDataVOList.add(receiver);
|
|
||||||
|
|
||||||
swiDataVO.setReceiverInfo(swiReDataVOList);
|
|
||||||
|
|
||||||
String header = gson.toJson(stdHeadVO);
|
|
||||||
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" + "}";
|
|
||||||
|
|
||||||
}
|
|
||||||
else if ("SMS".equals(messageRequest.getMessageType())
|
|
||||||
|| "KAKAO".equals(messageRequest.getMessageType())) {
|
|
||||||
|
|
||||||
// Sms 데이터
|
|
||||||
SmsDataVO dataVO = new SmsDataVO();
|
|
||||||
dataVO.setSnd_dman_dt(jsonData[0]);
|
|
||||||
dataVO.setSnd_dman_id("");
|
|
||||||
dataVO.setSnd_dvcd("EAI");
|
|
||||||
dataVO.setMsg_titl("");
|
|
||||||
dataVO.setMsg_ctnt(messageRequest.getMessage());
|
|
||||||
dataVO.setRecvr_no(messageRequest.getPhone());
|
|
||||||
dataVO.setSndn_no("15880079"); //발신번호
|
|
||||||
dataVO.setSnd_empno(""); //요청자
|
|
||||||
dataVO.setSnd_emp_dprm_cd(""); //요청부서코드
|
|
||||||
if ("SMS".equals(messageRequest.getMessageType())) {
|
|
||||||
dataVO.setLtrs_snd_tycd("1"); // 1:SMS 2:LMS/MMS
|
|
||||||
dataVO.setMsg_snd_tycd("0000"); // 알림톡 메세지 종류 0000:SMS, 1000:LMS, 1008:알림톡, ....
|
|
||||||
} else if ("KAKAO".equals(messageRequest.getMessageType())) {
|
|
||||||
dataVO.setLtrs_snd_tycd("2"); // 1:SMS 2:LMS/MMS
|
|
||||||
dataVO.setMsg_snd_tycd("1008"); // 알림톡 메세지 종류 0000:SMS, 1000:LMS, 1008:알림톡, ....
|
|
||||||
dataVO.setAlmtk_snd_prfl_key(""); // 플러스친구아이디
|
|
||||||
dataVO.setAlmtk_tmplt_cd(""); // 템플릿코드
|
|
||||||
dataVO.setAlmtk_err_ltrs_snd_yn("Y"); // 오류자문자발송여부
|
|
||||||
dataVO.setAlmtk_btn_trnm_tycd("2"); // 카카오버튼전송방식 1-format string 2-JSON 3-XML
|
|
||||||
}
|
|
||||||
dataVO.setSms_trnm_bzwk_dvcd(""); //업무구분코드
|
|
||||||
dataVO.setSms_bzwk_dcls_dvcd(""); //업무세분코드
|
|
||||||
dataVO.setSms_sys_dvcd("83"); //시스템코드
|
|
||||||
dataVO.setTx_dt(jsonData[0]); //거래일자
|
|
||||||
dataVO.setTx_tktm(jsonData[1].substring(0,6)); //거래시간
|
|
||||||
|
|
||||||
List<SmsDataVO> dataList = new ArrayList<SmsDataVO>();
|
|
||||||
dataList.add(dataVO);
|
|
||||||
|
|
||||||
String header = gson.toJson(stdHeadVO);
|
|
||||||
String data = gson.toJson(dataList);
|
|
||||||
|
|
||||||
// 헤더 + 데이터
|
|
||||||
rtnVal = "{\"HEAD\":" + header + " ,\r\n" + "\"DATA\":\r\n" + " [" + "{\r\n"
|
|
||||||
+ " \"data_dvcd\":\"IO\", \r\n" + " \"BIZ_DATA\":\r\n" + " {\r\n"
|
|
||||||
+ " \"ums_if_data_ncnt\":1, \r\n"
|
|
||||||
+ " \"ums_if_data\":" + data
|
|
||||||
+ " }\r\n" + " }\r\n" + " ]\r\n" + "}";
|
|
||||||
|
|
||||||
}
|
|
||||||
else if ("EMAIL".equals(messageRequest.getMessageType())) {
|
|
||||||
|
|
||||||
// 이메일 데이터
|
|
||||||
EmailDataVO dataVO = new EmailDataVO();
|
|
||||||
dataVO.setUms_evnt_id(""); // UMS이벤트ID(필수)
|
|
||||||
dataVO.setSnd_dman_dt(jsonData[0]);
|
|
||||||
dataVO.setSnd_dman_id("");
|
|
||||||
dataVO.setSnd_dman_sno("1");
|
|
||||||
dataVO.setEmail_titl(messageRequest.getSubject()); // 메일제목
|
|
||||||
dataVO.setCstno(""); // 고객번호(필수)
|
|
||||||
dataVO.setSendr_emaddr(""); // 발신자 이메일
|
|
||||||
dataVO.setSendr_nm(""); // 발신자 이름
|
|
||||||
dataVO.setSndbk_emaddr(""); // 리턴 이메일
|
|
||||||
dataVO.setRecvr_emaddr(messageRequest.getEmail()); // 수신자 이메일(필수)
|
|
||||||
dataVO.setRecvr_nm(messageRequest.getUsername()); // 수신자명(필수)
|
|
||||||
dataVO.setTmplt_mpng_info(messageRequest.getMessage()); // 탬플릿매핑정보
|
|
||||||
dataVO.setTmplt_mpng_rptt_info(""); // 탬플릿매핑반복정보
|
|
||||||
dataVO.setSnd_empno(""); // 발신자ID(필수)
|
|
||||||
dataVO.setSnd_emp_dprm_cd(""); // 발신자부서코드(필수)
|
|
||||||
dataVO.setBzwk_cd(""); // 업무구분코드
|
|
||||||
dataVO.setSub_bzwk_cd(""); // 업무세부코드
|
|
||||||
dataVO.setSys_dvcd(SYS_DVCD);
|
|
||||||
dataVO.setTx_dt(jsonData[0]); //거래일자
|
|
||||||
dataVO.setTx_tktm(jsonData[1].substring(0,6)); //거래시간
|
|
||||||
|
|
||||||
List<EmailDataVO> dataList = new ArrayList<EmailDataVO>();
|
|
||||||
dataList.add(dataVO);
|
|
||||||
|
|
||||||
String header = gson.toJson(stdHeadVO);
|
|
||||||
String data = gson.toJson(dataList);
|
|
||||||
|
|
||||||
// 헤더 + 데이터
|
|
||||||
rtnVal = "{\"HEAD\":" + header + " ,\r\n" + "\"DATA\":\r\n" + " [" + "{\r\n"
|
|
||||||
+ " \"data_dvcd\":\"IO\", \r\n" + " \"BIZ_DATA\":\r\n" + " {\r\n"
|
|
||||||
+ " \"ums_if_data_ncnt\":1, \r\n"
|
|
||||||
+ " \"ums_if_data\":" + data
|
|
||||||
+ " }\r\n" + " }\r\n" + " ]\r\n" + "}";
|
|
||||||
}
|
|
||||||
|
|
||||||
log.debug(rtnVal);
|
|
||||||
|
|
||||||
return rtnVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private String[] makeStdGuidInfo() {
|
|
||||||
// 리턴값
|
|
||||||
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 + SYS_DVCD + 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() {
|
|
||||||
StringBuilder buffer = new StringBuilder(26);
|
|
||||||
String characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789";
|
|
||||||
SecureRandom random = new SecureRandom();
|
|
||||||
for (int i = 0; i < 26; i++) {
|
|
||||||
buffer.append(characters.charAt(random.nextInt(characters.length())));
|
|
||||||
}
|
|
||||||
return buffer.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
package com.eactive.eai.rms.ext.djb.ums.vo;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class EmailDataVO {
|
|
||||||
|
|
||||||
/** UMS이벤트ID */
|
|
||||||
private String ums_evnt_id;
|
|
||||||
|
|
||||||
/** 발송요청일자 */
|
|
||||||
private String snd_dman_dt;
|
|
||||||
|
|
||||||
/** UUID */
|
|
||||||
private String snd_dman_id;
|
|
||||||
|
|
||||||
/** 발송요청순번 */
|
|
||||||
private String snd_dman_sno;
|
|
||||||
|
|
||||||
/** 메일제목 */
|
|
||||||
private String email_titl;
|
|
||||||
|
|
||||||
/** 고객번호 */
|
|
||||||
private String cstno;
|
|
||||||
|
|
||||||
/** 발신자 이메일 */
|
|
||||||
private String sendr_emaddr;
|
|
||||||
|
|
||||||
/** 발신자 이름 */
|
|
||||||
private String sendr_nm;
|
|
||||||
|
|
||||||
/** 리턴 이메일 */
|
|
||||||
private String sndbk_emaddr;
|
|
||||||
|
|
||||||
/** 수신자 이메일 */
|
|
||||||
private String recvr_emaddr;
|
|
||||||
|
|
||||||
/** 수신자명 */
|
|
||||||
private String recvr_nm;
|
|
||||||
|
|
||||||
/** 탬플릿매핑정보 */
|
|
||||||
private String tmplt_mpng_info;
|
|
||||||
|
|
||||||
/** 탬플릿매핑반복정보 */
|
|
||||||
private String tmplt_mpng_rptt_info;
|
|
||||||
|
|
||||||
/** 발신자ID */
|
|
||||||
private String snd_empno;
|
|
||||||
|
|
||||||
/** 발신자부서코드 */
|
|
||||||
private String snd_emp_dprm_cd;
|
|
||||||
|
|
||||||
/** 업무구분코드 */
|
|
||||||
private String bzwk_cd;
|
|
||||||
|
|
||||||
/** 업무세부코드 */
|
|
||||||
private String sub_bzwk_cd;
|
|
||||||
|
|
||||||
/** 시스템코드 */
|
|
||||||
private String sys_dvcd;
|
|
||||||
|
|
||||||
/** 거래일자 */
|
|
||||||
private String tx_dt;
|
|
||||||
|
|
||||||
/** 거래시간 */
|
|
||||||
private String tx_tktm;
|
|
||||||
}
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
package com.eactive.eai.rms.ext.djb.ums.vo;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class SmsDataVO {
|
|
||||||
|
|
||||||
/** 발송요청일자 */
|
|
||||||
private String snd_dman_dt;
|
|
||||||
|
|
||||||
/** UUID */
|
|
||||||
private String snd_dman_id;
|
|
||||||
|
|
||||||
/** 발송구분 */
|
|
||||||
private String snd_dvcd;
|
|
||||||
|
|
||||||
/** 발송타입 */
|
|
||||||
private String ltrs_snd_tycd;
|
|
||||||
|
|
||||||
/** LMS 제목 */
|
|
||||||
private String msg_titl;
|
|
||||||
|
|
||||||
/** 메세지 */
|
|
||||||
private String msg_ctnt;
|
|
||||||
|
|
||||||
/** 수신자번호 */
|
|
||||||
private String recvr_no;
|
|
||||||
|
|
||||||
/** 발신번호 */
|
|
||||||
private String sndn_no;
|
|
||||||
|
|
||||||
/** 요청자(직원번호) */
|
|
||||||
private String snd_empno;
|
|
||||||
|
|
||||||
/** 요청부서코드 */
|
|
||||||
private String snd_emp_dprm_cd;
|
|
||||||
|
|
||||||
/** 알림톡 메시지 종류 */
|
|
||||||
private String msg_snd_tycd;
|
|
||||||
|
|
||||||
/** 플러스친구아이디 */
|
|
||||||
private String almtk_snd_prfl_key;
|
|
||||||
|
|
||||||
/** 템플릿코드 */
|
|
||||||
private String almtk_tmplt_cd;
|
|
||||||
|
|
||||||
/** 오류자문자발송여부 */
|
|
||||||
private String almtk_err_ltrs_snd_yn;
|
|
||||||
|
|
||||||
/** 카카오톡전송방식 */
|
|
||||||
private String almtk_btn_trnm_tycd;
|
|
||||||
|
|
||||||
/** 업무구분 코드 */
|
|
||||||
private String sms_trnm_bzwk_dvcd;
|
|
||||||
|
|
||||||
/** 업무세부코드 */
|
|
||||||
private String sms_bzwk_dcls_dvcd;
|
|
||||||
|
|
||||||
/** 시스템코드 */
|
|
||||||
private String sms_sys_dvcd;
|
|
||||||
|
|
||||||
/** 거래일자 */
|
|
||||||
private String tx_dt;
|
|
||||||
|
|
||||||
/** 거래시간 */
|
|
||||||
private String tx_tktm;
|
|
||||||
}
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
package com.eactive.eai.rms.ext.djb.ums.vo;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class StdHeadVO {
|
|
||||||
|
|
||||||
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 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;
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package com.eactive.eai.rms.ext.djb.ums.vo;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class SwingCommonVO {
|
|
||||||
|
|
||||||
/** 클라이업트 D */
|
|
||||||
private String clientld;
|
|
||||||
|
|
||||||
/** 클라이언트 시크릿 */
|
|
||||||
private String clientSecret;
|
|
||||||
|
|
||||||
/** 회사코드 */
|
|
||||||
private String companyCode;
|
|
||||||
|
|
||||||
/** 요청고유키 */
|
|
||||||
private String requestUniqueKey;
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
package com.eactive.eai.rms.ext.djb.ums.vo;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class SwingDataVO {
|
|
||||||
|
|
||||||
/** 알림코드 */
|
|
||||||
private String notiCode;
|
|
||||||
|
|
||||||
/** 알림제목 */
|
|
||||||
private String notiTitle;
|
|
||||||
|
|
||||||
/** 알림내용 */
|
|
||||||
private String notiContent;
|
|
||||||
|
|
||||||
/** 수신자정보 */
|
|
||||||
private List<SwingReceiverDataVO> receiverInfo;
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package com.eactive.eai.rms.ext.djb.ums.vo;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class SwingReceiverDataVO {
|
|
||||||
|
|
||||||
/** 알림코드 */
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
/** 알림제목 */
|
|
||||||
private String type;
|
|
||||||
|
|
||||||
/** 알림내용 */
|
|
||||||
private String companyCode;
|
|
||||||
|
|
||||||
/** 수신자정보 */
|
|
||||||
private String code;
|
|
||||||
|
|
||||||
/** 상품명 */
|
|
||||||
private String prdNm;
|
|
||||||
}
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.eactive.eai.rms.ext.djb.ums;
|
package com.eactive.eai.rms.ext.djb.util;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -64,13 +64,12 @@ public class PortalNoticeUI {
|
|||||||
|
|
||||||
private String summary;
|
private String summary;
|
||||||
|
|
||||||
// HTML <input type="datetime-local"> 는 'T' 구분자 형식 (예: 2026-06-16T10:29).
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm")
|
|
||||||
private LocalDateTime startedAt;
|
private LocalDateTime startedAt;
|
||||||
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||||
private LocalDateTime endAt;
|
private LocalDateTime endAt;
|
||||||
|
|
||||||
private String state; // INCIDENT 한정 (INVESTIGATING/IDENTIFIED/MONITORING/RESOLVED/CANCELED)
|
private String state; // INCIDENT 한정 (INVESTIGATING/IDENTIFIED/MONITORING/RESOLVED/CANCELED)
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ import org.springframework.transaction.support.TransactionTemplate;
|
|||||||
|
|
||||||
import com.eactive.apim.portal.template.entity.MessageRequest;
|
import com.eactive.apim.portal.template.entity.MessageRequest;
|
||||||
import com.eactive.apim.portal.template.repository.MessageRequestRepository;
|
import com.eactive.apim.portal.template.repository.MessageRequestRepository;
|
||||||
import com.eactive.eai.rms.common.datasource.DataSourceContextHolder;
|
import com.eactive.ext.djb.ums.DjbMessengerService;
|
||||||
import com.eactive.eai.rms.common.datasource.DataSourceTypeManager;
|
import com.eactive.ext.kjb.ums.KjbEmailSendModule;
|
||||||
import com.eactive.eai.rms.ext.djb.ums.service.UmsService;
|
import com.eactive.ext.kjb.ums.KjbUmsService;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@@ -43,17 +43,13 @@ public class UmsDispatchService {
|
|||||||
private EntityManager entityManager;
|
private EntityManager entityManager;
|
||||||
|
|
||||||
private final MessageRequestRepository messageRequestRepository;
|
private final MessageRequestRepository messageRequestRepository;
|
||||||
|
|
||||||
private final UmsService umsService;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public UmsDispatchService(
|
public UmsDispatchService(
|
||||||
@Qualifier("transactionManagerForEMS") PlatformTransactionManager transactionManager,
|
@Qualifier("transactionManagerForEMS") PlatformTransactionManager transactionManager,
|
||||||
MessageRequestRepository messageRequestRepository,
|
MessageRequestRepository messageRequestRepository
|
||||||
UmsService umsService
|
|
||||||
) {
|
) {
|
||||||
this.messageRequestRepository = messageRequestRepository;
|
this.messageRequestRepository = messageRequestRepository;
|
||||||
this.umsService = umsService;
|
|
||||||
|
|
||||||
this.executorService = new ThreadPoolExecutor(
|
this.executorService = new ThreadPoolExecutor(
|
||||||
CORE_POOL_SIZE,
|
CORE_POOL_SIZE,
|
||||||
@@ -75,6 +71,17 @@ public class UmsDispatchService {
|
|||||||
log.info("UmsDispatchService initialized - KjbUmsService and KjbEmailSendModule ready via singleton");
|
log.info("UmsDispatchService initialized - KjbUmsService and KjbEmailSendModule ready via singleton");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private DjbMessengerService getMessengerService() {
|
||||||
|
return DjbMessengerService.getInstance();
|
||||||
|
}
|
||||||
|
|
||||||
|
private KjbUmsService getUmsService() {
|
||||||
|
return KjbUmsService.getInstance();
|
||||||
|
}
|
||||||
|
|
||||||
|
private KjbEmailSendModule getEmailModule() {
|
||||||
|
return KjbEmailSendModule.getInstance();
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Transactional(transactionManager = "transactionManagerForEMS")
|
@Transactional(transactionManager = "transactionManagerForEMS")
|
||||||
@@ -131,7 +138,15 @@ public class UmsDispatchService {
|
|||||||
try {
|
try {
|
||||||
transactionTemplate.execute(status -> {
|
transactionTemplate.execute(status -> {
|
||||||
try {
|
try {
|
||||||
umsService.send(message);
|
if (DjbMessengerService.isAllowChannel(message)) {
|
||||||
|
getMessengerService().send(message);
|
||||||
|
}
|
||||||
|
if (KjbUmsService.isAllowChannel(message)) {
|
||||||
|
getUmsService().send(message);
|
||||||
|
}
|
||||||
|
if (KjbEmailSendModule.isAllowChannel(message)) {
|
||||||
|
getEmailModule().sendEmail(message);
|
||||||
|
}
|
||||||
updateMessageStatus(message, "SENT");
|
updateMessageStatus(message, "SENT");
|
||||||
return null;
|
return null;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -159,6 +174,5 @@ public class UmsDispatchService {
|
|||||||
message.setRequestStatus(status);
|
message.setRequestStatus(status);
|
||||||
message.setSentDate(LocalDateTime.now());
|
message.setSentDate(LocalDateTime.now());
|
||||||
entityManager.merge(message);
|
entityManager.merge(message);
|
||||||
entityManager.flush();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -565,7 +565,7 @@ public class ApiInterfaceService extends OnlBaseService {
|
|||||||
restOption.setMethod(outboundHttpMethod);
|
restOption.setMethod(outboundHttpMethod);
|
||||||
restOption.setExtraPath(outboundRestPath);
|
restOption.setExtraPath(outboundRestPath);
|
||||||
|
|
||||||
String pathType = outboundRestPath.matches(".*\\{.+\\}.*") ? "variableUrlRequest" : "simpleRequest";
|
String pathType = outboundRestPath.matches(".*\\{[_a-zA-Z]+\\}.*") ? "variableUrlRequest" : "simpleRequest";
|
||||||
restOption.setType(pathType);
|
restOption.setType(pathType);
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(contentType)) {
|
if (StringUtils.isNotBlank(contentType)) {
|
||||||
|
|||||||
+1
-1
@@ -400,7 +400,7 @@ public class SimpleInterfaceService extends OnlBaseService {
|
|||||||
jsonObject.put("method", outboundHttpMethod);
|
jsonObject.put("method", outboundHttpMethod);
|
||||||
jsonObject.put("extraPath", outboundRestPath);
|
jsonObject.put("extraPath", outboundRestPath);
|
||||||
|
|
||||||
String pathType = outboundRestPath.matches(".*\\{.+\\}.*") ? "variableUrlRequest" : "simpleRequest";
|
String pathType = outboundRestPath.matches(".*\\{[a-zA-Z]+\\}.*") ? "variableUrlRequest" : "simpleRequest";
|
||||||
jsonObject.put("type", pathType);
|
jsonObject.put("type", pathType);
|
||||||
restOption = jsonObject.toString();
|
restOption = jsonObject.toString();
|
||||||
return restOption;
|
return restOption;
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
FLOVRSEVRNAME AS "FAILOVERSVRNM",
|
FLOVRSEVRNAME AS "FAILOVERSVRNM",
|
||||||
HOSTNAME AS "HOSTNAME"
|
HOSTNAME AS "HOSTNAME"
|
||||||
FROM $schemaId$.TSEAIBP03
|
FROM $schemaId$.TSEAIBP03
|
||||||
|
WHERE ROWNUM = 1
|
||||||
</statement>
|
</statement>
|
||||||
|
|
||||||
</sqlMap>
|
</sqlMap>
|
||||||
@@ -5,20 +5,13 @@
|
|||||||
# \uC790\uB3D9 \uD56B\uC2A4\uC651 \uD65C\uC131\uD654
|
# \uC790\uB3D9 \uD56B\uC2A4\uC651 \uD65C\uC131\uD654
|
||||||
autoHotswap=true
|
autoHotswap=true
|
||||||
|
|
||||||
# \uB85C\uADF8 \uB808\uBCA8 (TRACE, DEBUG, INFO, WARNING, ERROR)
|
# \uB85C\uAE45 \uB808\uBCA8 (TRACE, DEBUG, INFO, WARNING, ERROR)
|
||||||
LOGGER=INFO
|
LOGGER.level=INFO
|
||||||
|
|
||||||
# \uB85C\uADF8 \uD30C\uC77C \uACBD\uB85C (\uC9C0\uC815 \uC2DC \uCF58\uC194 \uB300\uC2E0 \uD30C\uC77C\uB85C \uCD9C\uB825)
|
|
||||||
LOGFILE=/Users/rinjae/eactive/djb-eapim/djb-eapim/eapim-admin/logs/hotswap-agent.log
|
|
||||||
LOGFILE.append=true
|
|
||||||
|
|
||||||
# \uC2DC\uAC01 \uD3EC\uB9F7
|
|
||||||
LOGGER_DATETIME_FORMAT=yyyy-MM-dd HH:mm:ss.SSS
|
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# \uBA85\uC2DC\uC801 \uD50C\uB7EC\uADF8\uC778 \uBE44\uD65C\uC131\uD654 (\uC27C\uD45C \uAD6C\uBD84)
|
# \uBA85\uC2DC\uC801 \uD50C\uB7EC\uADF8\uC778 \uBE44\uD65C\uC131\uD654 (\uC27C\uD45C \uAD6C\uBD84)
|
||||||
# ============================================================
|
# ============================================================
|
||||||
disabledPlugins=IBatis,MyBatis
|
disabledPlugins=org.hotswap.agent.plugin.ibatis.IBatisPlugin,org.hotswap.agent.plugin.mybatis.MyBatisPlugin
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# Core Plugin \uD65C\uC131\uD654
|
# Core Plugin \uD65C\uC131\uD654
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<property name="LOG_PATTERN" value="[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] \\(%F:%L\\) %-20M -%msg%n" />
|
<property name="LOG_PATTERN" value="[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] \\(%F:%L\\) %-20M -%msg%n" />
|
||||||
<property name="PREFIX" value="${inst.Type:-ems}" />
|
<property name="PREFIX" value="${inst.Type:-ems}" />
|
||||||
<property name="LOG_HOME" value="/logs/eapim/${inst.Name:-emsSvr00}" />
|
<property name="LOG_HOME" value="/Log/App/eapim/${inst.Name:-devSvr00}" />
|
||||||
<property name="BACKUP_HOME" value="${LOG_HOME}/backup/" />
|
<property name="BACKUP_HOME" value="${LOG_HOME}/backup/" />
|
||||||
<property name="LOG_LEVEL" value="${LOGBACK_LOG_LEVEL:-DEBUG}" />
|
<property name="LOG_LEVEL" value="${LOGBACK_LOG_LEVEL:-DEBUG}" />
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<property name="LOG_PATTERN" value="[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] \\(%F:%L\\) %-20M -%msg%n" />
|
<property name="LOG_PATTERN" value="[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] \\(%F:%L\\) %-20M -%msg%n" />
|
||||||
<property name="PREFIX" value="${inst.Type:-ems}" />
|
<property name="PREFIX" value="${inst.Type:-ems}" />
|
||||||
<property name="LOG_HOME" value="/logs/eapim/${inst.Name:-devSvr00}" />
|
<property name="LOG_HOME" value="/Log/App/eapim/${inst.Name:-devSvr00}" />
|
||||||
<property name="BACKUP_HOME" value="${LOG_HOME}/backup/" />
|
<property name="BACKUP_HOME" value="${LOG_HOME}/backup/" />
|
||||||
<property name="LOG_LEVEL" value="${LOGBACK_LOG_LEVEL:-DEBUG}" />
|
<property name="LOG_LEVEL" value="${LOGBACK_LOG_LEVEL:-DEBUG}" />
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<property name="LOG_PATTERN" value="[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] \\(%F:%L\\) %-20M -%msg%n" />
|
<property name="LOG_PATTERN" value="[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] \\(%F:%L\\) %-20M -%msg%n" />
|
||||||
<property name="PREFIX" value="${inst.Type:-ems}" />
|
<property name="PREFIX" value="${inst.Type:-ems}" />
|
||||||
<property name="LOG_HOME" value="/logs/eapim/${inst.Name:-emsSvr00}" />
|
<property name="LOG_HOME" value="/Log/App/eapim/${inst.Name:-emsSvr00}" />
|
||||||
<property name="BACKUP_HOME" value="${LOG_HOME}/backup/" />
|
<property name="BACKUP_HOME" value="${LOG_HOME}/backup/" />
|
||||||
<property name="LOG_LEVEL" value="${LOGBACK_LOG_LEVEL:-INFO}" />
|
<property name="LOG_LEVEL" value="${LOGBACK_LOG_LEVEL:-INFO}" />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user