fix(enhance-v4): APK QR 버그 수정 + 웹메일 라우터 수정
Some checks are pending
GUARDiA CI / Python Lint & Import Test (push) Waiting to run
GUARDiA CI / Validate Install Scripts (push) Waiting to run
GUARDiA CI / PR Validation Summary (push) Blocked by required conditions

This commit is contained in:
DESKTOP-TKLFCPR\ython 2026-06-02 20:23:55 +09:00
parent b5a4f7a397
commit 371f77e7ab
8223 changed files with 1421629 additions and 692 deletions

View File

@ -0,0 +1 @@
Phase 1 분석 완료

View File

@ -0,0 +1,6 @@
Phase 1: 충돌 없음 확인
- autodiscovery vs cmdb.py: CMDB는 수동 CRUD, autodiscovery는 스캔 기반 → 독립
- nlquery vs nlcmd.py/chatbot.py: nlcmd는 봇명령어, nlquery는 직접 SQL → 독립
- drift_detection vs compliance.py: compliance는 CSAP 체크리스트, drift는 config 비교 → 독립
- multicloud vs ncloud.py: ncloud.py 패턴 확장 → 네임스페이스 분리
- narasajang vs gateway.py: gateway는 범용 커넥터, narasajang은 조달청 특화 → 독립

View File

@ -0,0 +1,43 @@
import paramiko, sys
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
sftp = c.open_sftp()
# sso_provider가 create_access_token을 임포트하는지 확인
test = """
import sys
sys.path.insert(0, '/opt/guardia/app')
# core.auth에 create_access_token이 있는지
try:
from core.auth import create_access_token
print("create_access_token: OK")
except ImportError as e:
print(f"create_access_token: MISSING - {e}")
# sso_provider에서만 임포트 테스트
import importlib, traceback
for mod in ['kubernetes', 'sso_provider', 'predictive_ops', 'slack_connector', 'white_label']:
try:
m = importlib.import_module(f'routers.{mod}')
# lifespan 이벤트 확인
has_startup = hasattr(m.router, 'on_startup') and m.router.on_startup
print(f"{mod}: OK (startup={has_startup})")
except Exception as e:
print(f"{mod}: ERROR - {traceback.format_exc()[-200:]}")
"""
with sftp.open('/tmp/find_bad.py', 'w') as f: f.write(test)
_, o, _ = c.exec_command(
'cd /opt/guardia/app && /opt/guardia/venv/bin/python3 /tmp/find_bad.py 2>&1; rm /tmp/find_bad.py',
timeout=15)
print(o.read().decode('utf-8','replace').strip())
# main.py의 lifespan 이벤트 확인
_, o2, _ = c.exec_command(
"grep -n 'lifespan\\|on_startup\\|on_shutdown\\|@app.on' /opt/guardia/app/main.py | head -20",
timeout=10)
print('\n[main.py lifespan 이벤트]')
print(o2.read().decode('utf-8','replace').strip()[:400])
sftp.close(); c.close()

View File

@ -0,0 +1,23 @@
import paramiko, sys, time
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
def run(label, cmd, timeout=20):
_, o, _ = c.exec_command(cmd, timeout=timeout)
print(f'\n[{label}]\n' + o.read().decode('utf-8','replace').strip()[:500])
run('guardia 서비스 파일', 'cat /etc/systemd/system/guardia.service | grep -E "ExecStart|port|WorkingDirectory"')
run('포트 9001', 'ss -tlnp | grep 9001 || echo "9001 비어있음"')
run('포트 kill + 재시작',
'fuser -k 9001/tcp 2>/dev/null; sleep 1; systemctl restart guardia && sleep 5 && systemctl is-active guardia')
time.sleep(3)
run('API 헬스체크',
'curl -sf http://localhost:9001/health 2>/dev/null || curl -sf http://localhost:9001/ 2>/dev/null | head -3')
run('신규 엔드포인트',
'curl -sf http://localhost:9001/openapi.json 2>/dev/null | '
'python3 -c "import sys,json; d=json.load(sys.stdin); '
'new=[p for p in d[chr(112)+chr(97)+chr(116)+chr(104)+chr(115)] if any(k in p for k in [\'/api/rag\',\'/api/jira\',\'/api/kpi\',\'/api/portal\',\'/api/bi\',\'/api/workflow\'])]; '
'print(chr(49)+chr(51)+chr(32)+chr(100)+chr(111)+ \" paths\"); [print(p) for p in sorted(new)]" 2>/dev/null')
c.close()

View File

@ -0,0 +1,155 @@
"""전체 배포 상태 종합 검증"""
import paramiko, sys, json, base64, time
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
sftp = c.open_sftp()
G = base64.b64encode(b'zio:Zio@Admin2026!').decode()
J = 'http://127.0.0.1:9080'
JA = 'admin:Admin@2026!'
def run(cmd, timeout=15):
_, o, _ = c.exec_command(cmd, timeout=timeout)
return o.read().decode('utf-8','replace').strip()
def ok(v): return '' if v else ''
results = {}
print('=' * 60)
print('GUARDiA 전체 배포 상태 검증')
print('=' * 60)
# ── 1. 서비스 상태 ─────────────────────────────────────────
print('\n■ 1. 서비스 상태')
services = {
'GUARDiA ITSM (9001)': 'guardia',
'홈페이지 (8082)': 'zioinfo',
'Manager (8090)': 'guardia-manager',
'Webhook (9999)': 'zioinfo-deploy',
'Jenkins (9080)': 'jenkins',
'zioinfo-mail (8026)': 'zioinfo-mail',
'Gitea (9003)': 'gitea',
}
for name, svc in services.items():
status = run(f'systemctl is-active {svc} 2>/dev/null')
print(f' {ok(status=="active")} {name}: {status}')
# ── 2. ITSM API 엔드포인트 ──────────────────────────────────
print('\n■ 2. GUARDiA ITSM API')
api_info = run(
'curl -sf http://localhost:9001/openapi.json 2>/dev/null | '
'python3 -c "import sys,json; d=json.load(sys.stdin); paths=d[\'paths\']; '
'adv=[p for p in paths if any(k in p for k in [\'/api/ocr\',\'/api/docflow\',\'/api/autodiscovery\',\'/api/nlquery\',\'/api/drift\',\'/api/kpi\',\'/api/multicloud\'])]; '
'print(f\'전체: {len(paths)}개 | OCR+확장: {len(adv)}개\')" 2>/dev/null || echo "API 확인 불가"'
)
print(f'{api_info}')
# 주요 신규 기능 엔드포인트 확인
key_paths = ['/api/ocr/parse', '/api/docflow/brand-contract', '/api/nlquery/ask',
'/api/drift/scan/{server_id}', '/api/kpi/dashboard', '/api/autodiscovery/scan',
'/api/multicloud/providers', '/api/narasajang/bids']
existing = run(
'curl -sf http://localhost:9001/openapi.json 2>/dev/null | '
'python3 -c "import sys,json; d=json.load(sys.stdin)[\'paths\']; print(\'|\'.join(d.keys()))" 2>/dev/null'
)
for path in key_paths:
exists = path in existing
print(f' {ok(exists)} {path}')
# ── 3. DB 테이블 ────────────────────────────────────────────
print('\n■ 3. 신규 DB 테이블')
db_check = """
import asyncio, sys
sys.path.insert(0, '/opt/guardia/app')
from database import engine
from sqlalchemy import text
TABLES = [
'tb_upstage_ocr_config', 'tb_ocr_history', 'tb_doc_workflow_job', 'tb_doc_template',
'tb_discovery_scan_job', 'tb_cmdb_autodiscovery', 'tb_service_dependency',
'tb_query_history', 'tb_assistant_session', 'tb_golden_config', 'tb_drift_result',
'tb_multicloud_config', 'tb_kpi_definition', 'tb_kpi_value',
'tb_jira_config', 'tb_slack_config', 'tb_tenant_branding',
'tb_narasajang_config', 'tb_network_zone', 'tb_procurement_record',
'tb_learning_run', 'tb_container_alert_rule', 'tb_aws_config',
]
async def check():
ok_cnt = fail_cnt = 0
async with engine.connect() as conn:
for t in TABLES:
try:
await conn.execute(text(f"SELECT 1 FROM {t} LIMIT 0"))
ok_cnt += 1
except:
fail_cnt += 1
print(f" MISS: {t}")
print(f" DB 테이블: {ok_cnt}/{len(TABLES)}개 정상")
asyncio.run(check())
"""
with sftp.open('/tmp/dbchk.py', 'w') as f: f.write(db_check)
print(run('cd /opt/guardia/app && /opt/guardia/venv/bin/python3 /tmp/dbchk.py 2>&1; rm /tmp/dbchk.py', timeout=20))
# ── 4. 홈페이지 ─────────────────────────────────────────────
print('\n■ 4. 홈페이지 (zioinfo.co.kr)')
www_files = run('ls /var/www/zioinfo/assets/*.js 2>/dev/null | wc -l')
www_date = run('stat /var/www/zioinfo/index.html 2>/dev/null | grep Modify | cut -d" " -f2,3')
guardia_js = run('ls /var/www/zioinfo/assets/GuardiaDetail*.js 2>/dev/null | sort | tail -1 | xargs ls -lh 2>/dev/null')
print(f' ✅ 정적 파일: {www_files}')
print(f' ✅ index.html: {www_date}')
print(f' ✅ GuardiaDetail: {guardia_js}')
homepage_ok = run('curl -sf -o /dev/null -w "%{http_code}" https://zioinfo.co.kr/ -L 2>/dev/null || echo "0"')
print(f' {ok(homepage_ok in ("200","301","302"))} HTTP: {homepage_ok}')
# ── 5. Manager ──────────────────────────────────────────────
print('\n■ 5. GUARDiA Manager (8090)')
mgr_date = run('stat /var/www/manager/index.html 2>/dev/null | grep Modify | cut -d" " -f2,3')
mgr_files = run('ls /var/www/manager/assets/*.js 2>/dev/null | wc -l')
print(f' ✅ 정적 파일: {mgr_files}개 | index.html: {mgr_date}')
# ── 6. zioinfo-mail ─────────────────────────────────────────
print('\n■ 6. 웹메일 (mail:8025, API:8026)')
mail_health = run('curl -sf http://localhost:8026/health 2>/dev/null | python3 -c "import sys,json; print(json.load(sys.stdin).get(\'status\'))" 2>/dev/null || echo "응답없음"')
mail_www = run('ls /var/www/mail/assets/*.js 2>/dev/null | wc -l')
print(f' {ok(mail_health=="ok")} API health: {mail_health}')
print(f' ✅ 프론트엔드: {mail_www}개 JS 파일')
# ── 7. Jenkins CI/CD ────────────────────────────────────────
print('\n■ 7. Jenkins CI/CD (9080)')
jenkins_jobs = run(
f'curl -sf -u "{JA}" {J}/api/json 2>/dev/null | '
'python3 -c "import sys,json; d=json.load(sys.stdin); jobs=d[\'jobs\']; '
'blue=sum(1 for j in jobs if j[\'color\']==\'blue\'); '
'print(f\'{blue}/{len(jobs)}개 blue\')" 2>/dev/null || echo "확인불가"'
)
print(f' ✅ Jenkins jobs: {jenkins_jobs}')
# ── 8. Gitea repos ──────────────────────────────────────────
print('\n■ 8. Gitea 저장소 현황')
for repo in ['zioinfo-web', 'guardia-itsm', 'guardia-manager', 'guardia-messenger', 'guardia-docs', 'zioinfo-mail']:
commit = run(
f'curl -sf "http://127.0.0.1:9003/api/v1/repos/zio/{repo}/commits?limit=1" '
f'-H "Authorization: Basic {G}" 2>/dev/null | '
'python3 -c "import sys,json; c=json.load(sys.stdin)[0]; print(c[\'sha\'][:8], c[\'commit\'][\'message\'][:45])" 2>/dev/null || echo "확인불가"'
)
print(f'{repo}: {commit}')
# ── 9. Webhook 배포 서버 ────────────────────────────────────
print('\n■ 9. Webhook 배포 서버')
webhook_repos = run("grep -c 'elif repo ==' /opt/zioinfo/deploy_server.py 2>/dev/null || echo 0")
webhook_port = run('ss -tlnp | grep 9999 2>/dev/null | head -1')
print(f' ✅ 지원 repo: {webhook_repos}')
print(f' {ok("9999" in webhook_port)} 포트 9999: {"LISTEN" if "9999" in webhook_port else "없음"}')
# ── 요약 ────────────────────────────────────────────────────
print('\n' + '=' * 60)
print('■ 종합 요약')
print('=' * 60)
print(f' ITSM: {api_info}')
print(f' 서비스: 7개 중 {"7" if all(run(f"systemctl is-active {s} 2>/dev/null")=="active" for s in services.values()) else "일부"} active')
print(f' 홈페이지: www {www_files}개 파일')
print(f' 웹메일: API {mail_health}')
print(f' CI/CD: Jenkins {jenkins_jobs}')
sftp.close(); c.close()

View File

@ -0,0 +1,10 @@
import paramiko, sys
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
_, o, _ = c.exec_command(
'curl -sf -u "admin:Admin@2026!" http://127.0.0.1:9080/job/zioinfo-mail/6/consoleText 2>/dev/null | '
"grep -E 'error|Error|FAIL|fail|permission|rsync|npm|node_modules|Cannot|exit' | head -20",
timeout=15)
print(o.read().decode('utf-8','replace'))
c.close()

View File

@ -0,0 +1,10 @@
import paramiko, sys
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
_, o, _ = c.exec_command(
'curl -sf -u "admin:Admin@2026!" http://127.0.0.1:9080/job/zioinfo-mail/7/consoleText 2>/dev/null | '
"grep -v '\\[Pipeline\\]\\|withEnv\\|timeout\\|timestamps\\|node\\|stage\\|//\\|{\\|}' | "
"grep -v '^$' | tail -30", timeout=15)
print(o.read().decode('utf-8','replace'))
c.close()

View File

@ -0,0 +1,15 @@
import paramiko, sys
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
def run(label, cmd, timeout=15):
_, o, _ = c.exec_command(cmd, timeout=timeout)
print(f'\n[{label}]\n' + o.read().decode('utf-8','replace').strip()[:1000])
run('빌드 #4 전체 콘솔',
'curl -sf -u "admin:Admin@2026!" http://127.0.0.1:9080/job/zioinfo-mail/4/consoleText 2>/dev/null')
run('Jenkins workspace 파일',
'ls /var/lib/jenkins/workspace/zioinfo-mail/ 2>/dev/null')
run('Jenkins workspace frontend',
'ls /var/lib/jenkins/workspace/zioinfo-mail/frontend/ 2>/dev/null')
c.close()

View File

@ -0,0 +1,19 @@
import paramiko, sys
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
def run(label, cmd, timeout=15):
_, o, _ = c.exec_command(cmd, timeout=timeout)
print(f'\n[{label}]\n' + o.read().decode('utf-8','replace').strip()[:800])
run('npm 에러 상세',
'curl -sf -u "admin:Admin@2026!" http://127.0.0.1:9080/job/zioinfo-mail/4/consoleText 2>/dev/null | '
"grep -A5 -B2 'npm\\|error\\|ERROR\\|FAIL\\|exit'")
run('package.json 있는지',
'ls -la /var/lib/jenkins/workspace/zioinfo-mail/frontend/package.json 2>/dev/null')
run('package-lock.json 있는지',
'ls -la /var/lib/jenkins/workspace/zioinfo-mail/frontend/package-lock.json 2>/dev/null && '
'wc -l /var/lib/jenkins/workspace/zioinfo-mail/frontend/package-lock.json')
run('node/npm 버전', 'node --version; npm --version')
c.close()

View File

@ -0,0 +1,9 @@
import paramiko, sys
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
_, o, _ = c.exec_command(
'cd /opt/guardia/app && timeout 10 /opt/guardia/venv/bin/uvicorn main:app --host 127.0.0.1 --port 9001 2>&1 | head -30',
timeout=15)
print(o.read().decode('utf-8','replace'))
c.close()

View File

@ -0,0 +1,65 @@
import paramiko, sys, time
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
sftp = c.open_sftp()
def run(label, cmd, timeout=20):
_, o, _ = c.exec_command(cmd, timeout=timeout)
print(f'\n[{label}]\n' + o.read().decode('utf-8','replace').strip()[:600])
# 실제 포트 확인
run('guardia 서비스 포트', 'cat /etc/systemd/system/guardia.service | grep -E "port|Port"')
run('프로세스 포트', 'ss -tlnp | grep -E "uvicorn|python3" | head -5')
# fuser 정리 후 재시작
run('포트 정리 + 재시작',
'fuser -k 9001/tcp 2>/dev/null || true; sleep 1; '
'systemctl restart guardia && sleep 6 && systemctl is-active guardia')
time.sleep(4)
# 신규 엔드포인트 Python 스크립트로 확인
test = """
import urllib.request, json, sys
for port in [9001, 8001, 8443]:
try:
req = urllib.request.Request(f"http://localhost:{port}/openapi.json")
d = json.loads(urllib.request.urlopen(req, timeout=5).read())
paths = sorted(d["paths"].keys())
keywords = ["/api/rag", "/api/jira", "/api/kpi", "/api/portal", "/api/bi/", "/api/workflow"]
new_paths = [p for p in paths if any(k in p for k in keywords)]
print(f"포트 {port}: 총 {len(paths)}개 엔드포인트, 신규 {len(new_paths)}")
for p in new_paths: print(" ", p)
break
except Exception as e:
print(f"포트 {port}: {e}")
"""
with sftp.open('/tmp/verify.py', 'w') as f: f.write(test)
run('신규 API 검증', 'python3 /tmp/verify.py 2>&1; rm /tmp/verify.py')
# DB 테이블 검증
db_test = """
import asyncio, sys
sys.path.insert(0, '/opt/guardia/app')
from database import engine
from sqlalchemy import text
async def check():
tables = ['tb_rag_feedback','tb_jira_config','tb_jira_sync_mapping',
'tb_kpi_definition','tb_kpi_value',
'tb_auto_workflow_rule','tb_auto_workflow_run']
async with engine.connect() as conn:
for t in tables:
try:
r = await conn.execute(text(f"SELECT COUNT(*) FROM {t}"))
print(f" {t}: OK")
except Exception as e:
print(f" {t}: {str(e)[:50]}")
asyncio.run(check())
"""
with sftp.open('/tmp/dbtest.py', 'w') as f: f.write(db_test)
run('DB 테이블 검증',
'cd /opt/guardia/app && /opt/guardia/venv/bin/python3 /tmp/dbtest.py 2>&1; rm /tmp/dbtest.py')
sftp.close(); c.close()

View File

@ -0,0 +1,23 @@
import paramiko, sys, base64
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
G = base64.b64encode(b'zio:Zio@Admin2026!').decode()
def run(label, cmd, timeout=15):
_, o, _ = c.exec_command(cmd, timeout=timeout)
print(f'\n[{label}]\n' + o.read().decode('utf-8','replace').strip()[:500])
run('Gitea guardia-itsm 최신 커밋',
f'curl -sf "http://127.0.0.1:9003/api/v1/repos/zio/guardia-itsm/commits?limit=3" '
f'-H "Authorization: Basic {G}" 2>/dev/null | '
'python3 -c "import sys,json; [print(c[\'sha\'][:8], c[\'commit\'][\'message\'][:60]) for c in json.load(sys.stdin)]" 2>/dev/null')
run('Gitea P3 파일 확인',
f'curl -sf "http://127.0.0.1:9003/api/v1/repos/zio/guardia-itsm/contents/routers" '
f'-H "Authorization: Basic {G}" 2>/dev/null | '
'python3 -c "import sys,json; files=[f[\'name\'] for f in json.load(sys.stdin)]; '
'p3=[f for f in files if any(k in f for k in [\'multimodal\',\'learning\',\'billing\',\'benchmark\',\'ncloud\',\'cohort\',\'erp\',\'kakao\',\'servicenow\',\'auto_report\',\'ai_insights\',\'container_alerts\'])]; '
'print(f\'P3 파일 {len(p3)}개:\'); [print(\' \',f) for f in p3]" 2>/dev/null')
c.close()

View File

@ -0,0 +1,17 @@
import paramiko, sys
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
def run(label, cmd, timeout=15):
_, o, _ = c.exec_command(cmd, timeout=timeout)
print(f'\n[{label}]\n' + o.read().decode('utf-8','replace').strip()[:400])
run('www GuardiaDetail 파일',
'ls -lh /var/www/zioinfo/assets/GuardiaDetail*.js | sort -k6,7')
run('www index.html 날짜',
'stat /var/www/zioinfo/index.html | grep Modify')
run('backend static GuardiaDetail',
'ls -lh /opt/zioinfo/src/backend/src/main/resources/static/assets/GuardiaDetail*.js')
run('서비스 상태', 'systemctl is-active zioinfo')
run('API 응답', 'curl -sf -o /dev/null -w "HTTP %{http_code}" https://localhost:8443/solution/guardia -k 2>/dev/null || curl -sf -o /dev/null -w "HTTP %{http_code}" http://localhost:8082/solution/guardia 2>/dev/null')
c.close()

View File

@ -0,0 +1,82 @@
"""GUARDiA P3 배포 완료 검증"""
import paramiko, sys, time
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
sftp = c.open_sftp()
verify = """
import urllib.request, json, asyncio, sys
sys.path.insert(0, '/opt/guardia/app')
# 1. API 전체 엔드포인트 수 + P3 확인
d = json.loads(urllib.request.urlopen("http://localhost:9001/openapi.json", timeout=10).read())
paths = sorted(d["paths"].keys())
all_kw = {
"P1": ["/api/rag","/api/jira","/api/kpi","/api/portal","/api/bi/","/api/workflow"],
"P2": ["/api/k8s","/api/sso","/api/predict","/api/slack","/api/brand"],
"P3": ["/api/multimodal","/api/learn","/api/insights","/api/container-alerts",
"/api/ncloud","/api/billing","/api/servicenow","/api/erp",
"/api/kakao","/api/auto-report","/api/benchmark","/api/cohort"],
}
print(f"=== API 엔드포인트 ===")
print(f"전체: {len(paths)}")
for phase, kws in all_kw.items():
matched = [p for p in paths if any(k in p for k in kws)]
print(f"{phase}: {len(matched)}")
# 2. DB 테이블 확인
from database import engine
from sqlalchemy import text
P3_TABLES = [
'tb_learning_run','tb_container_alert_rule','tb_container_alert_log',
'tb_ncloud_config','tb_subscription','tb_invoice',
'tb_servicenow_config','tb_servicenow_mapping','tb_erp_config',
'tb_kakao_config','tb_kakao_notify_log','tb_report_record',
'tb_report_schedule','tb_benchmark_contrib',
]
async def check_tables():
print("\\n=== DB 테이블 (P3) ===")
async with engine.connect() as conn:
for t in P3_TABLES:
try:
await conn.execute(text(f"SELECT COUNT(*) FROM {t}"))
print(f"{t}")
except Exception as e:
print(f"{t}: {str(e)[:50]}")
asyncio.run(check_tables())
# 3. 서비스 상태
import subprocess
result = subprocess.run(['systemctl','is-active','guardia'], capture_output=True, text=True)
print(f"\\n=== 서비스 상태 ===")
print(f"guardia: {result.stdout.strip()}")
# 4. 라우터 파일 존재 확인
import os
P3_ROUTERS = [
'multimodal','learning_loop','ai_insights','container_alerts','ncloud',
'billing','servicenow','erp_connector','kakao_notify',
'auto_report','benchmark','cohort_analysis',
]
print("\\n=== 라우터 파일 ===")
for r in P3_ROUTERS:
path = f'/opt/guardia/app/routers/{r}.py'
status = '' if os.path.exists(path) else '❌ 없음'
print(f" {status} {r}.py")
print("\\n=== 검증 완료 ===")
"""
with sftp.open('/tmp/verify_p3_final.py', 'w') as f: f.write(verify)
def run(label, cmd, timeout=20):
_, o, _ = c.exec_command(cmd, timeout=timeout)
print(f'\n[{label}]\n' + o.read().decode('utf-8','replace').strip()[:800])
run('P3 배포 검증',
'cd /opt/guardia/app && /opt/guardia/venv/bin/python3 /tmp/verify_p3_final.py 2>&1; rm /tmp/verify_p3_final.py')
sftp.close(); c.close()

View File

@ -0,0 +1,22 @@
import paramiko, sys, time
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
def run(label, cmd, timeout=30):
print(f'\n[{label}]')
_, o, _ = c.exec_command(cmd, timeout=timeout)
print(o.read().decode('utf-8','replace').strip()[:400])
# backend static → www 강제 복사 (rsync 방식)
run('강제 복사',
'rsync -a --update /opt/zioinfo/src/backend/src/main/resources/static/. /var/www/zioinfo/ && '
'echo "완료"')
run('GuardiaDetail CentRZHt 확인',
'ls -lh /var/www/zioinfo/assets/GuardiaDetail*.js | sort -k8 -r | head -3')
run('index.html 업데이트 확인',
'grep -o "GuardiaDetail[^\"]*" /var/www/zioinfo/index.html | head -2')
run('서비스 재시작', 'systemctl restart zioinfo && sleep 3 && systemctl is-active zioinfo')
c.close()
print('\n완료')

View File

@ -0,0 +1,74 @@
"""P2 배포 마무리: DB 테이블 + 서비스 재시작 + 검증"""
import paramiko, sys, time
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
sftp = c.open_sftp()
def run(label, cmd, timeout=30):
print(f'\n[{label}]')
_, o, _ = c.exec_command(cmd, timeout=timeout)
print(o.read().decode('utf-8','replace').strip()[:500])
# DB 테이블 생성 (서버에서 스크립트 실행)
db_script = """
import asyncio
import sys
sys.path.insert(0, '/opt/guardia/app')
from database import engine, Base
from models import K8sCluster, SSOConfig, SSOSession, SlackConfig, TenantBranding
async def create_tables():
async with engine.begin() as conn:
await conn.run_sync(Base.metadata.create_all)
print('테이블 생성 완료')
asyncio.run(create_tables())
"""
with sftp.open('/tmp/create_tables.py', 'w') as f: f.write(db_script)
run('DB 테이블 생성',
'cd /opt/guardia/app && /opt/guardia/venv/bin/python3 /tmp/create_tables.py 2>&1; rm /tmp/create_tables.py')
# 포트 정리 + 서비스 재시작
run('포트 정리 + 재시작',
'fuser -k 9001/tcp 2>/dev/null || true; sleep 1; systemctl restart guardia && sleep 6 && systemctl is-active guardia')
time.sleep(4)
# 검증 스크립트
verify_script = """
import asyncio, sys, json, urllib.request
sys.path.insert(0, '/opt/guardia/app')
# API 엔드포인트 확인
try:
d = json.loads(urllib.request.urlopen("http://localhost:9001/openapi.json", timeout=10).read())
paths = sorted(d["paths"].keys())
keywords = ["/api/k8s", "/api/sso", "/api/predict", "/api/slack", "/api/brand"]
new_paths = [p for p in paths if any(k in p for k in keywords)]
print(f"P2 신규 엔드포인트: {len(new_paths)}개 / 전체: {len(paths)}")
for p in new_paths: print(" ", p)
except Exception as e:
print(f"API 확인 실패: {e}")
# DB 테이블 확인
from database import engine
from sqlalchemy import text
async def check():
tables = ['tb_k8s_cluster', 'tb_sso_config', 'tb_slack_config', 'tb_tenant_branding']
async with engine.connect() as conn:
for t in tables:
try:
await conn.execute(text(f"SELECT COUNT(*) FROM {t}"))
print(f" {t}: OK")
except Exception as e:
print(f" {t}: {str(e)[:50]}")
asyncio.run(check())
"""
with sftp.open('/tmp/verify_p2.py', 'w') as f: f.write(verify_script)
run('최종 검증',
'cd /opt/guardia/app && /opt/guardia/venv/bin/python3 /tmp/verify_p2.py 2>&1; rm /tmp/verify_p2.py')
sftp.close(); c.close()
print('\n=== P2 배포 완료 ===')

View File

@ -0,0 +1,80 @@
"""수정된 파일 재배포"""
import paramiko, sys, time
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
sftp = c.open_sftp()
def run(label, cmd, timeout=30):
print(f'\n[{label}]')
_, o, _ = c.exec_command(cmd, timeout=timeout)
print(o.read().decode('utf-8','replace').strip()[:400])
BASE = 'C:/GUARDiA/workspace/guardia-itsm'
FIXED = ['dependency_map', 'config_inventory', 'drift_detection', 'auto_remediation']
for fn in FIXED:
sftp.put(f'{BASE}/routers/{fn}.py', f'/opt/guardia/app/routers/{fn}.py')
print(f'{fn}.py')
sftp.put(f'{BASE}/models.py', '/opt/guardia/app/models.py')
sftp.put(f'{BASE}/main.py', '/opt/guardia/app/main.py')
print(' ✅ models.py, main.py')
# ProcurementRecord 테이블 추가
db_script = """
import asyncio, sys
sys.path.insert(0, '/opt/guardia/app')
from database import engine, Base
from models import ProcurementRecord
async def create():
async with engine.begin() as conn:
await conn.run_sync(Base.metadata.create_all)
print('ProcurementRecord 테이블 생성 완료')
asyncio.run(create())
"""
with sftp.open('/tmp/create_proc.py', 'w') as f: f.write(db_script)
run('DB 테이블', 'cd /opt/guardia/app && /opt/guardia/venv/bin/python3 /tmp/create_proc.py 2>&1; rm /tmp/create_proc.py')
# 임포트 재검증
test = """
import sys; sys.path.insert(0, '/opt/guardia/app')
import importlib, traceback
fails = []
for r in ['dependency_map','config_inventory','drift_detection','auto_remediation','narasajang','e_procurement']:
try:
importlib.import_module(f'routers.{r}')
print(f'{r}: OK')
except Exception as e:
fails.append(r)
print(f'{r}: FAIL - {str(e)[:100]}')
try:
import main; print('main: OK')
except Exception as e:
print(f'main: FAIL - {str(e)[:100]}')
"""
with sftp.open('/tmp/retest.py', 'w') as f: f.write(test)
run('임포트 재검증', 'cd /opt/guardia/app && /opt/guardia/venv/bin/python3 /tmp/retest.py 2>&1; rm /tmp/retest.py')
run('서비스 재시작',
'fuser -k 9001/tcp 2>/dev/null || true; sleep 2; systemctl restart guardia && sleep 8 && systemctl is-active guardia')
time.sleep(5)
verify = """
import urllib.request, json
try:
d = json.loads(urllib.request.urlopen("http://localhost:9001/openapi.json", timeout=10).read())
paths = sorted(d["paths"].keys())
adv_kw = ["/api/autodiscovery","/api/snmp","/api/depmap","/api/inventory","/api/nlquery",
"/api/assistant","/api/queryhistory","/api/drift","/api/goldenconfig","/api/remediation",
"/api/multicloud","/api/aws","/api/costopt","/api/migration",
"/api/narasajang","/api/pubapi","/api/isp","/api/netzone","/api/kcloud","/api/eprocure"]
adv = [p for p in paths if any(k in p for k in adv_kw)]
print(f"전체: {len(paths)}개 / 고급확장: {len(adv)}")
except Exception as e:
print(f"API 확인 실패: {e}")
"""
with sftp.open('/tmp/v2.py', 'w') as f: f.write(verify)
run('최종 검증', 'python3 /tmp/v2.py 2>&1; rm /tmp/v2.py', timeout=20)
sftp.close(); c.close()
print('\n=== 완료 ===')

View File

@ -0,0 +1,69 @@
"""ForeignKey 수정 후 재배포 + P2 라우터 활성화"""
import paramiko, sys, time
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
sftp = c.open_sftp()
def run(label, cmd, timeout=30):
print(f'\n[{label}]')
_, o, _ = c.exec_command(cmd, timeout=timeout)
print(o.read().decode('utf-8','replace').strip()[:400])
# 1. 수정된 models.py 업로드
sftp.put('C:/GUARDiA/workspace/guardia-itsm/models.py', '/opt/guardia/app/models.py')
print('✅ models.py 업로드')
# 2. P2 라우터 활성화 (주석 해제)
run('P2 라우터 활성화',
r"""sed -i 's/^#from routers import kubernetes/from routers import kubernetes/' /opt/guardia/app/main.py
sed -i 's/^#app.include_router(kubernetes/app.include_router(kubernetes/' /opt/guardia/app/main.py
sed -i 's/^#app.include_router(sso_provider/app.include_router(sso_provider/' /opt/guardia/app/main.py
sed -i 's/^#app.include_router(predictive_ops/app.include_router(predictive_ops/' /opt/guardia/app/main.py
sed -i 's/^#app.include_router(slack_connector/app.include_router(slack_connector/' /opt/guardia/app/main.py
sed -i 's/^#app.include_router(white_label/app.include_router(white_label/' /opt/guardia/app/main.py
echo "완료"
grep -c "include_router" /opt/guardia/app/main.py""")
# 3. DB 테이블 생성
db_script = """
import asyncio, sys
sys.path.insert(0, '/opt/guardia/app')
from database import engine, Base
from models import K8sCluster, SSOConfig, SSOSession, SlackConfig, TenantBranding
async def create():
async with engine.begin() as conn:
await conn.run_sync(Base.metadata.create_all)
print('테이블 생성 완료')
asyncio.run(create())
"""
with sftp.open('/tmp/create_tables.py', 'w') as f: f.write(db_script)
run('DB 테이블 생성',
'cd /opt/guardia/app && /opt/guardia/venv/bin/python3 /tmp/create_tables.py 2>&1; rm /tmp/create_tables.py',
timeout=30)
# 4. 포트 정리 + 재시작
run('포트 kill + 재시작',
'fuser -k 9001/tcp 2>/dev/null || true; sleep 2; systemctl restart guardia && sleep 8 && systemctl is-active guardia')
time.sleep(5)
# 5. 검증
verify = """
import urllib.request, json
d = json.loads(urllib.request.urlopen("http://localhost:9001/openapi.json", timeout=10).read())
paths = sorted(d["paths"].keys())
p1_kw = ["/api/rag","/api/jira","/api/kpi","/api/portal","/api/bi/","/api/workflow"]
p2_kw = ["/api/k8s","/api/sso","/api/predict","/api/slack","/api/brand"]
p1 = [p for p in paths if any(k in p for k in p1_kw)]
p2 = [p for p in paths if any(k in p for k in p2_kw)]
print(f"전체: {len(paths)}개, P1: {len(p1)}개, P2: {len(p2)}")
print("P2 경로:")
for p in p2: print(" ", p)
"""
with sftp.open('/tmp/verify.py', 'w') as f: f.write(verify)
run('최종 검증', 'python3 /tmp/verify.py 2>&1; rm /tmp/verify.py', timeout=20)
sftp.close(); c.close()
print('\n=== 완료 ===')

View File

@ -0,0 +1,25 @@
import paramiko, sys
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
def run(label, cmd, timeout=30):
print(f'\n[{label}]')
_, o, _ = c.exec_command(cmd, timeout=timeout)
print(o.read().decode('utf-8','replace').strip()[:500])
# backend static에 실제로 있는지 확인
run('backend static assets 최신',
'ls -lh /opt/zioinfo/src/backend/src/main/resources/static/assets/GuardiaDetail*.js | sort -k6,7 -r | head -5')
# 직접 새 파일만 복사
run('새 파일 직접 복사',
'cp /opt/zioinfo/src/backend/src/main/resources/static/assets/GuardiaDetail-CentRZHt.js /var/www/zioinfo/assets/ && '
'cp /opt/zioinfo/src/backend/src/main/resources/static/index.html /var/www/zioinfo/index.html && '
'echo "복사 완료"')
run('복사 후 확인',
'ls -lh /var/www/zioinfo/assets/GuardiaDetail-CentRZHt.js && '
'grep -o "GuardiaDetail[^\"]*js" /var/www/zioinfo/index.html | head -2')
c.close()

View File

@ -0,0 +1,28 @@
import paramiko, tarfile, io, os, sys
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
sftp = c.open_sftp()
def run(label, cmd, timeout=30):
print(f'[{label}]')
_, o, _ = c.exec_command(cmd, timeout=timeout)
print(o.read().decode('utf-8','replace').strip()[:300])
dist = 'C:/GUARDiA/workspace/guardia-manager/dist'
buf = io.BytesIO()
with tarfile.open(fileobj=buf, mode='w:gz') as tar:
for root, dirs, files in os.walk(dist):
dirs[:] = [d for d in dirs if d not in ('.git', 'node_modules')]
for fn in files:
fp = os.path.join(root, fn)
tar.add(fp, arcname=os.path.relpath(fp, dist))
buf.seek(0)
sftp.putfo(buf, '/tmp/mgr_new.tar.gz')
print('전송 완료')
run('www 배포', 'mkdir -p /var/www/manager && cd /var/www/manager && tar -xzf /tmp/mgr_new.tar.gz && rm /tmp/mgr_new.tar.gz && stat index.html 2>/dev/null | grep Modify')
run('재시작', 'systemctl restart guardia-manager && sleep 3 && systemctl is-active guardia-manager')
sftp.close(); c.close()
print('완료')

View File

@ -0,0 +1,105 @@
"""deploy_server.py 구조 파악 후 zioinfo-mail 올바르게 추가"""
import paramiko, sys, re, ast
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
sftp = c.open_sftp()
def run(label, cmd, timeout=20):
print(f'\n[{label}]')
_, o, _ = c.exec_command(cmd, timeout=timeout)
out = o.read().decode('utf-8','replace').strip()
if out: print(out[:500])
return out
# 1. webhook 서버 상태 확인 + 포트 fix
run('webhook 상태', 'fuser -k 9999/tcp 2>/dev/null; systemctl restart zioinfo-deploy && sleep 3 && systemctl is-active zioinfo-deploy')
# 2. deploy_server.py 구조 파악
run('elif repo 블록 전체',
"grep -n 'elif repo\|if repo\|run_steps\|notify_itsm' /opt/zioinfo/deploy_server.py | head -30")
# 3. 파일 다운로드
sftp.get('/opt/zioinfo/deploy_server.py', 'C:/GUARDiA/_ds_work.py')
with open('C:/GUARDiA/_ds_work.py', encoding='utf-8') as f:
content = f.read()
lines = content.split('\n')
# 들여쓰기 파악
elif_line = None
notify_line = None
for i, line in enumerate(lines):
if 'elif repo ==' in line and elif_line is None:
elif_line = i
print(f'\n첫 elif repo 줄 {i+1}: {repr(line[:60])}')
if 'notify_itsm' in line and notify_line is None:
notify_line = i
print(f'첫 notify_itsm 줄 {i+1}: {repr(line[:60])}')
# elif 들여쓰기 계산
elif_indent = ''
if elif_line is not None:
elif_indent = lines[elif_line][:len(lines[elif_line]) - len(lines[elif_line].lstrip())]
print(f'\nelif 들여쓰기: {len(elif_indent)}')
# 마지막 notify_itsm 줄 찾기 (삽입 위치)
last_notify = None
for i in range(len(lines)-1, 0, -1):
if 'notify_itsm' in lines[i] and lines[i].strip():
last_notify = i
print(f'\n마지막 notify_itsm: 줄 {i+1}: {repr(lines[i][:70])}')
print(f'다음 줄 {i+2}: {repr(lines[i+1][:70]) if i+1 < len(lines) else "(EOF)"}')
break
# 4. 삽입
if last_notify is not None:
# 마지막 notify_itsm 다음 줄에 삽입
# 단 if __name__ 블록 바깥인지 확인
inner = elif_indent + ' '
MAIL_BLOCK = f'''
{elif_indent}elif repo == "zioinfo-mail":
{inner}SRC = "/opt/mail"
{inner}ok = run_steps(repo, [
{inner} ("git pull", ["bash", "-c",
{inner} "[ -d /opt/mail/src/.git ] && git -C /opt/mail/src fetch origin main && git -C /opt/mail/src reset --hard origin/main"
{inner} " || git clone 'http://zio:Zio%40Admin2026%21@127.0.0.1:9003/zio/zioinfo-mail.git' /opt/mail/src"]),
{inner} ("npm build", ["bash", "-c",
{inner} "cd /opt/mail/src/frontend && npm ci --legacy-peer-deps 2>/dev/null || npm install --legacy-peer-deps && npm run build"]),
{inner} ("copy dist", ["bash", "-c",
{inner} "mkdir -p /var/www/mail && cp -r /opt/mail/src/dist/. /var/www/mail/"]),
{inner} ("pip install", ["bash", "-c",
{inner} "/opt/mail/venv/bin/pip install -r /opt/mail/src/backend/requirements.txt -q"]),
{inner} ("rsync", ["bash", "-c",
{inner} "rsync -a --exclude=__pycache__ --exclude=.git --exclude='*.pyc' --exclude='.env' /opt/mail/src/backend/ /opt/mail/backend/"]),
{inner} ("restart", ["systemctl", "restart", "zioinfo-mail"]),
{inner} ("health check", ["bash", "-c", "sleep 4 && curl -sf http://localhost:8026/health"]),
{inner}])
{inner}if ok:
{inner} notify_itsm(True, "\\u2705 zioinfo-mail \\ubc30\\ud3ec \\uc644\\ub8cc")
{inner}else:
{inner} notify_itsm(False, "\\u274c zioinfo-mail \\ube4c\\ub4dc \\uc2e4\\ud328")'''
lines.insert(last_notify + 1, MAIL_BLOCK)
new_content = '\n'.join(lines)
try:
ast.parse(new_content)
print('\n✅ 문법 OK')
with sftp.open('/opt/zioinfo/deploy_server.py', 'w') as f:
f.write(new_content)
print('서버에 업로드 완료')
except SyntaxError as e:
print(f'\n❌ 문법 오류: {e}')
# 오류 컨텍스트
err_lines = new_content.split('\n')
for x in range(max(0, e.lineno-3), min(len(err_lines), e.lineno+3)):
print(f' {x+1}: {repr(err_lines[x][:70])}')
run('최종 문법 확인', 'python3 -m py_compile /opt/zioinfo/deploy_server.py && echo "" || echo ""')
run('zioinfo-mail 확인', "grep -n 'elif repo.*zioinfo-mail' /opt/zioinfo/deploy_server.py")
run('webhook 재시작', 'systemctl restart zioinfo-deploy && sleep 3 && systemctl is-active zioinfo-deploy')
import os
try: os.remove('C:/GUARDiA/_ds_work.py')
except: pass
sftp.close(); c.close()

View File

@ -0,0 +1,145 @@
"""deploy_server.py 로컬에서 직접 수정"""
import paramiko, sys
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
sftp = c.open_sftp()
# 파일 다운로드
sftp.get('/opt/zioinfo/deploy_server.py', 'C:/GUARDiA/_deploy_server_backup.py')
print('다운로드 완료')
with open('C:/GUARDiA/_deploy_server_backup.py', encoding='utf-8', errors='replace') as f:
lines = f.readlines()
print(f'{len(lines)}')
# 구조 파악: elif repo == 패턴 찾기
for i, line in enumerate(lines):
if 'elif repo ==' in line or 'if repo ==' in line:
print(f' {i+1}: {repr(line.rstrip()[:60])}')
print()
# zioinfo-mail 관련 모든 줄 범위 찾기
mail_ranges = []
i = 0
while i < len(lines):
if 'elif repo == "zioinfo-mail"' in lines[i] or 'zioinfo-mail' in lines[i] and 'elif' in lines[i]:
start = i
# 다음 elif 또는 if __name__ 또는 def 까지
j = i + 1
while j < len(lines):
stripped = lines[j].strip()
# 같은 들여쓰기 수준의 elif/else/if __name__/def
indent = len(lines[i]) - len(lines[i].lstrip())
line_indent = len(lines[j]) - len(lines[j].lstrip())
if stripped and line_indent <= indent and (
stripped.startswith('elif ') or
stripped.startswith('else:') or
stripped.startswith('if __name__') or
(stripped.startswith('def ') and line_indent == 0)
):
break
j += 1
mail_ranges.append((start, j))
i = j
else:
i += 1
print(f'zioinfo-mail 블록 범위: {mail_ranges}')
# 모든 zioinfo-mail 블록 제거
to_remove = set()
for start, end in mail_ranges:
for x in range(start, end):
to_remove.add(x)
clean_lines = [l for i, l in enumerate(lines) if i not in to_remove]
print(f'제거 후: {len(clean_lines)}줄 (제거: {len(to_remove)}줄)')
# 마지막 elif repo 블록의 마지막 줄 찾기 (삽입 위치)
insert_idx = None
for i in range(len(clean_lines)-1, 0, -1):
line = clean_lines[i]
if 'notify_itsm' in line and line.startswith(' '): # 12칸 들여쓰기
insert_idx = i + 1
break
# 삽입 전 컨텍스트
if insert_idx:
print(f'\n삽입 위치: {insert_idx}')
for x in range(max(0, insert_idx-3), min(len(clean_lines), insert_idx+2)):
print(f' {x+1}: {repr(clean_lines[x].rstrip()[:70])}')
# 현재 들여쓰기 스타일 파악 (elif repo 줄의 들여쓰기)
elif_indent = ' ' # 기본 8칸
for line in clean_lines:
if 'elif repo ==' in line:
elif_indent = line[:len(line) - len(line.lstrip())]
break
print(f'\n들여쓰기: {repr(elif_indent)}')
inner = elif_indent + ' '
MAIL_BLOCK = f'''{elif_indent}elif repo == "zioinfo-mail":
{inner}SRC = "/opt/mail"
{inner}ok = run_steps(repo, [
{inner} ("git pull", ["bash", "-c",
{inner} "[ -d /opt/mail/src/.git ] && git -C /opt/mail/src fetch origin main && git -C /opt/mail/src reset --hard origin/main"
{inner} " || git clone 'http://zio:Zio%40Admin2026%21@127.0.0.1:9003/zio/zioinfo-mail.git' /opt/mail/src"]),
{inner} ("npm build", ["bash", "-c",
{inner} "cd /opt/mail/src/frontend && npm ci --legacy-peer-deps 2>/dev/null || npm install --legacy-peer-deps && npm run build"]),
{inner} ("copy dist", ["bash", "-c",
{inner} "mkdir -p /var/www/mail && cp -r /opt/mail/src/dist/. /var/www/mail/"]),
{inner} ("pip install", ["bash", "-c",
{inner} "/opt/mail/venv/bin/pip install -r /opt/mail/src/backend/requirements.txt -q"]),
{inner} ("rsync", ["bash", "-c",
{inner} "rsync -a --exclude=__pycache__ --exclude=.git --exclude='*.pyc' --exclude='.env' /opt/mail/src/backend/ /opt/mail/backend/"]),
{inner} ("restart", ["systemctl", "restart", "zioinfo-mail"]),
{inner} ("health check", ["bash", "-c", "sleep 4 && curl -sf http://localhost:8026/health"]),
{inner}])
{inner}if ok:
{inner} notify_itsm(True, "\\u2705 zioinfo-mail \\ubc30\\ud3ec \\uc644\\ub8cc")
{inner}else:
{inner} notify_itsm(False, "\\u274c zioinfo-mail \\ube4c\\ub4dc \\uc2e4\\ud328")
'''
if insert_idx:
clean_lines.insert(insert_idx, MAIL_BLOCK)
else:
clean_lines.append(MAIL_BLOCK)
# 파일 저장 (로컬)
new_content = ''.join(clean_lines)
# 문법 검사
import ast
try:
ast.parse(new_content)
print('\n✅ 문법 OK')
except SyntaxError as e:
print(f'\n❌ 문법 오류: {e}')
# 오류 위치 주변 표시
error_lines = new_content.split('\n')
for x in range(max(0, e.lineno-3), min(len(error_lines), e.lineno+2)):
print(f' {x+1}: {error_lines[x][:70]}')
import sys; sys.exit(1)
# 서버에 업로드
with sftp.open('/opt/zioinfo/deploy_server.py', 'w') as f:
f.write(new_content)
print('업로드 완료')
def run(label, cmd, timeout=20):
print(f'\n[{label}]')
_, o, _ = c.exec_command(cmd, timeout=timeout)
print(o.read().decode('utf-8','replace').strip()[:400])
run('최종 문법 확인', 'python3 -m py_compile /opt/zioinfo/deploy_server.py && echo "✅ OK" || echo "❌ FAIL"')
run('zioinfo-mail 블록 확인', "grep -n 'elif repo.*zioinfo-mail' /opt/zioinfo/deploy_server.py")
run('포트 kill + 재시작',
'fuser -k 9999/tcp 2>/dev/null; sleep 1; '
'systemctl restart zioinfo-deploy && sleep 3 && systemctl is-active zioinfo-deploy')
sftp.close(); c.close()

View File

@ -0,0 +1,90 @@
"""deploy_server.py 완전 수정: 올바른 위치에 zioinfo-mail 삽입"""
import paramiko, sys
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
sftp = c.open_sftp()
def run(label, cmd, timeout=20):
print(f'\n[{label}]')
_, o, _ = c.exec_command(cmd, timeout=timeout)
print(o.read().decode('utf-8','replace').strip()[:500])
# 전체 파일 다운로드
_, o, _ = c.exec_command('cat /opt/zioinfo/deploy_server.py', timeout=15)
content = o.read().decode('utf-8', 'replace')
# 모든 zioinfo-mail 관련 코드 제거
import re
# elif repo == "zioinfo-mail": 블록부터 다음 elif/def/if __name__ 전까지 전부 제거
content = re.sub(
r'\n[ \t]*elif repo == "zioinfo-mail":.*?(?=\n[ \t]*elif |\n[ \t]*else:|\nif __name__|$)',
'',
content,
flags=re.DOTALL
)
print(f'[정리 후 zioinfo-mail 잔존]\n{"있음 (추가 정리 필요)" if "zioinfo-mail" in content else "없음 ✅"}')
# 올바른 삽입 위치: WebhookHandler.do_POST 내부 if/elif 체인
# 패턴: "elif repo == "guardia-messenger":" 또는 마지막 notify_itsm 블록 다음
# deploy_server.py 구조상 WebhookHandler 클래스 내부에 있어야 함
# "guardia-messenger" 블록의 끝(notify_itsm 호출 직후) 찾기
lines = content.split('\n')
insert_idx = None
for i in range(len(lines)-1, 0, -1):
line = lines[i].strip()
# guardia-messenger 또는 guardia-docs notify_itsm 이후 위치 찾기
if 'notify_itsm' in line and i > 100:
# 이 줄이 클래스/함수 내부인지 확인 (들여쓰기 확인)
if lines[i].startswith(' '): # 8칸 들여쓰기 = 클래스 메서드 내부
insert_idx = i + 1
break
print(f'[삽입 위치]\n라인 {insert_idx}: {lines[insert_idx].strip()[:60] if insert_idx and insert_idx < len(lines) else "없음"}')
# 적절한 들여쓰기로 zioinfo-mail 블록 생성
MAIL_BLOCK = ''' elif repo == "zioinfo-mail":
SRC = "/opt/mail"
ok = run_steps(repo, [
("git pull", ["bash", "-c",
"[ -d /opt/mail/src/.git ] && git -C /opt/mail/src fetch origin main && git -C /opt/mail/src reset --hard origin/main"
" || git clone 'http://zio:Zio%40Admin2026%21@127.0.0.1:9003/zio/zioinfo-mail.git' /opt/mail/src"]),
("npm build", ["bash", "-c",
"cd /opt/mail/src/frontend && npm ci --legacy-peer-deps 2>/dev/null || npm install --legacy-peer-deps && npm run build"]),
("copy dist", ["bash", "-c",
"mkdir -p /var/www/mail && cp -r /opt/mail/src/dist/. /var/www/mail/"]),
("pip install", ["bash", "-c",
"/opt/mail/venv/bin/pip install -r /opt/mail/src/backend/requirements.txt -q"]),
("rsync", ["bash", "-c",
"rsync -a --exclude=__pycache__ --exclude=.git --exclude=\'*.pyc\' --exclude=\'.env\' /opt/mail/src/backend/ /opt/mail/backend/"]),
("restart", ["systemctl", "restart", "zioinfo-mail"]),
("health check", ["bash", "-c", "sleep 4 && curl -sf http://localhost:8026/health"]),
])
if ok:
notify_itsm(True, "\\u2705 zioinfo-mail \\ubc30\\ud3ec \\uc644\\ub8cc")
else:
notify_itsm(False, "\\u274c zioinfo-mail \\ube4c\\ub4dc \\uc2e4\\ud328")'''
if insert_idx:
lines.insert(insert_idx, MAIL_BLOCK)
new_content = '\n'.join(lines)
else:
# 찾지 못한 경우: 마지막 elif repo 블록 후에 직접 삽입
new_content = content.rstrip() + '\n' + MAIL_BLOCK + '\n'
# 파일 저장
with sftp.open('/opt/zioinfo/deploy_server.py', 'w') as f:
f.write(new_content)
run('문법 확인', 'python3 -m py_compile /opt/zioinfo/deploy_server.py && echo "✅ OK" || echo "❌ FAIL"')
run('zioinfo-mail 라인 확인', "grep -n 'elif repo.*zioinfo-mail\\|run_steps.*mail' /opt/zioinfo/deploy_server.py | head -5")
# webhook 재시작
run('포트 9999 kill + 재시작',
'fuser -k 9999/tcp 2>/dev/null; sleep 1; '
'systemctl restart zioinfo-deploy && sleep 3 && systemctl is-active zioinfo-deploy')
sftp.close(); c.close()

View File

@ -0,0 +1,111 @@
"""deploy_server.py 문법 오류 수정 + zioinfo-mail 블록 올바르게 추가"""
import paramiko, sys, json
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
sftp = c.open_sftp()
def run(label, cmd, timeout=20):
print(f'\n[{label}]')
_, o, _ = c.exec_command(cmd, timeout=timeout)
print(o.read().decode('utf-8','replace').strip()[:600])
# 1. 현재 문법 오류 위치 확인
run('오류 위치', 'python3 -c "import ast; ast.parse(open(\'/opt/zioinfo/deploy_server.py\').read())" 2>&1')
run('195~210줄', "sed -n '195,210p' /opt/zioinfo/deploy_server.py")
# 2. 현재 파일 다운로드 후 수정
_, o, _ = c.exec_command('cat /opt/zioinfo/deploy_server.py', timeout=15)
content = o.read().decode('utf-8','replace')
# 잘못 삽입된 zioinfo-mail 블록 제거 후 올바르게 다시 삽입
import re
# 잘못된 블록 완전 제거 (여러 패턴)
# 패턴: elif repo == "zioinfo-mail": 이후 다음 elif/else/함수 전까지
content_clean = re.sub(
r'\n\s*elif repo == "zioinfo-mail":.*?(?=\n\s*elif |\n\s*else:|\ndef |\nclass |\n# ──)',
'',
content,
flags=re.DOTALL
)
print(f'\n[제거 후 zioinfo-mail 존재 여부]\n{"있음" if "zioinfo-mail" in content_clean else "없음"}')
# 올바른 위치 찾기: guardia-docs elif 블록 끝 다음에 삽입
# run_steps 패턴의 블록 구조를 따라야 함
MAIL_BLOCK = '''
elif repo == "zioinfo-mail":
SRC = "/opt/mail"
ok = run_steps(repo, [
("git pull", ["bash", "-c",
"[ -d /opt/mail/src/.git ] && git -C /opt/mail/src fetch origin main && git -C /opt/mail/src reset --hard origin/main"
" || git clone 'http://zio:Zio%40Admin2026%21@127.0.0.1:9003/zio/zioinfo-mail.git' /opt/mail/src"]),
("npm build", ["bash", "-c",
"cd /opt/mail/src/frontend && npm ci --legacy-peer-deps 2>/dev/null || npm install --legacy-peer-deps && npm run build"]),
("copy dist", ["bash", "-c",
"mkdir -p /var/www/mail && cp -r /opt/mail/src/dist/. /var/www/mail/"]),
("pip install", ["bash", "-c",
"/opt/mail/venv/bin/pip install -r /opt/mail/src/backend/requirements.txt -q"]),
("rsync", ["bash", "-c",
"rsync -a --exclude=__pycache__ --exclude=.git --exclude='*.pyc' --exclude='.env' /opt/mail/src/backend/ /opt/mail/backend/"]),
("restart", ["systemctl", "restart", "zioinfo-mail"]),
("health check", ["bash", "-c", "sleep 4 && curl -sf http://localhost:8026/health"]),
])
if ok:
notify_itsm(True, "\\u2705 zioinfo-mail \\ubc30\\ud3ec \\uc644\\ub8cc")
else:
notify_itsm(False, "\\u274c zioinfo-mail \\ube4c\\ub4dc \\uc2e4\\ud328")
'''
# guardia-docs 블록 찾기
if 'elif repo == "guardia-docs"' in content_clean:
lines = content_clean.split('\n')
insert_after = None
in_docs = False
depth = 0
for i, line in enumerate(lines):
if 'elif repo == "guardia-docs"' in line:
in_docs = True
depth = 0
elif in_docs:
if line.strip().startswith('if ok') or line.strip().startswith('notify_itsm'):
insert_after = i
elif line.strip() and not line[0].isspace() and not line.startswith(' '):
# 들여쓰기 끝
if insert_after:
break
in_docs = False
if insert_after is None:
# 마지막 elif 블록 후 if ok/notify_itsm 패턴 찾기
for i in range(len(lines)-1, 0, -1):
if 'notify_itsm' in lines[i] and 'guardia' in '\n'.join(lines[max(0,i-5):i]):
insert_after = i
break
if insert_after:
lines.insert(insert_after + 1, MAIL_BLOCK)
content_new = '\n'.join(lines)
print(f' 삽입 위치: 라인 {insert_after + 1}')
else:
# 그냥 마지막에 추가
content_new = content_clean + MAIL_BLOCK
print(' 마지막에 추가')
else:
content_new = content_clean + MAIL_BLOCK
print(' guardia-docs 없음, 마지막에 추가')
# 저장
with sftp.open('/opt/zioinfo/deploy_server.py', 'w') as f:
f.write(content_new)
run('문법 확인', 'python3 -m py_compile /opt/zioinfo/deploy_server.py && echo "OK" || echo "FAIL"')
run('zioinfo-mail 확인', "grep -n 'zioinfo-mail' /opt/zioinfo/deploy_server.py | head -5")
# webhook 서버 재시작
run('포트 kill + 재시작',
'fuser -k 9999/tcp 2>/dev/null; sleep 1; '
'systemctl restart zioinfo-deploy && sleep 3 && systemctl is-active zioinfo-deploy')
sftp.close(); c.close()

View File

@ -0,0 +1,76 @@
"""Jenkinsfile 확인 + webhook 포트 수정 + 재빌드"""
import paramiko, sys, json, base64, time
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
sftp = c.open_sftp()
G = base64.b64encode(b'zio:Zio@Admin2026!').decode()
J = 'http://127.0.0.1:9080'; A = 'admin:Admin@2026!'
def run(label, cmd, timeout=20):
print(f'\n[{label}]')
_, o, _ = c.exec_command(cmd, timeout=timeout)
print(o.read().decode('utf-8','replace').strip()[:500])
return _
# 1. Gitea에 Jenkinsfile 있는지 확인
run('Gitea repo 파일 목록',
f'curl -sf "http://127.0.0.1:9003/api/v1/repos/zio/zioinfo-mail/contents/" '
f'-H "Authorization: Basic {G}" 2>/dev/null | '
'python3 -c "import sys,json; [print(f[\'name\'],f[\'type\']) for f in json.load(sys.stdin)]" 2>/dev/null')
# Jenkinsfile 없으면 다시 업로드
_, o, _ = c.exec_command(
f'curl -sf "http://127.0.0.1:9003/api/v1/repos/zio/zioinfo-mail/contents/Jenkinsfile" '
f'-H "Authorization: Basic {G}" 2>/dev/null | python3 -c "import sys,json; print(json.load(sys.stdin).get(\'sha\',\'\'))" 2>/dev/null', timeout=10)
sha = o.read().decode('utf-8','replace').strip()
if not sha:
print('\nJenkinsfile 없음 → Gitea API로 업로드')
jf = open('C:/GUARDiA/workspace/zioinfo-mail/Jenkinsfile', encoding='utf-8').read()
import base64 as b64
encoded = b64.b64encode(jf.encode('utf-8')).decode()
payload = json.dumps({"message": "ci: add Jenkinsfile", "content": encoded, "branch": "main"})
with sftp.open('/tmp/jf2.json', 'w') as f: f.write(payload)
run('Jenkinsfile 업로드',
f'curl -sf -X POST "http://127.0.0.1:9003/api/v1/repos/zio/zioinfo-mail/contents/Jenkinsfile" '
f'-H "Authorization: Basic {G}" -H "Content-Type: application/json" '
f'--data @/tmp/jf2.json 2>/dev/null | '
'python3 -c "import sys,json; d=json.load(sys.stdin); print(\'OK:\', d.get(\'content\',{}).get(\'name\',\'?\'))" 2>/dev/null')
else:
print(f'\nJenkinsfile SHA: {sha[:8]} → 있음 ✅')
# 2. webhook 서버 포트 충돌 수정
run('webhook 서버 상태', 'systemctl status zioinfo-deploy --no-pager | head -5')
run('포트 9999 kill + 재시작',
'fuser -k 9999/tcp 2>/dev/null; sleep 1; '
'systemctl restart zioinfo-deploy && sleep 3 && systemctl is-active zioinfo-deploy')
# 3. crumb + 재빌드
_, o, _ = c.exec_command(f'curl -sf -u "{A}" {J}/crumbIssuer/api/json 2>/dev/null', timeout=10)
try:
cd = json.loads(o.read().decode('utf-8','replace').strip())
CH = f'{cd["crumbRequestField"]}: {cd["crumb"]}'
except: CH = 'Jenkins-Crumb: x'
run('재빌드 트리거',
f'curl -sf -X POST -u "{A}" -H "{CH}" {J}/job/zioinfo-mail/build 2>/dev/null && echo "트리거됨"')
print('\n빌드 대기 (90초)...')
for i in range(18):
time.sleep(5)
_, o2, _ = c.exec_command(
f'curl -sf -u "{A}" {J}/job/zioinfo-mail/lastBuild/api/json 2>/dev/null', timeout=10)
try:
d = json.loads(o2.read().decode('utf-8','replace'))
building = d.get('building', True)
result = d.get('result', '진행중')
num = d.get('number', '?')
print(f' #{num}: {result} building={building}')
if not building: break
except: pass
run('콘솔 로그 (마지막 20줄)',
f'curl -sf -u "{A}" {J}/job/zioinfo-mail/lastBuild/consoleText 2>/dev/null | tail -20')
sftp.close(); c.close()

View File

@ -0,0 +1,131 @@
"""zioinfo-mail Gitea repo 올바른 소스로 재설정 + webhook 서버 수정"""
import paramiko, sys, json, base64, time, os, shutil, subprocess, tempfile
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
sftp = c.open_sftp()
G = base64.b64encode(b'zio:Zio@Admin2026!').decode()
J = 'http://127.0.0.1:9080'; JA = 'admin:Admin@2026!'
def run(label, cmd, timeout=30):
print(f'\n[{label}]')
_, o, _ = c.exec_command(cmd, timeout=timeout)
print(o.read().decode('utf-8','replace').strip()[:500])
# ── 1. deploy_server.py 문법 오류 확인 ────────────────────────
run('deploy_server 문법 확인', 'python3 -m py_compile /opt/zioinfo/deploy_server.py && echo OK || echo FAIL')
run('deploy_server 오류 상세', 'python3 /opt/zioinfo/deploy_server.py --check 2>&1 | head -5 || python3 -c "import ast; ast.parse(open(\'/opt/zioinfo/deploy_server.py\').read()); print(\'syntax ok\')" 2>&1')
run('포트 9999', 'fuser -k 9999/tcp 2>/dev/null; sleep 1; systemctl restart zioinfo-deploy && sleep 3 && systemctl is-active zioinfo-deploy')
# ── 2. temp dir에서 올바른 repo 생성 ─────────────────────────
print('\n━━ 2. zioinfo-mail 소스 → temp git repo → bundle ━━')
# GUARDiA 바깥 temp 디렉토리 사용
TMPDIR = tempfile.mkdtemp(prefix='zioinfo_mail_')
WS = 'C:/GUARDiA/workspace/zioinfo-mail'
EXCLUDE_DIRS = {'node_modules', '__pycache__', '.git', '.pytest_cache'}
EXCLUDE_FILES = {'.pyc', '.db'}
def copy_tree(src, dst):
for root, dirs, files in os.walk(src):
dirs[:] = [d for d in dirs if d not in EXCLUDE_DIRS]
rel = os.path.relpath(root, src)
dstdir = os.path.join(dst, rel) if rel != '.' else dst
os.makedirs(dstdir, exist_ok=True)
for fn in files:
if any(fn.endswith(e) for e in EXCLUDE_FILES):
continue
shutil.copy2(os.path.join(root, fn), os.path.join(dstdir, fn))
copy_tree(WS, TMPDIR)
print(f' 복사 완료: {TMPDIR}')
# .gitignore 생성
with open(os.path.join(TMPDIR, '.gitignore'), 'w') as f:
f.write('node_modules/\ndist/\n__pycache__/\n*.pyc\n.env\n*.db\n')
# git init + commit (GUARDiA repo 바깥)
subprocess.run(['git', 'init', '-b', 'main', TMPDIR], capture_output=True)
subprocess.run(['git', '-C', TMPDIR, 'config', 'user.email', 'ci@zioinfo.co.kr'], capture_output=True)
subprocess.run(['git', '-C', TMPDIR, 'config', 'user.name', 'CI Bot'], capture_output=True)
subprocess.run(['git', '-C', TMPDIR, 'add', '-A'], capture_output=True)
r = subprocess.run(['git', '-C', TMPDIR, 'commit', '-m', 'feat: zioinfo-mail webmail system'],
capture_output=True, text=True, encoding='utf-8', errors='replace')
print(f' commit: {r.stdout.strip()[:80]}')
# bundle
bundle_path = os.path.join(tempfile.gettempdir(), 'zioinfo_mail.bundle')
subprocess.run(['git', '-C', TMPDIR, 'bundle', 'create', bundle_path, '--all'],
capture_output=True, timeout=120)
size = os.path.getsize(bundle_path) // 1024
print(f' bundle: {size}KB')
# 서버 전송
sftp.put(bundle_path, '/tmp/mail_correct.bundle')
os.remove(bundle_path)
shutil.rmtree(TMPDIR)
GITEA_URL = 'http://zio:Zio%40Admin2026%21@127.0.0.1:9003/zio/zioinfo-mail.git'
run('Gitea force push',
f'rm -rf /tmp/zmail_push && '
f'git clone /tmp/mail_correct.bundle /tmp/zmail_push 2>/dev/null && '
f'cd /tmp/zmail_push && '
f'git remote set-url origin "{GITEA_URL}" && '
f'git push origin main --force 2>&1 | tail -3 && '
f'rm -rf /tmp/zmail_push /tmp/mail_correct.bundle && echo pushed', timeout=120)
# Gitea 파일 확인
run('Gitea 파일 목록 확인',
f'curl -sf "http://127.0.0.1:9003/api/v1/repos/zio/zioinfo-mail/contents/" '
f'-H "Authorization: Basic {G}" 2>/dev/null | '
'python3 -c "import sys,json; [print(f[\'name\'],f[\'type\']) for f in json.load(sys.stdin)[:8]]" 2>/dev/null')
# Jenkinsfile도 별도 업로드 (force push 후 없을 수 있음)
_, o, _ = c.exec_command(
f'curl -sf "http://127.0.0.1:9003/api/v1/repos/zio/zioinfo-mail/contents/Jenkinsfile" '
f'-H "Authorization: Basic {G}" 2>/dev/null | python3 -c "import sys,json; print(json.load(sys.stdin).get(\'sha\',\'\'))" 2>/dev/null', timeout=10)
sha = o.read().decode('utf-8','replace').strip()
print(f'\nJenkinsfile SHA: {sha[:8] if sha else "없음"}')
if not sha:
# 새로 업로드
jf = open('C:/GUARDiA/workspace/zioinfo-mail/Jenkinsfile', encoding='utf-8').read()
enc = base64.b64encode(jf.encode('utf-8')).decode()
payload = json.dumps({"message": "ci: add Jenkinsfile", "content": enc, "branch": "main"})
with sftp.open('/tmp/jf3.json', 'w') as f: f.write(payload)
run('Jenkinsfile 업로드',
f'curl -sf -X POST "http://127.0.0.1:9003/api/v1/repos/zio/zioinfo-mail/contents/Jenkinsfile" '
f'-H "Authorization: Basic {G}" -H "Content-Type: application/json" '
f'--data @/tmp/jf3.json 2>/dev/null | '
'python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get(\'content\',{}).get(\'name\',d.get(\'message\',\'?\')))" 2>/dev/null')
# ── 3. Jenkins 재빌드 ─────────────────────────────────────────
print('\n━━ 3. Jenkins 재빌드 ━━')
_, o, _ = c.exec_command(f'curl -sf -u "{JA}" {J}/crumbIssuer/api/json 2>/dev/null', timeout=10)
try:
cd = json.loads(o.read().decode('utf-8','replace').strip())
CH = f'{cd["crumbRequestField"]}: {cd["crumb"]}'
except: CH = 'Jenkins-Crumb: x'
run('재빌드',
f'curl -sf -X POST -u "{JA}" -H "{CH}" {J}/job/zioinfo-mail/build 2>/dev/null && echo "트리거됨"')
print('빌드 대기 (120초)...')
for _ in range(24):
time.sleep(5)
_, o2, _ = c.exec_command(
f'curl -sf -u "{JA}" {J}/job/zioinfo-mail/lastBuild/api/json 2>/dev/null', timeout=10)
try:
d = json.loads(o2.read().decode('utf-8','replace'))
n = d.get('number','?'); r2 = d.get('result','진행중'); b = d.get('building',True)
print(f' #{n}: {r2} building={b}')
if not b: break
except: pass
run('콘솔 로그 (마지막)',
f'curl -sf -u "{JA}" {J}/job/zioinfo-mail/lastBuild/consoleText 2>/dev/null | tail -20')
sftp.close(); c.close()
print('\n=== 완료 ===')

View File

@ -0,0 +1,60 @@
"""zioinfo-mail 서버 권한 수정 + Jenkins sudo 설정"""
import paramiko, sys, json, time
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
J = 'http://127.0.0.1:9080'; A = 'admin:Admin@2026!'
def run(label, cmd, timeout=20):
print(f'\n[{label}]')
_, o, _ = c.exec_command(cmd, timeout=timeout)
print(o.read().decode('utf-8','replace').strip()[:400])
# 1. /opt/mail 권한을 jenkins 사용자도 쓸 수 있게
run('/opt/mail 권한 확인', 'ls -la /opt/ | grep mail')
run('/opt/mail jenkins 쓰기 권한',
'chown -R jenkins:jenkins /opt/mail/backend /opt/mail/venv /var/www/mail 2>/dev/null; '
'chmod -R 755 /opt/mail/backend 2>/dev/null; echo done')
# 2. Jenkins sudoers: systemctl restart zioinfo-mail 허용
run('sudoers 설정',
'echo "jenkins ALL=(ALL) NOPASSWD: /usr/bin/systemctl restart zioinfo-mail, /usr/bin/systemctl is-active zioinfo-mail, /usr/bin/curl" > /etc/sudoers.d/jenkins-mail && '
'chmod 440 /etc/sudoers.d/jenkins-mail && echo ok')
# 3. Jenkinsfile에서 rsync와 systemctl에 sudo 추가
# 현재 Jenkinsfile 확인
import base64
G = base64.b64encode(b'zio:Zio@Admin2026!').decode()
run('현재 Jenkinsfile 확인',
f'curl -sf "http://127.0.0.1:9003/api/v1/repos/zio/zioinfo-mail/contents/Jenkinsfile" '
f'-H "Authorization: Basic {G}" 2>/dev/null | '
'python3 -c "import sys,json,base64; d=json.load(sys.stdin); print(base64.b64decode(d[\'content\']).decode())" 2>/dev/null | head -30')
# 4. workspace 초기화 + 재빌드
run('workspace 초기화', 'rm -rf /var/lib/jenkins/workspace/zioinfo-mail && echo ok')
_, o, _ = c.exec_command(f'curl -sf -u "{A}" {J}/crumbIssuer/api/json 2>/dev/null', timeout=10)
try:
cd = json.loads(o.read().decode('utf-8','replace').strip())
CH = f'{cd["crumbRequestField"]}: {cd["crumb"]}'
except: CH = 'Jenkins-Crumb: x'
run('재빌드',
f'curl -sf -X POST -u "{A}" -H "{CH}" {J}/job/zioinfo-mail/build 2>/dev/null && echo "트리거됨"')
print('\n빌드 대기 (180초)...')
for i in range(36):
time.sleep(5)
_, o2, _ = c.exec_command(
f'curl -sf -u "{A}" {J}/job/zioinfo-mail/lastBuild/api/json 2>/dev/null', timeout=10)
try:
d = json.loads(o2.read().decode('utf-8','replace'))
num = d.get('number','?'); result = d.get('result','진행중'); building = d.get('building',True)
print(f' #{num}: {result} building={building}')
if not building: break
except: pass
run('콘솔 로그 (마지막)',
f'curl -sf -u "{A}" {J}/job/zioinfo-mail/lastBuild/consoleText 2>/dev/null | tail -20')
c.close()

View File

@ -0,0 +1,44 @@
import paramiko, sys, json, time
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
J = 'http://127.0.0.1:9080'; A = 'admin:Admin@2026!'
def run(label, cmd, timeout=20):
print(f'\n[{label}]')
_, o, _ = c.exec_command(cmd, timeout=timeout)
print(o.read().decode('utf-8','replace').strip()[:400])
run('현재 권한', 'ls -la /opt/mail/')
run('권한 수정',
'chown -R jenkins:jenkins /opt/mail/ && chmod -R 775 /opt/mail/ && echo ok')
run('수정 후 권한', 'ls -la /opt/mail/')
_, o, _ = c.exec_command(f'curl -sf -u "{A}" {J}/crumbIssuer/api/json 2>/dev/null', timeout=10)
try:
cd = json.loads(o.read().decode('utf-8','replace').strip())
CH = f'{cd["crumbRequestField"]}: {cd["crumb"]}'
except: CH = 'Jenkins-Crumb: x'
run('재빌드', f'curl -sf -X POST -u "{A}" -H "{CH}" {J}/job/zioinfo-mail/build 2>/dev/null && echo 트리거됨')
print('\n빌드 대기...')
for i in range(36):
time.sleep(5)
_, o2, _ = c.exec_command(
f'curl -sf -u "{A}" {J}/job/zioinfo-mail/lastBuild/api/json 2>/dev/null', timeout=10)
try:
d = json.loads(o2.read().decode('utf-8','replace'))
num = d.get('number','?'); result = d.get('result','진행중'); building = d.get('building',True)
print(f' #{num}: {result} building={building}')
if not building: break
except: pass
run('빌드 콘솔',
f'curl -sf -u "{A}" {J}/job/zioinfo-mail/lastBuild/consoleText 2>/dev/null | tail -15')
run('전체 job 상태',
f'curl -sf -u "{A}" {J}/api/json 2>/dev/null | '
'python3 -c "import sys,json; [print(j[\'name\'].ljust(22),j[\'color\']) for j in json.load(sys.stdin)[\'jobs\']]" 2>/dev/null')
c.close()

View File

@ -0,0 +1,96 @@
"""zioinfo-mail 소스만 올바르게 Gitea push (GUARDiA 바깥 temp 사용)"""
import paramiko, subprocess, sys, os, shutil, json, base64, stat
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
sftp = c.open_sftp()
G = base64.b64encode(b'zio:Zio@Admin2026!').decode()
def run(label, cmd, timeout=60):
print(f'\n[{label}]')
_, o, _ = c.exec_command(cmd, timeout=timeout)
print(o.read().decode('utf-8','replace').strip()[:400])
# C 드라이브 루트 temp 사용 (GUARDiA 바깥)
TMPDIR = 'C:\\tmp_mail_repo'
WS = 'C:\\GUARDiA\\workspace\\zioinfo-mail'
# 기존 temp 제거
def rm_readonly(func, path, _):
os.chmod(path, stat.S_IWRITE); func(path)
if os.path.exists(TMPDIR):
shutil.rmtree(TMPDIR, onerror=rm_readonly)
os.makedirs(TMPDIR)
# 파일 복사
EXCLUDE = {'node_modules', '__pycache__', '.git', '.pytest_cache', 'dist'}
for root, dirs, files in os.walk(WS):
dirs[:] = [d for d in dirs if d not in EXCLUDE]
rel = os.path.relpath(root, WS)
dst = os.path.join(TMPDIR, rel) if rel != '.' else TMPDIR
os.makedirs(dst, exist_ok=True)
for fn in files:
if not fn.endswith(('.pyc', '.db')):
shutil.copy2(os.path.join(root, fn), os.path.join(dst, fn))
# .gitignore
with open(os.path.join(TMPDIR, '.gitignore'), 'w') as f:
f.write('node_modules/\ndist/\n__pycache__/\n*.pyc\n.env\n*.db\n')
# git init (독립 repo)
GIT = lambda *args: subprocess.run(['git', '-C', TMPDIR, '--git-dir', f'{TMPDIR}\\.git'] + list(args),
capture_output=True, text=True, encoding='utf-8', errors='replace')
subprocess.run(['git', 'init', '-b', 'main', TMPDIR], capture_output=True)
GIT('config', 'user.email', 'ci@zioinfo.co.kr')
GIT('config', 'user.name', 'CI Bot')
GIT('add', '-A')
r = GIT('commit', '-m', 'feat: zioinfo-mail webmail system')
print(f'commit: {r.stdout.strip()[:60]}')
print(f'files: {len([f for r2,d,fs in os.walk(TMPDIR) for f in fs if ".git" not in r2])}')
# bundle (cwd 방식으로)
BUNDLE = os.path.join(os.path.dirname(TMPDIR), 'tmp_mail.bundle')
r2 = subprocess.run(['git', 'bundle', 'create', BUNDLE, '--all'],
cwd=TMPDIR, capture_output=True)
size = os.path.getsize(BUNDLE) // 1024
print(f'bundle: {size}KB')
# 서버 전송
sftp.put(BUNDLE, '/tmp/mail_ok.bundle')
os.remove(BUNDLE)
shutil.rmtree(TMPDIR, onerror=rm_readonly)
print('전송 완료')
GITEA_URL = 'http://zio:Zio%40Admin2026%21@127.0.0.1:9003/zio/zioinfo-mail.git'
run('Gitea force push',
f'rm -rf /tmp/mp && git clone /tmp/mail_ok.bundle /tmp/mp 2>/dev/null && '
f'cd /tmp/mp && git remote set-url origin "{GITEA_URL}" && '
f'git push origin main --force 2>&1 | tail -3 && '
f'rm -rf /tmp/mp /tmp/mail_ok.bundle && echo pushed', timeout=120)
# Jenkinsfile 확인/업로드
_, o, _ = c.exec_command(
f'curl -sf "http://127.0.0.1:9003/api/v1/repos/zio/zioinfo-mail/contents/Jenkinsfile" '
f'-H "Authorization: Basic {G}" 2>/dev/null | python3 -c "import sys,json; print(json.load(sys.stdin).get(\'sha\',\'\'))" 2>/dev/null', timeout=10)
sha = o.read().decode('utf-8','replace').strip()
if not sha:
jf = open('C:/GUARDiA/workspace/zioinfo-mail/Jenkinsfile', encoding='utf-8').read()
enc = base64.b64encode(jf.encode('utf-8')).decode()
payload = json.dumps({"message":"ci: add Jenkinsfile","content":enc,"branch":"main"})
with sftp.open('/tmp/jf_ok.json','w') as f: f.write(payload)
run('Jenkinsfile 업로드',
f'curl -sf -X POST "http://127.0.0.1:9003/api/v1/repos/zio/zioinfo-mail/contents/Jenkinsfile" '
f'-H "Authorization: Basic {G}" -H "Content-Type: application/json" '
f'--data @/tmp/jf_ok.json 2>/dev/null | python3 -c "import sys,json; print(json.load(sys.stdin).get(\'content\',{{}}).get(\'name\',\'OK\'))" 2>/dev/null')
else:
print(f'\nJenkinsfile 이미 있음 sha={sha[:8]}')
# 확인
run('Gitea 파일 목록',
f'curl -sf "http://127.0.0.1:9003/api/v1/repos/zio/zioinfo-mail/contents/" '
f'-H "Authorization: Basic {G}" 2>/dev/null | '
'python3 -c "import sys,json; [print(f[\'name\'],f[\'type\']) for f in json.load(sys.stdin)[:12]]" 2>/dev/null')
sftp.close(); c.close()
print('\n=== 완료 ===')

View File

@ -0,0 +1,101 @@
"""Gitea Contents API로 zioinfo-mail 파일 직접 업로드"""
import paramiko, sys, os, json, base64, time
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
sftp = c.open_sftp()
G = base64.b64encode(b'zio:Zio@Admin2026!').decode()
def gitea_put(path: str, content_bytes: bytes, message: str, sha: str = None):
enc = base64.b64encode(content_bytes).decode()
if sha:
payload = json.dumps({"message": message, "content": enc, "sha": sha, "branch": "main"})
method = "PUT"
else:
payload = json.dumps({"message": message, "content": enc, "branch": "main"})
method = "POST"
with sftp.open('/tmp/gf.json', 'w') as f: f.write(payload)
_, o, _ = c.exec_command(
f'curl -sf -o /dev/null -w "%{{http_code}}" -X {method} '
f'"http://127.0.0.1:9003/api/v1/repos/zio/zioinfo-mail/contents/{path}" '
f'-H "Authorization: Basic {G}" -H "Content-Type: application/json" '
f'--data @/tmp/gf.json 2>/dev/null', timeout=10)
return o.read().decode('utf-8','replace').strip()
def get_sha(path: str) -> str:
_, o, _ = c.exec_command(
f'curl -sf "http://127.0.0.1:9003/api/v1/repos/zio/zioinfo-mail/contents/{path}" '
f'-H "Authorization: Basic {G}" 2>/dev/null | '
'python3 -c "import sys,json; print(json.load(sys.stdin).get(\'sha\',\'\'))" 2>/dev/null', timeout=10)
return o.read().decode('utf-8','replace').strip()
# 먼저 Gitea repo 완전 초기화 (DELETE + RECREATE)
print('[Gitea repo 재생성]')
_, o, _ = c.exec_command(
f'curl -sf -X DELETE "http://127.0.0.1:9003/api/v1/repos/zio/zioinfo-mail" '
f'-H "Authorization: Basic {G}" 2>/dev/null; echo $?', timeout=10)
print(f' delete: {o.read().decode().strip()}')
time.sleep(1)
_, o, _ = c.exec_command(
f'curl -sf -X POST "http://127.0.0.1:9003/api/v1/user/repos" '
f'-H "Authorization: Basic {G}" -H "Content-Type: application/json" '
f'-d \'{{"name":"zioinfo-mail","private":false,"auto_init":false}}\' 2>/dev/null | '
'python3 -c "import sys,json; print(json.load(sys.stdin).get(\'full_name\',\'?\'))" 2>/dev/null', timeout=10)
print(f' create: {o.read().decode().strip()}')
time.sleep(1)
# 업로드할 파일 목록
WS = 'C:/GUARDiA/workspace/zioinfo-mail'
EXCLUDE = {'node_modules', '__pycache__', '.git', '.pytest_cache', 'dist', '.expo'}
BINARY_EXT = {'.png', '.jpg', '.jpeg', '.gif', '.ico', '.woff', '.woff2', '.ttf', '.eot'}
files_to_upload = []
for root, dirs, files in os.walk(WS):
dirs[:] = [d for d in dirs if d not in EXCLUDE]
for fn in files:
if fn.endswith(('.pyc', '.db', '.tsbuildinfo')):
continue
fp = os.path.join(root, fn)
rel = os.path.relpath(fp, WS).replace('\\', '/')
files_to_upload.append((rel, fp))
# .gitignore 추가
files_to_upload.append(('.gitignore', None))
print(f'\n업로드 파일: {len(files_to_upload)}')
ok = fail = 0
for rel, fp in files_to_upload:
try:
if fp is None: # .gitignore
content_bytes = b'node_modules/\ndist/\n__pycache__/\n*.pyc\n.env\n*.db\n.tsbuildinfo\n'
else:
with open(fp, 'rb') as f:
content_bytes = f.read()
# 파일이 너무 크면 스킵 (package-lock.json 등)
if len(content_bytes) > 500_000:
print(f' SKIP (too large): {rel} ({len(content_bytes)//1024}KB)')
continue
code = gitea_put(rel, content_bytes, f'feat: add {rel}')
if code in ('200', '201'):
ok += 1
if ok % 5 == 0: print(f' {ok}/{len(files_to_upload)} 완료...')
else:
fail += 1
print(f' FAIL {code}: {rel}')
except Exception as e:
fail += 1
print(f' ERR {rel}: {e}')
print(f'\n완료: {ok}개 성공, {fail}개 실패')
# Gitea 파일 확인
_, o, _ = c.exec_command(
f'curl -sf "http://127.0.0.1:9003/api/v1/repos/zio/zioinfo-mail/contents/" '
f'-H "Authorization: Basic {G}" 2>/dev/null | '
'python3 -c "import sys,json; [print(f[\'name\'],f[\'type\']) for f in json.load(sys.stdin)[:10]]" 2>/dev/null', timeout=10)
print('\n[Gitea 파일 목록]\n' + o.read().decode('utf-8','replace').strip())
sftp.close(); c.close()
print('\n=== 완료 ===')

View File

@ -0,0 +1,42 @@
"""Jenkins zioinfo-mail workspace 정리 후 재빌드"""
import paramiko, sys, json, time
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
J = 'http://127.0.0.1:9080'; A = 'admin:Admin@2026!'
def run(label, cmd, timeout=30):
print(f'\n[{label}]')
_, o, _ = c.exec_command(cmd, timeout=timeout)
print(o.read().decode('utf-8','replace').strip()[:400])
# workspace 초기화
run('workspace 초기화',
'rm -rf /var/lib/jenkins/workspace/zioinfo-mail && echo "초기화 완료"')
# crumb
_, o, _ = c.exec_command(f'curl -sf -u "{A}" {J}/crumbIssuer/api/json 2>/dev/null', timeout=10)
try:
cd = json.loads(o.read().decode('utf-8','replace').strip())
CH = f'{cd["crumbRequestField"]}: {cd["crumb"]}'
except: CH = 'Jenkins-Crumb: x'
run('재빌드 트리거',
f'curl -sf -X POST -u "{A}" -H "{CH}" {J}/job/zioinfo-mail/build 2>/dev/null && echo "트리거됨"')
print('\n빌드 대기 (180초, npm install 포함)...')
for i in range(36):
time.sleep(5)
_, o2, _ = c.exec_command(
f'curl -sf -u "{A}" {J}/job/zioinfo-mail/lastBuild/api/json 2>/dev/null', timeout=10)
try:
d = json.loads(o2.read().decode('utf-8','replace'))
num = d.get('number','?'); result = d.get('result','진행중'); building = d.get('building',True)
print(f' #{num}: {result} building={building}')
if not building: break
except: pass
run('콘솔 로그',
f'curl -sf -u "{A}" {J}/job/zioinfo-mail/lastBuild/consoleText 2>/dev/null | tail -25')
c.close()

View File

@ -0,0 +1,140 @@
"""deploy_server.py 완전 복원 + zioinfo-mail 추가 + webhook 재기동"""
import paramiko, sys, ast
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
sftp = c.open_sftp()
def run(label, cmd, timeout=20):
print(f'\n[{label}]')
_, o, _ = c.exec_command(cmd, timeout=timeout)
out = o.read().decode('utf-8','replace').strip()
if out: print(out[:500])
return out
# 1. git에서 복원 (올바른 경로)
run('파일 크기 확인', 'ls -la /opt/zioinfo/deploy_server.py')
run('git log 확인', 'git -C /opt/zioinfo/src log --oneline -3 2>/dev/null')
run('git show deploy_server 크기',
'git -C /opt/zioinfo/src show HEAD:deploy_server.py 2>/dev/null | wc -l || '
'git -C /opt/zioinfo/src show HEAD:deploy_server.py 2>&1 | head -3')
# 실제 복원
run('deploy_server.py 복원',
'git -C /opt/zioinfo/src show HEAD:deploy_server.py > /opt/zioinfo/deploy_server.py && '
'ls -la /opt/zioinfo/deploy_server.py')
run('복원 후 크기', 'wc -l /opt/zioinfo/deploy_server.py')
# 파일이 여전히 비어있으면 GitHub commit history 확인
_, o, _ = c.exec_command('wc -c /opt/zioinfo/deploy_server.py', timeout=10)
size = o.read().decode().strip()
print(f'\n파일 크기: {size}')
if '0 ' in size or size.startswith('0'):
print('여전히 비어있음 - git에서 실제 파일 찾기')
run('git 모든 브랜치 파일',
'git -C /opt/zioinfo/src log --all --oneline -- deploy_server.py | head -5')
run('git show origin/main',
'git -C /opt/zioinfo/src show origin/main:deploy_server.py 2>/dev/null | wc -l')
# 2. 파일 다운로드
sftp.get('/opt/zioinfo/deploy_server.py', 'C:/GUARDiA/_ds_restored.py')
with open('C:/GUARDiA/_ds_restored.py', encoding='utf-8') as f:
content = f.read()
print(f'\n복원된 파일: {len(content)} bytes, {content.count(chr(10))}')
if len(content) < 100:
print('파일이 너무 작음 - 백업 사용')
with open('C:/GUARDiA/_deploy_server_backup.py', encoding='utf-8', errors='replace') as f:
content = f.read()
# 3. zioinfo-mail 블록 추가
print('\n=== repo 구조 파악 ===')
lines = content.split('\n')
for i, line in enumerate(lines):
if 'elif repo' in line or 'if repo' in line:
print(f' {i+1}: {line[:70]}')
# 마지막 repo elif 블록 끝 위치
last_repo_end = None
for i in range(len(lines)-1, 0, -1):
if ('if ok:' in lines[i] or 'notify_itsm' in lines[i]) and i > 10:
# 같은 들여쓰기 수준인지 확인
indent = len(lines[i]) - len(lines[i].lstrip())
if indent >= 8: # 8칸 이상 들여쓰기 = if/elif 내부
last_repo_end = i
print(f'\n마지막 적합한 위치: 줄 {i+1}: {lines[i][:60]}')
break
# elif 들여쓰기
elif_indent = ' '
for line in lines:
if 'elif repo ==' in line:
elif_indent = ' ' * (len(line) - len(line.lstrip()))
break
print(f'elif 들여쓰기: {len(elif_indent)}')
# zioinfo-mail 이미 있으면 제거
import re
if 'zioinfo-mail' in content:
content = re.sub(
r'\n' + elif_indent + r'elif repo == "zioinfo-mail":.*?(?=\n' + elif_indent + r'elif |\n' + r'if __name__|$)',
'', content, flags=re.DOTALL)
lines = content.split('\n')
INNER = elif_indent + ' '
MAIL_BLOCK = f'''
{elif_indent}elif repo == "zioinfo-mail":
{INNER}SRC = "/opt/mail"
{INNER}ok = run_steps(repo, [
{INNER} ("git pull", ["bash", "-c",
{INNER} "[ -d /opt/mail/src/.git ] && git -C /opt/mail/src fetch origin main && git -C /opt/mail/src reset --hard origin/main"
{INNER} " || git clone 'http://zio:Zio%40Admin2026%21@127.0.0.1:9003/zio/zioinfo-mail.git' /opt/mail/src"]),
{INNER} ("npm build", ["bash", "-c",
{INNER} "cd /opt/mail/src/frontend && npm ci --legacy-peer-deps 2>/dev/null || npm install --legacy-peer-deps && npm run build"]),
{INNER} ("copy dist", ["bash", "-c",
{INNER} "mkdir -p /var/www/mail && cp -r /opt/mail/src/dist/. /var/www/mail/"]),
{INNER} ("pip install", ["bash", "-c",
{INNER} "/opt/mail/venv/bin/pip install -r /opt/mail/src/backend/requirements.txt -q"]),
{INNER} ("rsync", ["bash", "-c",
{INNER} "rsync -a --exclude=__pycache__ --exclude=.git --exclude='*.pyc' --exclude='.env' /opt/mail/src/backend/ /opt/mail/backend/"]),
{INNER} ("restart", ["systemctl", "restart", "zioinfo-mail"]),
{INNER} ("health check", ["bash", "-c", "sleep 4 && curl -sf http://localhost:8026/health"]),
{INNER}])
{INNER}if ok:
{INNER} notify_itsm(True, "\\u2705 zioinfo-mail \\ubc30\\ud3ec \\uc644\\ub8cc")
{INNER}else:
{INNER} notify_itsm(False, "\\u274c zioinfo-mail \\ube4c\\ub4dc \\uc2e4\\ud328")'''
if last_repo_end:
lines = content.split('\n')
lines.insert(last_repo_end + 1, MAIL_BLOCK)
new_content = '\n'.join(lines)
else:
new_content = content.rstrip() + '\n' + MAIL_BLOCK + '\n'
try:
ast.parse(new_content)
print('\n✅ 문법 OK')
with sftp.open('/opt/zioinfo/deploy_server.py', 'w') as f:
f.write(new_content)
print('업로드 완료')
except SyntaxError as e:
print(f'\n❌ 문법 오류 {e} — 원본만 복원')
with sftp.open('/opt/zioinfo/deploy_server.py', 'w') as f:
f.write(content)
run('최종 확인', 'python3 -m py_compile /opt/zioinfo/deploy_server.py && echo "✅ OK" || echo "❌ FAIL"')
run('zioinfo-mail 줄', "grep -n 'zioinfo-mail' /opt/zioinfo/deploy_server.py | head -3")
run('webhook 재기동',
'fuser -k 9999/tcp 2>/dev/null; sleep 1; '
'systemctl restart zioinfo-deploy && sleep 4 && systemctl is-active zioinfo-deploy')
import os
for f in ['C:/GUARDiA/_ds_restored.py', 'C:/GUARDiA/_deploy_server_backup.py']:
try: os.remove(f)
except: pass
sftp.close(); c.close()
print('\n=== 완료 ===')

View File

@ -0,0 +1,137 @@
"""deploy_server.py 서버에서 git 히스토리로 복원 + 올바른 zioinfo-mail 추가"""
import paramiko, sys, re, ast
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
sftp = c.open_sftp()
def run(label, cmd, timeout=20):
print(f'\n[{label}]')
_, o, _ = c.exec_command(cmd, timeout=timeout)
out = o.read().decode('utf-8','replace').strip()
if out: print(out[:400])
return out
# 1. 서버 git 히스토리에서 원본 복원
run('git log deploy_server.py',
'git -C /opt/zioinfo/src log --oneline -- deploy_server.py 2>/dev/null | head -5')
# 마지막 정상 커밋에서 복원
result = run('git show 복원 시도',
'git -C /opt/zioinfo/src show HEAD:deploy_server.py 2>/dev/null | '
'python3 -m py_compile /dev/stdin 2>/dev/null && echo OK || echo FAIL')
if 'OK' in result or 'FAIL' not in result:
run('서버 deploy_server.py 복원 (git HEAD)',
'git -C /opt/zioinfo/src show HEAD:deploy_server.py > /opt/zioinfo/deploy_server.py 2>/dev/null && echo "복원 완료"')
else:
# HEAD에 없으면 이전 커밋에서 찾기
for ref in ['HEAD~1', 'HEAD~2']:
ok = run(f'{ref} 확인',
f'git -C /opt/zioinfo/src show {ref}:deploy_server.py 2>/dev/null | '
'python3 -m py_compile /dev/stdin 2>/dev/null && echo OK || echo FAIL')
if 'OK' in ok:
run(f'{ref}에서 복원',
f'git -C /opt/zioinfo/src show {ref}:deploy_server.py > /opt/zioinfo/deploy_server.py && echo "복원 완료"')
break
run('복원 후 문법 확인', 'python3 -m py_compile /opt/zioinfo/deploy_server.py && echo "✅ OK"')
# 2. 파일 다운로드 후 로컬에서 수정
sftp.get('/opt/zioinfo/deploy_server.py', 'C:/GUARDiA/_ds_clean.py')
with open('C:/GUARDiA/_ds_clean.py', encoding='utf-8', errors='replace') as f:
content = f.read()
# 문법 확인
try:
ast.parse(content)
print('\n✅ 복원된 파일 문법 OK')
except SyntaxError as e:
print(f'\n❌ 복원 파일도 문법 오류: {e}')
# 마지막 수단: 백업 파일 사용
with open('C:/GUARDiA/_deploy_server_backup.py', encoding='utf-8', errors='replace') as f:
content = f.read()
# 백업에서 zioinfo-mail 제거
content = re.sub(
r'\n elif repo == "zioinfo-mail":.*?(?=\n elif |\n if __name__|$)',
'', content, flags=re.DOTALL)
try:
ast.parse(content)
print('백업에서 복원 ✅')
except SyntaxError as e2:
print(f'백업도 오류: {e2}')
import sys; sys.exit(1)
if 'zioinfo-mail' in content:
print('⚠️ 이미 있음, 제거 후 재삽입')
content = re.sub(
r'\n elif repo == "zioinfo-mail":.*?(?=\n elif |\n if __name__|$)',
'', content, flags=re.DOTALL)
# 3. 올바른 위치에 삽입
# WebhookHandler 내부 마지막 notify_itsm 다음
lines = content.split('\n')
insert_idx = None
for i in range(len(lines)-1, 0, -1):
# 12칸 들여쓰기 + notify_itsm → 클래스 메서드 내부
if 'notify_itsm' in lines[i] and lines[i].startswith(' '):
# 이 다음 줄
insert_idx = i + 1
break
print(f'\n삽입 위치: {insert_idx}')
if insert_idx and insert_idx < len(lines):
print(f' 이전: {repr(lines[insert_idx-1].rstrip()[:60])}')
print(f' 이후: {repr(lines[insert_idx].rstrip()[:60])}')
MAIL_BLOCK = '''
elif repo == "zioinfo-mail":
SRC = "/opt/mail"
ok = run_steps(repo, [
("git pull", ["bash", "-c",
"[ -d /opt/mail/src/.git ] && git -C /opt/mail/src fetch origin main && git -C /opt/mail/src reset --hard origin/main"
" || git clone 'http://zio:Zio%40Admin2026%21@127.0.0.1:9003/zio/zioinfo-mail.git' /opt/mail/src"]),
("npm build", ["bash", "-c",
"cd /opt/mail/src/frontend && npm ci --legacy-peer-deps 2>/dev/null || npm install --legacy-peer-deps && npm run build"]),
("copy dist", ["bash", "-c",
"mkdir -p /var/www/mail && cp -r /opt/mail/src/dist/. /var/www/mail/"]),
("pip install", ["bash", "-c",
"/opt/mail/venv/bin/pip install -r /opt/mail/src/backend/requirements.txt -q"]),
("rsync", ["bash", "-c",
"rsync -a --exclude=__pycache__ --exclude=.git --exclude='*.pyc' --exclude='.env' /opt/mail/src/backend/ /opt/mail/backend/"]),
("restart", ["systemctl", "restart", "zioinfo-mail"]),
("health check", ["bash", "-c", "sleep 4 && curl -sf http://localhost:8026/health"]),
])
if ok:
notify_itsm(True, "\\u2705 zioinfo-mail \\ubc30\\ud3ec \\uc644\\ub8cc")
else:
notify_itsm(False, "\\u274c zioinfo-mail \\ube4c\\ub4dc \\uc2e4\\ud328")'''
if insert_idx:
lines.insert(insert_idx, MAIL_BLOCK)
new_content = '\n'.join(lines)
else:
new_content = content + MAIL_BLOCK
try:
ast.parse(new_content)
print('\n✅ 최종 문법 OK')
except SyntaxError as e:
print(f'\n❌ 최종 오류: {e}')
# 그냥 삽입 없이 원본만 복원
new_content = content
with sftp.open('/opt/zioinfo/deploy_server.py', 'w') as f:
f.write(new_content)
run('최종 확인', 'python3 -m py_compile /opt/zioinfo/deploy_server.py && echo "✅ OK" || echo "❌ FAIL"')
run('zioinfo-mail 블록', "grep -n 'elif repo.*zioinfo-mail' /opt/zioinfo/deploy_server.py")
run('webhook 재시작',
'fuser -k 9999/tcp 2>/dev/null; sleep 1; '
'systemctl restart zioinfo-deploy && sleep 3 && systemctl is-active zioinfo-deploy')
import os
try: os.remove('C:/GUARDiA/_ds_clean.py')
except: pass
sftp.close(); c.close()

View File

@ -0,0 +1,50 @@
"""Jenkins zioinfo-mail 빌드 트리거 + 결과 대기"""
import paramiko, sys, json, time
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
J = 'http://127.0.0.1:9080'; A = 'admin:Admin@2026!'
def run(label, cmd, timeout=20):
print(f'\n[{label}]')
_, o, _ = c.exec_command(cmd, timeout=timeout)
print(o.read().decode('utf-8','replace').strip()[:600])
# crumb
_, o, _ = c.exec_command(f'curl -sf -u "{A}" {J}/crumbIssuer/api/json 2>/dev/null', timeout=10)
try:
cd = json.loads(o.read().decode('utf-8','replace').strip())
CH = f'{cd["crumbRequestField"]}: {cd["crumb"]}'
except: CH = 'Jenkins-Crumb: x'
# Gitea repo 파일 목록 확인
run('Gitea zioinfo-mail 파일 목록',
f'curl -sf "http://127.0.0.1:9003/api/v1/repos/zio/zioinfo-mail/contents/" '
f'-H "Authorization: Basic emhvOlppb0BBZG1pbjIwMjYh" 2>/dev/null | '
'python3 -c "import sys,json; [print(f[\'name\'],f[\'type\']) for f in json.load(sys.stdin)[:10]]" 2>/dev/null')
# Jenkins 재빌드
run('Jenkins 재빌드 트리거',
f'curl -sf -X POST -u "{A}" -H "{CH}" {J}/job/zioinfo-mail/build 2>/dev/null && echo "트리거됨"')
print('\n빌드 대기 (120초)...')
for i in range(24):
time.sleep(5)
_, o2, _ = c.exec_command(
f'curl -sf -u "{A}" {J}/job/zioinfo-mail/lastBuild/api/json 2>/dev/null', timeout=10)
try:
d = json.loads(o2.read().decode('utf-8','replace'))
num = d.get('number','?'); result = d.get('result','진행중'); building = d.get('building',True)
print(f' #{num}: {result} building={building}')
if not building: break
except: pass
run('콘솔 로그',
f'curl -sf -u "{A}" {J}/job/zioinfo-mail/lastBuild/consoleText 2>/dev/null | tail -20')
# 전체 job 상태
run('전체 job 상태',
f'curl -sf -u "{A}" {J}/api/json 2>/dev/null | '
'python3 -c "import sys,json; [print(j[\'name\'].ljust(22),j[\'color\']) for j in json.load(sys.stdin)[\'jobs\']]" 2>/dev/null')
c.close()

View File

@ -0,0 +1,70 @@
"""Jenkinsfile 업데이트 + sudoers 확인 + 재빌드"""
import paramiko, sys, json, base64, time
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15)
sftp = c.open_sftp()
G = base64.b64encode(b'zio:Zio@Admin2026!').decode()
J = 'http://127.0.0.1:9080'; A = 'admin:Admin@2026!'
def run(label, cmd, timeout=20):
print(f'\n[{label}]')
_, o, _ = c.exec_command(cmd, timeout=timeout)
print(o.read().decode('utf-8','replace').strip()[:400])
# 1. sudoers 확인 + 강화
run('sudoers 내용', 'cat /etc/sudoers.d/jenkins-mail 2>/dev/null')
run('sudoers 업데이트',
'echo "jenkins ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/jenkins-mail && '
'chmod 440 /etc/sudoers.d/jenkins-mail && echo ok')
run('sudo 테스트',
'sudo -u jenkins sudo systemctl is-active zioinfo-mail 2>/dev/null || echo "sudo 필요"')
# 2. Gitea Jenkinsfile 업데이트
_, o, _ = c.exec_command(
f'curl -sf "http://127.0.0.1:9003/api/v1/repos/zio/zioinfo-mail/contents/Jenkinsfile" '
f'-H "Authorization: Basic {G}" 2>/dev/null | python3 -c "import sys,json; print(json.load(sys.stdin).get(\'sha\',\'\'))" 2>/dev/null', timeout=10)
sha = o.read().decode('utf-8','replace').strip()
jf = open('C:/GUARDiA/workspace/zioinfo-mail/Jenkinsfile', encoding='utf-8').read()
enc = base64.b64encode(jf.encode('utf-8')).decode()
payload = json.dumps({"message": "fix: sudo for systemctl", "content": enc, "sha": sha, "branch": "main"})
with sftp.open('/tmp/jf_upd.json', 'w') as f: f.write(payload)
run('Jenkinsfile 업데이트',
f'curl -sf -X PUT "http://127.0.0.1:9003/api/v1/repos/zio/zioinfo-mail/contents/Jenkinsfile" '
f'-H "Authorization: Basic {G}" -H "Content-Type: application/json" '
f'--data @/tmp/jf_upd.json 2>/dev/null | '
'python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get(\'content\',{}).get(\'name\',d.get(\'message\',\'?\')))" 2>/dev/null')
# 3. workspace 초기화 + 재빌드
run('workspace 초기화', 'rm -rf /var/lib/jenkins/workspace/zioinfo-mail && echo ok')
_, o, _ = c.exec_command(f'curl -sf -u "{A}" {J}/crumbIssuer/api/json 2>/dev/null', timeout=10)
try:
cd = json.loads(o.read().decode('utf-8','replace').strip())
CH = f'{cd["crumbRequestField"]}: {cd["crumb"]}'
except: CH = 'Jenkins-Crumb: x'
run('재빌드', f'curl -sf -X POST -u "{A}" -H "{CH}" {J}/job/zioinfo-mail/build 2>/dev/null && echo 트리거됨')
print('\n빌드 대기 (180초)...')
for _ in range(36):
time.sleep(5)
_, o2, _ = c.exec_command(
f'curl -sf -u "{A}" {J}/job/zioinfo-mail/lastBuild/api/json 2>/dev/null', timeout=10)
try:
d = json.loads(o2.read().decode('utf-8','replace'))
num = d.get('number','?'); result = d.get('result','진행중'); building = d.get('building',True)
print(f' #{num}: {result} building={building}')
if not building: break
except: pass
run('최종 콘솔',
f'curl -sf -u "{A}" {J}/job/zioinfo-mail/lastBuild/consoleText 2>/dev/null | '
"grep -v '\\[Pipeline\\]\\|withEnv\\|timeout\\|timestamps' | tail -20")
run('전체 job 상태',
f'curl -sf -u "{A}" {J}/api/json 2>/dev/null | '
'python3 -c "import sys,json; [print(j[\'name\'].ljust(22),j[\'color\']) for j in json.load(sys.stdin)[\'jobs\']]" 2>/dev/null')
sftp.close(); c.close()

View File

@ -1 +1 @@
{"root":["./src/app.tsx","./src/main.tsx","./src/api/clients.ts","./src/api/types.ts","./src/components/common/btn.tsx","./src/components/common/datatable.tsx","./src/components/common/protectedroute.tsx","./src/components/common/slidepanel.tsx","./src/components/common/statcard.tsx","./src/components/common/statusbadge.tsx","./src/components/layout/applayout.tsx","./src/components/layout/gnb.tsx","./src/components/layout/sidebar.tsx","./src/config/env.ts","./src/hooks/useapi.ts","./src/hooks/useauth.ts","./src/pages/apikeys.tsx","./src/pages/auditlog.tsx","./src/pages/cmdb.tsx","./src/pages/configenv.tsx","./src/pages/confignginx.tsx","./src/pages/csapconsole.tsx","./src/pages/dashboard.tsx","./src/pages/deployments.tsx","./src/pages/drconsole.tsx","./src/pages/exportimport.tsx","./src/pages/institutions.tsx","./src/pages/llmmanager.tsx","./src/pages/licenses.tsx","./src/pages/login.tsx","./src/pages/networkconsole.tsx","./src/pages/notifications.tsx","./src/pages/repos.tsx","./src/pages/servers.tsx","./src/pages/users.tsx"],"version":"5.9.3"}
{"root":["./src/app.tsx","./src/main.tsx","./src/api/clients.ts","./src/api/types.ts","./src/components/common/btn.tsx","./src/components/common/datatable.tsx","./src/components/common/protectedroute.tsx","./src/components/common/slidepanel.tsx","./src/components/common/statcard.tsx","./src/components/common/statusbadge.tsx","./src/components/layout/applayout.tsx","./src/components/layout/gnb.tsx","./src/components/layout/sidebar.tsx","./src/config/env.ts","./src/hooks/useapi.ts","./src/hooks/useauth.ts","./src/pages/aiplatform.tsx","./src/pages/apikeys.tsx","./src/pages/appdistribution.tsx","./src/pages/auditlog.tsx","./src/pages/bianalytics.tsx","./src/pages/billingmanage.tsx","./src/pages/cmdb.tsx","./src/pages/configenv.tsx","./src/pages/confignginx.tsx","./src/pages/csapconsole.tsx","./src/pages/dashboard.tsx","./src/pages/deployments.tsx","./src/pages/drconsole.tsx","./src/pages/exportimport.tsx","./src/pages/institutions.tsx","./src/pages/integrationhub.tsx","./src/pages/kpidashboard.tsx","./src/pages/llmmanager.tsx","./src/pages/licenses.tsx","./src/pages/login.tsx","./src/pages/networkconsole.tsx","./src/pages/notificationrules.tsx","./src/pages/notifications.tsx","./src/pages/repos.tsx","./src/pages/scrapingmanager.tsx","./src/pages/servers.tsx","./src/pages/users.tsx"],"version":"5.9.3"}

View File

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,14 @@
/*******************************************************************************
* Copyright (c) 2019 Gradle Inc.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
******************************************************************************/
initscript {
allprojects {
apply plugin: "eclipse"
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,12 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.6

View File

@ -0,0 +1,418 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sample</groupId>
<artifactId>mybatis</artifactId>
<name>Spring_EX_01</name>
<packaging>war</packaging>
<version>1.0.0-BUILD-SNAPSHOT</version>
<properties>
<java-version>1.8</java-version>
<org.springframework-version>4.3.3.RELEASE</org.springframework-version>
<org.aspectj-version>1.6.10</org.aspectj-version>
<org.slf4j-version>1.6.6</org.slf4j-version>
</properties>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-tomcat -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<version>2.3.0.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.3.0.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-autoconfigure -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.9</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.thymeleaf.extras/thymeleaf-extras-springsecurity4 -->
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity4</artifactId>
<version>3.0.2.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180813</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-codec.wso2/commons-codec -->
<!--
<dependency>
<groupId>commons-codec.wso2</groupId>
<artifactId>commons-codec</artifactId>
<version>1.4.0.wso2v1</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/net.lingala.zip4j/zip4j -->
<dependency>
<groupId>net.lingala.zip4j</groupId>
<artifactId>zip4j</artifactId>
<version>1.3.2</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
<scope>runtime</scope>
</dependency>
<!-- @Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- MySQL -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.5</version>
</dependency>
<!-- MyBatis 3.4.1 -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.1</version>
</dependency>
<!-- MyBatis-Spring -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.0</version>
</dependency>
<!-- Spring-jdbc -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Spring-test -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-test -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Mybatis log -->
<!-- https://mvnrepository.com/artifact/org.bgee.log4jdbc-log4j2/log4jdbc-log4j2-jdbc4.1 -->
<dependency>
<groupId>org.bgee.log4jdbc-log4j2</groupId>
<artifactId>log4jdbc-log4j2-jdbc4</artifactId>
<version>1.16</version>
</dependency>
<!-- mariaDB -->
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.0.1</version>
</dependency>
<!-- PostgreSQL -->
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.5</version>
</dependency>
<!-- MSSQL -->
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.0.0.jre8</version>
</dependency>
<!-- Oracle 11 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>11.2.0.3.0</version>
</dependency>
-->
<!-- Oracle 12 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>12.1.0.2</version>
</dependency>
-->
<!-- 엑셀 제어(xls) maven setting -->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<!--
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<!-- 엑셀 제어(xlsx) maven setting-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<!--
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-core -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.3.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-web -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>5.3.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.13.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jsp-api</artifactId>
<version>${tomcat.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>org.test.int1.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,272 @@
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ============================================================================
// catalina.policy - Security Policy Permissions for Tomcat
//
// This file contains a default set of security policies to be enforced (by the
// JVM) when Catalina is executed with the "-security" option. In addition
// to the permissions granted here, the following additional permissions are
// granted to each web application:
//
// * Read access to the web application's document root directory
// * Read, write and delete access to the web application's working directory
// ============================================================================
// ========== SYSTEM CODE PERMISSIONS =========================================
// These permissions apply to javac
grant codeBase "file:${java.home}/lib/-" {
permission java.security.AllPermission;
};
// These permissions apply to all shared system extensions
grant codeBase "file:${java.home}/jre/lib/ext/-" {
permission java.security.AllPermission;
};
// These permissions apply to javac when ${java.home] points at $JAVA_HOME/jre
grant codeBase "file:${java.home}/../lib/-" {
permission java.security.AllPermission;
};
// These permissions apply to all shared system extensions when
// ${java.home} points at $JAVA_HOME/jre
grant codeBase "file:${java.home}/lib/ext/-" {
permission java.security.AllPermission;
};
// ========== CATALINA CODE PERMISSIONS =======================================
// These permissions apply to the daemon code
grant codeBase "file:${catalina.home}/bin/commons-daemon.jar" {
permission java.security.AllPermission;
};
// These permissions apply to the logging API
// Note: If tomcat-juli.jar is in ${catalina.base} and not in ${catalina.home},
// update this section accordingly.
// grant codeBase "file:${catalina.base}/bin/tomcat-juli.jar" {..}
grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
permission java.io.FilePermission
"${java.home}${file.separator}lib${file.separator}logging.properties", "read";
permission java.io.FilePermission
"${catalina.base}${file.separator}conf${file.separator}logging.properties", "read";
permission java.io.FilePermission
"${catalina.base}${file.separator}logs", "read, write";
permission java.io.FilePermission
"${catalina.base}${file.separator}logs${file.separator}*", "read, write, delete";
permission java.lang.RuntimePermission "shutdownHooks";
permission java.lang.RuntimePermission "getClassLoader";
permission java.lang.RuntimePermission "setContextClassLoader";
permission java.lang.management.ManagementPermission "monitor";
permission java.util.logging.LoggingPermission "control";
permission java.util.PropertyPermission "java.util.logging.config.class", "read";
permission java.util.PropertyPermission "java.util.logging.config.file", "read";
permission java.util.PropertyPermission "org.apache.juli.AsyncLoggerPollInterval", "read";
permission java.util.PropertyPermission "org.apache.juli.AsyncMaxRecordCount", "read";
permission java.util.PropertyPermission "org.apache.juli.AsyncOverflowDropType", "read";
permission java.util.PropertyPermission "org.apache.juli.ClassLoaderLogManager.debug", "read";
permission java.util.PropertyPermission "catalina.base", "read";
// Note: To enable per context logging configuration, permit read access to
// the appropriate file. Be sure that the logging configuration is
// secure before enabling such access.
// E.g. for the examples web application (uncomment and unwrap
// the following to be on a single line):
// permission java.io.FilePermission "${catalina.base}${file.separator}
// webapps${file.separator}examples${file.separator}WEB-INF
// ${file.separator}classes${file.separator}logging.properties", "read";
};
// These permissions apply to the server startup code
grant codeBase "file:${catalina.home}/bin/bootstrap.jar" {
permission java.security.AllPermission;
};
// These permissions apply to the servlet API classes
// and those that are shared across all class loaders
// located in the "lib" directory
grant codeBase "file:${catalina.home}/lib/-" {
permission java.security.AllPermission;
};
// If using a per instance lib directory, i.e. ${catalina.base}/lib,
// then the following permission will need to be uncommented
// grant codeBase "file:${catalina.base}/lib/-" {
// permission java.security.AllPermission;
// };
// ========== WEB APPLICATION PERMISSIONS =====================================
// These permissions are granted by default to all web applications
// In addition, a web application will be given a read FilePermission
// for all files and directories in its document root.
grant {
// Required for JNDI lookup of named JDBC DataSource's and
// javamail named MimePart DataSource used to send mail
permission java.util.PropertyPermission "java.home", "read";
permission java.util.PropertyPermission "java.naming.*", "read";
permission java.util.PropertyPermission "javax.sql.*", "read";
// OS Specific properties to allow read access
permission java.util.PropertyPermission "os.name", "read";
permission java.util.PropertyPermission "os.version", "read";
permission java.util.PropertyPermission "os.arch", "read";
permission java.util.PropertyPermission "file.separator", "read";
permission java.util.PropertyPermission "path.separator", "read";
permission java.util.PropertyPermission "line.separator", "read";
// JVM properties to allow read access
permission java.util.PropertyPermission "java.version", "read";
permission java.util.PropertyPermission "java.vendor", "read";
permission java.util.PropertyPermission "java.vendor.url", "read";
permission java.util.PropertyPermission "java.class.version", "read";
permission java.util.PropertyPermission "java.specification.version", "read";
permission java.util.PropertyPermission "java.specification.vendor", "read";
permission java.util.PropertyPermission "java.specification.name", "read";
permission java.util.PropertyPermission "java.vm.specification.version", "read";
permission java.util.PropertyPermission "java.vm.specification.vendor", "read";
permission java.util.PropertyPermission "java.vm.specification.name", "read";
permission java.util.PropertyPermission "java.vm.version", "read";
permission java.util.PropertyPermission "java.vm.vendor", "read";
permission java.util.PropertyPermission "java.vm.name", "read";
// Required for OpenJMX
permission java.lang.RuntimePermission "getAttribute";
// Allow read of JAXP compliant XML parser debug
permission java.util.PropertyPermission "jaxp.debug", "read";
// All JSPs need to be able to read this package
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat";
// Precompiled JSPs need access to these packages.
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.el";
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime";
permission java.lang.RuntimePermission
"accessClassInPackage.org.apache.jasper.runtime.*";
// The cookie code needs these.
permission java.util.PropertyPermission
"org.apache.catalina.STRICT_SERVLET_COMPLIANCE", "read";
permission java.util.PropertyPermission
"org.apache.tomcat.util.http.ServerCookie.STRICT_NAMING", "read";
permission java.util.PropertyPermission
"org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR", "read";
// Applications using WebSocket need to be able to access these packages
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat.websocket";
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat.websocket.server";
// Applications need to access these packages to use the Servlet 4.0 Preview
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.servlet4preview";
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.servlet4preview.http";
};
// The Manager application needs access to the following packages to support the
// session display functionality. It also requires the custom Tomcat
// DeployXmlPermission to enable the use of META-INF/context.xml
// These settings support the following configurations:
// - default CATALINA_HOME == CATALINA_BASE
// - CATALINA_HOME != CATALINA_BASE, per instance Manager in CATALINA_BASE
// - CATALINA_HOME != CATALINA_BASE, shared Manager in CATALINA_HOME
grant codeBase "file:${catalina.base}/webapps/manager/-" {
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina";
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.ha.session";
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager";
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager.util";
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.util";
permission org.apache.catalina.security.DeployXmlPermission "manager";
};
grant codeBase "file:${catalina.home}/webapps/manager/-" {
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina";
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.ha.session";
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager";
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager.util";
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.util";
permission org.apache.catalina.security.DeployXmlPermission "manager";
};
// The Host Manager application needs the custom Tomcat DeployXmlPermission to
// enable the use of META-INF/context.xml
// These settings support the following configurations:
// - default CATALINA_HOME == CATALINA_BASE
// - CATALINA_HOME != CATALINA_BASE, per instance Host Manager in CATALINA_BASE
// - CATALINA_HOME != CATALINA_BASE, shared Host Manager in CATALINA_HOME
grant codeBase "file:${catalina.base}/webapps/host-manager/-" {
permission org.apache.catalina.security.DeployXmlPermission "host-manager";
};
grant codeBase "file:${catalina.home}/webapps/host-manager/-" {
permission org.apache.catalina.security.DeployXmlPermission "host-manager";
};
// You can assign additional permissions to particular web applications by
// adding additional "grant" entries here, based on the code base for that
// application, /WEB-INF/classes/, or /WEB-INF/lib/ jar files.
//
// Different permissions can be granted to JSP pages, classes loaded from
// the /WEB-INF/classes/ directory, all jar files in the /WEB-INF/lib/
// directory, or even to individual jar files in the /WEB-INF/lib/ directory.
//
// For instance, assume that the standard "examples" application
// included a JDBC driver that needed to establish a network connection to the
// corresponding database and used the scrape taglib to get the weather from
// the NOAA web server. You might create a "grant" entries like this:
//
// The permissions granted to the context root directory apply to JSP pages.
// grant codeBase "file:${catalina.base}/webapps/examples/-" {
// permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect";
// permission java.net.SocketPermission "*.noaa.gov:80", "connect";
// };
//
// The permissions granted to the context WEB-INF/classes directory
// grant codeBase "file:${catalina.base}/webapps/examples/WEB-INF/classes/-" {
// };
//
// The permission granted to your JDBC driver
// grant codeBase "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/driver.jar!/-" {
// permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect";
// };
// The permission granted to the scrape taglib
// grant codeBase "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/scrape.jar!/-" {
// permission java.net.SocketPermission "*.noaa.gov:80", "connect";
// };
// To grant permissions for web applications using packed WAR files, use the
// Tomcat specific WAR url scheme.
//
// The permissions granted to the entire web application
// grant codeBase "war:file:${catalina.base}/webapps/examples.war*/-" {
// };
//
// The permissions granted to a specific JAR
// grant codeBase "war:file:${catalina.base}/webapps/examples.war*/WEB-INF/lib/foo.jar" {
// };

View File

@ -0,0 +1,426 @@
<?xml version="1.0" encoding="EUC-KR"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>kr.co</groupId>
<artifactId>ROOT</artifactId>
<name>timsTr</name>
<packaging>war</packaging>
<version>1.0.0</version>
<properties>
<java-version>1.8</java-version>
<org.springframework-version>4.3.10.RELEASE</org.springframework-version>
<org.aspectj-version>1.8.4</org.aspectj-version>
<org.slf4j-version>1.6.6</org.slf4j-version>
<project.build.sourceEncoding>EUC-KR</project.build.sourceEncoding>
<project.reporting.outputEncoding>EUC-KR</project.reporting.outputEncoding>
</properties>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- DB암호화 -->
<dependency>
<groupId>org.jasypt</groupId>
<artifactId>jasypt-spring3</artifactId>
<version>1.9.2</version>
</dependency>
<!-- MySQL JDBC Drive -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.15</version>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>org.bgee.log4jdbc-log4j2</groupId>
<artifactId>log4jdbc-log4j2-jdbc4.1</artifactId>
<version>1.16</version>
</dependency>
<!-- mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.5.0</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>2.0.0</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<!-- <dependency>
<groupId>com.ibm.informix</groupId>
<artifactId>jdbc</artifactId>
<version>4.10.9</version>
</dependency> -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
<scope>runtime</scope>
</dependency>
<!-- log4jdbc -->
<!-- jechoi 추가 -->
<dependency>
<groupId>org.lazyluke</groupId>
<artifactId>log4jdbc-remix</artifactId>
<version>0.2.7</version>
</dependency>
<!-- @Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- MySQL JDBC Drive -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.15</version>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>org.bgee.log4jdbc-log4j2</groupId>
<artifactId>log4jdbc-log4j2-jdbc4.1</artifactId>
<version>1.16</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Transactional -->
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>3.2.10</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<version>3.2.10</version>
</dependency>
<!-- MYBATIS -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.2.7</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<!-- database connection pool -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
<version>2.4.0</version>
</dependency>
<!-- Transactional -->
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>3.2.10</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<version>3.2.10</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.2.6</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.gauge</groupId>
<artifactId>gauge-java</artifactId>
<version>0.2.1</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.2</version>
</dependency>
<!-- Apache Commons IO -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<!-- ehcache -->
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.10.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1</version>
</dependency>
<!-- kongConv -->
<!-- https://mvnrepository.com/artifact/net.sourceforge.jexcelapi/jxl -->
<dependency>
<groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId>
<version>2.6.12</version>
</dependency>
<!-- https://mvnrepository.com/artifact/xalan/xalan -->
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>2.7.1</version>
</dependency>
<!-- eMail 설정 email.jar activation.jar -->
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/backport-util-concurrent/backport-util-concurrent-java12 -->
<dependency>
<groupId>backport-util-concurrent</groupId>
<artifactId>backport-util-concurrent-java12</artifactId>
<version>3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/backport-util-concurrent/backport-util-concurrent -->
<dependency>
<groupId>backport-util-concurrent</groupId>
<artifactId>backport-util-concurrent</artifactId>
<version>3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.hibersap/com.sap.conn.jco.sapjco3 -->
<dependency>
<groupId>org.hibersap</groupId>
<artifactId>com.sap.conn.jco.sapjco3</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.15</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.sap.jco/sapjco -->
<!-- cep 임시 주석
<dependency>
<groupId>com.sap.jco</groupId>
<artifactId>sapjco</artifactId>
<version>3.0.14</version>
</dependency> -->
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>org.test.int1.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--><tomcat-users version="1.0" xmlns="http://tomcat.apache.org/xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd">
<!--
NOTE: By default, no user is included in the "manager-gui" role required
to operate the "/manager/html" web application. If you wish to use this app,
you must define such a user - the username and password are arbitrary. It is
strongly recommended that you do NOT use one of the users in the commented out
section below since they are intended for use with the examples web
application.
-->
<!--
NOTE: The sample user and role entries below are intended for use with the
examples web application. They are wrapped in a comment and thus are ignored
when reading this file. If you wish to configure these users for use with the
examples web application, do not forget to remove the <!.. ..> that surrounds
them. You will also need to set the passwords to something appropriate.
-->
<!--
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="<must-be-changed>" roles="tomcat"/>
<user username="both" password="<must-be-changed>" roles="tomcat,role1"/>
<user username="role1" password="<must-be-changed>" roles="role1"/>
-->
</tomcat-users>

View File

@ -0,0 +1,94 @@
buildscript {
ext {
springBootVersion = '1.5.12.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse-wtp'
apply plugin: 'org.springframework.boot'
apply plugin: 'maven'
jar {
manifest {
attributes 'Title':'ESN_DAEMON','Version':1.0,'Main-Class':'com.northbr.esn.daemon.EsnDaemonApplication'
}
baseName 'ESN'
dependsOn configurations.runtime
from {
configurations.compile.collect {it.isDirectory()? it: zipTree(it)}
}
exclude 'META-INF/*.RSA','META-INF/*.SF','META-INF/*.DSA'
}
group = 'com.northbr.esn.daemon'
sourceCompatibility = 1.8
repositories {
mavenCentral()
maven { url "https://code.lds.org/nexus/content/groups/main-repo"}
}
configurations {
providedRuntime
}
dependencies {
compile('commons-lang:commons-lang:2.3')
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.2')
compile('org.springframework.boot:spring-boot-starter-security')
runtime('org.springframework.boot:spring-boot-devtools')
compile group: 'org.codehaus.janino', name: 'janino', version: '3.0.6'
compileOnly('org.projectlombok:lombok')
compile('com.oracle:ojdbc6:11.2.0.3')
compile group: 'commons-io', name: 'commons-io', version: '2.6'
compile group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1'
// compile files('libs/tibero6-jdbc-14.jar')
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'org.postgresql:postgresql:42.2.2'
compile 'com.github.ulisesbocchio:jasypt-spring-boot-starter:1.17'
compile 'org.springframework.session:spring-session-core:2.0.2.RELEASE'
compile('org.springframework.session:spring-session')
compile group: 'org.springframework.data', name: 'spring-data-redis', version: '2.0.6.RELEASE'
compile 'io.jsonwebtoken:jjwt:0.7.0'
// https://mvnrepository.com/artifact/org.springframework.mobile/spring-mobile-device
compile group: 'org.springframework.mobile', name: 'spring-mobile-device', version: '1.1.5.RELEASE'
// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.1'
// https://mvnrepository.com/artifact/commons-codec/commons-codec
compile group: 'commons-codec', name: 'commons-codec', version: '1.11'
// https://mvnrepository.com/artifact/net.lingala.zip4j/zip4j
compile group: 'net.lingala.zip4j', name: 'zip4j', version: '1.3.2'
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
// https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.2'
// https://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore
compile group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.4.4'
// https://mvnrepository.com/artifact/com.google.code.gson/gson
compile group: 'com.google.code.gson', name: 'gson', version: '2.7'
compile 'org.apache.httpcomponents:httpclient:4.5.6'
// compile group: 'net.shibboleth.utilities', name: 'trustany-ssl', version: '1.0.0'
// compile 'io.springfox:springfox-swagger2:2.6.1'
// compile 'io.springfox:springfox-swagger-ui:2.6.1'
providedRuntime('org.springframework.boot:spring-boot-starter-tomcat')
//testCompile('org.springframework.boot:spring-boot-starter-test')
//testCompile('org.springframework.security:spring-security-test')
}

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="esn">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/webapp/WEB-INF/properties"/>
<property name="java-output-path" value="target/classes"/>
<property name="context-root" value="controller"/>
</wb-module>
</project-modules>

View File

@ -0,0 +1,420 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sample</groupId>
<artifactId>mybatis</artifactId>
<name>Spring_EX_01</name>
<packaging>war</packaging>
<version>1.0.0-BUILD-SNAPSHOT</version>
<properties>
<java-version>1.8</java-version>
<org.springframework-version>4.3.3.RELEASE</org.springframework-version>
<org.aspectj-version>1.6.10</org.aspectj-version>
<org.slf4j-version>1.6.6</org.slf4j-version>
</properties>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-tomcat -->
<!--
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<version>2.3.0.RELEASE</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.3.0.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-autoconfigure -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.9</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.thymeleaf.extras/thymeleaf-extras-springsecurity4 -->
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity4</artifactId>
<version>3.0.2.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180813</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-codec.wso2/commons-codec -->
<!--
<dependency>
<groupId>commons-codec.wso2</groupId>
<artifactId>commons-codec</artifactId>
<version>1.4.0.wso2v1</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/net.lingala.zip4j/zip4j -->
<dependency>
<groupId>net.lingala.zip4j</groupId>
<artifactId>zip4j</artifactId>
<version>1.3.2</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
<scope>runtime</scope>
</dependency>
<!-- @Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- MySQL -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.5</version>
</dependency>
<!-- MyBatis 3.4.1 -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.1</version>
</dependency>
<!-- MyBatis-Spring -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.0</version>
</dependency>
<!-- Spring-jdbc -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Spring-test -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-test -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Mybatis log -->
<!-- https://mvnrepository.com/artifact/org.bgee.log4jdbc-log4j2/log4jdbc-log4j2-jdbc4.1 -->
<dependency>
<groupId>org.bgee.log4jdbc-log4j2</groupId>
<artifactId>log4jdbc-log4j2-jdbc4</artifactId>
<version>1.16</version>
</dependency>
<!-- mariaDB -->
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.0.1</version>
</dependency>
<!-- PostgreSQL -->
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.5</version>
</dependency>
<!-- MSSQL -->
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.0.0.jre8</version>
</dependency>
<!-- Oracle 11 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>11.2.0.3.0</version>
</dependency>
-->
<!-- Oracle 12 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>12.1.0.2</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-tomcat -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<version>2.1.5.RELEASE</version>
</dependency>
<!-- 엑셀 제어(xls) maven setting -->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<!--
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<!-- 엑셀 제어(xlsx) maven setting-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<!--
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-core -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.3.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-web -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>5.3.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.13.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>org.test.int1.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,327 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sample</groupId>
<artifactId>mybatis</artifactId>
<name>Spring_EX_01</name>
<packaging>war</packaging>
<version>1.0.0-BUILD-SNAPSHOT</version>
<properties>
<java-version>1.8</java-version>
<org.springframework-version>4.3.3.RELEASE</org.springframework-version>
<org.aspectj-version>1.6.10</org.aspectj-version>
<org.slf4j-version>1.6.6</org.slf4j-version>
</properties>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
<scope>runtime</scope>
</dependency>
<!-- @Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- MySQL -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.5</version>
</dependency>
<!-- MyBatis 3.4.1 -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.1</version>
</dependency>
<!-- MyBatis-Spring -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.0</version>
</dependency>
<!-- Spring-jdbc -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Spring-test -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-test -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Mybatis log -->
<!-- https://mvnrepository.com/artifact/org.bgee.log4jdbc-log4j2/log4jdbc-log4j2-jdbc4.1 -->
<dependency>
<groupId>org.bgee.log4jdbc-log4j2</groupId>
<artifactId>log4jdbc-log4j2-jdbc4</artifactId>
<version>1.16</version>
</dependency>
<!-- mariaDB -->
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.0.1</version>
</dependency>
<!-- PostgreSQL -->
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.5</version>
</dependency>
<!-- MSSQL -->
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.0.0.jre8</version>
</dependency>
<!-- Oracle 11 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>11.2.0.3.0</version>
</dependency>
-->
<!-- Oracle 12 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>12.1.0.2</version>
</dependency>
-->
<!-- 엑셀 제어(xls) maven setting -->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<!--
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<!-- 엑셀 제어(xlsx) maven setting-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<!--
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-core -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.3.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-web -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>5.3.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.13.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>org.test.int1.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,217 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sample</groupId>
<artifactId>mybatis</artifactId>
<name>Spring_EX_01</name>
<packaging>war</packaging>
<version>1.0.0-BUILD-SNAPSHOT</version>
<properties>
<java-version>1.8</java-version>
<org.springframework-version>4.3.3.RELEASE</org.springframework-version>
<org.aspectj-version>1.6.10</org.aspectj-version>
<org.slf4j-version>1.6.6</org.slf4j-version>
</properties>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
<scope>runtime</scope>
</dependency>
<!-- @Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- MySQL -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.5</version>
</dependency>
<!-- MyBatis 3.4.1 -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.1</version>
</dependency>
<!-- MyBatis-Spring -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.0</version>
</dependency>
<!-- Spring-jdbc -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Spring-test -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-test -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Mybatis log -->
<!-- https://mvnrepository.com/artifact/org.bgee.log4jdbc-log4j2/log4jdbc-log4j2-jdbc4.1 -->
<dependency>
<groupId>org.bgee.log4jdbc-log4j2</groupId>
<artifactId>log4jdbc-log4j2-jdbc4</artifactId>
<version>1.16</version>
</dependency>
<!-- mariaDB -->
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.0.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>org.test.int1.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,21 @@
[{
"str_code": "8808983710440",
"str_name": "강화지점",
"esn_url": "http://220.87.30.52:8081"
},
{
"str_code": "1036",
"str_name": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
"esn_url": "http://192.168.0.118:8081"
},
{
"str_code": "1234",
"str_name": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
"esn_url": "http://192.168.0.18:8081"
},
{
"str_code": "1035",
"str_name": "<22><><EFBFBD><EFBFBD>õ<EFBFBD><C3B5>",
"esn_url": "http://192.168.0.18:8081"
}
]

View File

@ -0,0 +1,560 @@
package com.zioinfo.esn.web.view.excel;
import java.lang.reflect.Type;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.DataFormat;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.PatternFormatting;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.util.CellRangeAddressList;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.zioinfo.esn.web.domain.ProcessResponse;
import com.zioinfo.esn.web.domain.enumerate.ExcelExtension;
import com.zioinfo.esn.web.domain.vo.BiztpVo;
import com.zioinfo.esn.web.domain.vo.StoreGroupVo;
import com.zioinfo.esn.web.domain.vo.StoreVo;
import com.zioinfo.esn.web.util.CommonUtil;
public class StoreListExcelView extends AbstractExcelViewAdapter {
protected enum MyStriped {WHITE, GREYED;}
protected enum MyScriped {BLACK, BLACK_BOLD, GREEN, DARK_RED, RED, NUMBER, NUMBER_BOLD, DATE;}
protected Map<String, String> activeDeviceTypeMap = new HashMap<String, String>();
protected final String MY_JAVA_DATE_FORMAT = "yy-MM-dd HH:mm:ss";
public StoreListExcelView(ExcelExtension excelExtension, Map<String, String> i18n) {
super(excelExtension, i18n);
activeDeviceTypeMap.put("primary", i18n.get("active.device.type.primary"));
activeDeviceTypeMap.put("secondary", i18n.get("backup"));
activeDeviceTypeMap.put("single", i18n.get("active.device.type.single"));
}
@Override
protected void buildExcelDocument(Map<String, Object> model,
Workbook workbook,
HttpServletRequest request,
HttpServletResponse response) throws Exception {
//set Filename
setAttachedFilename(request, response, new StringBuilder()
.append(i18n.get("store"))
.append(i18n.get("list"))
.append(".")
.append(super.excelExtension).toString());
//parse JSONs from model
Type classOfT = null;
classOfT = new TypeToken<ProcessResponse<List<StoreVo>>>(){}.getType();
ProcessResponse<List<StoreVo>> pr = new Gson().fromJson(model.get("storeList").toString(), classOfT);
List<StoreVo> storeList = (pr.getBody() == null ? new ArrayList<StoreVo>() : pr.getBody());
classOfT = new TypeToken<ProcessResponse<List<StoreGroupVo>>>(){}.getType();
ProcessResponse<List<StoreGroupVo>> pr2 = new Gson().fromJson(model.get("groupList").toString(), classOfT);
List<StoreGroupVo> storeGroupList = (pr2.getBody() == null ? new ArrayList<StoreGroupVo>() : pr2.getBody());
classOfT = new TypeToken<ProcessResponse<List<BiztpVo>>>(){}.getType();
ProcessResponse<List<BiztpVo>> pr3 = new Gson().fromJson(model.get("biztpList").toString(), classOfT);
List<BiztpVo> biztpList = (pr3.getBody() == null ? new ArrayList<BiztpVo>() : pr3.getBody());
Map<String, String> biztpMap = new HashMap<String, String>();
for (BiztpVo vo : biztpList) {
biztpMap.put(vo.getBiztp_code(), vo.getBiztp_name());
}
boolean[] groupYns = new boolean[] {false, false, false};
String[] groupNames = new String[] {new String(), new String(), new String()};
if(storeGroupList.size() == 3 && groupYns.length == 3 && groupNames.length == 3) {
for (int i = 0; i < storeGroupList.size(); i++) {
StoreGroupVo vo = storeGroupList.get(i);
groupNames[i] = vo.getGroup_name();
groupYns[i] = (!StringUtils.isBlank(vo.getUse_yn()) && !StringUtils.equalsIgnoreCase("Y", vo.getUse_yn()));
}
}
// create excel xls sheet
Sheet sheet = workbook.createSheet("매장");
try {
CellRangeAddressList addrList = new CellRangeAddressList();
addrList.addCellRangeAddress( CellRangeAddress.valueOf("A1:A2") ); //no
addrList.addCellRangeAddress( CellRangeAddress.valueOf("B1:B2") ); //group1
addrList.addCellRangeAddress( CellRangeAddress.valueOf("C1:C2") ); //group2
addrList.addCellRangeAddress( CellRangeAddress.valueOf("D1:D2") ); //group3
addrList.addCellRangeAddress( CellRangeAddress.valueOf("E1:G1") ); //매장
addrList.addCellRangeAddress( CellRangeAddress.valueOf("H1:H2") ); //Core 타입
addrList.addCellRangeAddress( CellRangeAddress.valueOf("I1:I2") ); //IP 주소
addrList.addCellRangeAddress( CellRangeAddress.valueOf("J1:J2") ); //상태
addrList.addCellRangeAddress( CellRangeAddress.valueOf("K1:K2") ); //G/W
addrList.addCellRangeAddress( CellRangeAddress.valueOf("L1:L2") ); //N/W
addrList.addCellRangeAddress( CellRangeAddress.valueOf("M1:M2") ); //Sync.
addrList.addCellRangeAddress( CellRangeAddress.valueOf("N1:P1") ); //G/W 현황
addrList.addCellRangeAddress( CellRangeAddress.valueOf("Q1:V1") ); //태그 현황
addrList.addCellRangeAddress( CellRangeAddress.valueOf("W1:W2") ); //ESL파일
addrList.addCellRangeAddress( CellRangeAddress.valueOf("X1:X2") ); //업데이트 일시
//Cell Merged Region
for (CellRangeAddress addr : addrList.getCellRangeAddresses()) {
sheet.addMergedRegion( addr );
}
//Column Hidden
int indexOfGroup1 = 1;
for (int i = 0; i < groupYns.length; i++) {
sheet.setColumnHidden(addrList.getCellRangeAddress(i + indexOfGroup1).getFirstColumn(), groupYns[i]);
}
//Auto Filter
int firstRow = addrList.getCellRangeAddress(0).getLastRow();
int lastRow = addrList.getCellRangeAddress(addrList.countRanges() - 1).getLastRow();
int firstCol = addrList.getCellRangeAddress(0).getFirstColumn();
int lastCol = addrList.getCellRangeAddress(addrList.countRanges() - 1).getLastColumn();
sheet.setAutoFilter( new CellRangeAddress(firstRow, lastRow, firstCol, lastCol) );
} catch (Exception e) {
e.printStackTrace();
}
try {
// create style for header cells
Font fontBlackBold = workbook.createFont();
fontBlackBold.setFontName(CommonUtil.isAvailableSystemFontname("맑은 고딕") ? "맑은 고딕" : "Arial");
fontBlackBold.setBoldweight(Font.BOLDWEIGHT_BOLD);
fontBlackBold.setBold(true);
Font fontBlack = workbook.createFont();
fontBlack.setFontName(CommonUtil.isAvailableSystemFontname("맑은 고딕") ? "맑은 고딕" : "Arial");
Font fontGreen = workbook.createFont();
fontGreen.setFontName(CommonUtil.isAvailableSystemFontname("맑은 고딕") ? "맑은 고딕" : "Arial");
fontGreen.setColor(HSSFColor.GREEN.index);
Font fontDarkRed = workbook.createFont();
fontDarkRed.setFontName(CommonUtil.isAvailableSystemFontname("맑은 고딕") ? "맑은 고딕" : "Arial");
fontDarkRed.setColor(HSSFColor.DARK_RED.index);
Font fontRed = workbook.createFont();
fontRed.setFontName(CommonUtil.isAvailableSystemFontname("맑은 고딕") ? "맑은 고딕" : "Arial");
fontRed.setColor(HSSFColor.RED.index);
short borderThin = (short)BorderStyle.THIN.ordinal();
CellStyle styleBase = workbook.createCellStyle();
styleBase.setFillPattern(PatternFormatting.SOLID_FOREGROUND);
styleBase.setAlignment(CellStyle.ALIGN_CENTER);
styleBase.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
styleBase.setFont(fontBlack);
styleBase.setBorderTop(borderThin);
styleBase.setBorderLeft(borderThin);
styleBase.setBorderRight(borderThin);
styleBase.setBorderBottom(borderThin);
CellStyle styleHeader = workbook.createCellStyle();
styleHeader.cloneStyleFrom(styleBase);
styleHeader.setFillForegroundColor(HSSFColor.LIGHT_ORANGE.index);
styleHeader.setFont(fontBlackBold);
final CellStyle[][] BODY_STYLES = new CellStyle[MyStriped.values().length][MyScriped.values().length];
for (int i = 0; i < BODY_STYLES.length; i++) {
for (int j = 0; j < BODY_STYLES[i].length; j++) {
BODY_STYLES[i][j] = workbook.createCellStyle();
}
}
DataFormat dataFormat = workbook.getCreationHelper().createDataFormat();
CellStyle[] wh = BODY_STYLES[ MyStriped.WHITE.ordinal() ];
CellStyle[] gr = BODY_STYLES[ MyStriped.GREYED.ordinal()];
//WHITE
wh[ MyScriped.BLACK.ordinal() ].cloneStyleFrom( styleBase );
wh[ MyScriped.BLACK.ordinal() ].setFillForegroundColor(HSSFColor.WHITE.index);
wh[ MyScriped.BLACK.ordinal() ].setFont(fontBlack);
wh[ MyScriped.BLACK_BOLD.ordinal() ].cloneStyleFrom( styleBase );
wh[ MyScriped.BLACK_BOLD.ordinal() ].setFillForegroundColor(HSSFColor.WHITE.index);
wh[ MyScriped.BLACK_BOLD.ordinal() ].setFont(fontBlackBold);
wh[ MyScriped.GREEN.ordinal() ].cloneStyleFrom( BODY_STYLES[MyStriped.WHITE.ordinal()][MyScriped.BLACK.ordinal()] );
wh[ MyScriped.GREEN.ordinal() ].setFont(fontGreen);
wh[ MyScriped.DARK_RED.ordinal() ].cloneStyleFrom( BODY_STYLES[MyStriped.WHITE.ordinal()][MyScriped.BLACK.ordinal()] );
wh[ MyScriped.DARK_RED.ordinal() ].setFont(fontDarkRed);
wh[ MyScriped.RED.ordinal() ].cloneStyleFrom( BODY_STYLES[MyStriped.WHITE.ordinal()][MyScriped.BLACK.ordinal()] );
wh[ MyScriped.RED.ordinal() ].setFont(fontRed);
wh[ MyScriped.NUMBER.ordinal() ].cloneStyleFrom( BODY_STYLES[MyStriped.WHITE.ordinal()][MyScriped.BLACK.ordinal()] );
wh[ MyScriped.NUMBER.ordinal() ].setDataFormat(dataFormat.getFormat("#,##0"));
wh[ MyScriped.NUMBER_BOLD.ordinal() ].cloneStyleFrom( BODY_STYLES[MyStriped.WHITE.ordinal()][MyScriped.BLACK_BOLD.ordinal()] );
wh[ MyScriped.NUMBER_BOLD.ordinal() ].setDataFormat(dataFormat.getFormat("#,##0"));
wh[ MyScriped.DATE.ordinal() ].cloneStyleFrom( BODY_STYLES[MyStriped.WHITE.ordinal()][MyScriped.BLACK.ordinal()] );
wh[ MyScriped.DATE.ordinal() ].setDataFormat(dataFormat.getFormat(MY_JAVA_DATE_FORMAT));
//GREYED
for (MyScriped mcs : MyScriped.values()) { //Same Style.
gr[ mcs.ordinal() ].cloneStyleFrom( BODY_STYLES[MyStriped.WHITE.ordinal()][mcs.ordinal()] );
gr[ mcs.ordinal() ].setFillForegroundColor(HSSFColor.GREY_25_PERCENT.index);
}
// create header row
int rowCount = 0, colCount = 0;
short headerHeight = Short.valueOf("400");
colCount = 0;
Row headerRow1 = sheet.createRow(rowCount++);
headerRow1.setHeight(headerHeight);
//No.
headerRow1.createCell(colCount).setCellValue( i18n.get( "no" ) );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//group1
headerRow1.createCell(colCount).setCellValue( groupNames[0] );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//group2
headerRow1.createCell(colCount).setCellValue( groupNames[1] );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//group3
headerRow1.createCell(colCount).setCellValue( groupNames[2] );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//매장 #업태
headerRow1.createCell(colCount).setCellValue( i18n.get( "store" ) );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//매장 #코드
headerRow1.createCell(colCount);
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//매장 #매장명
headerRow1.createCell(colCount);
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//Core 타입
headerRow1.createCell(colCount).setCellValue( i18n.get( "core" ) + " " + i18n.get( "type" ) );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//IP 주소
headerRow1.createCell(colCount).setCellValue( i18n.get( "ip.address" ) );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//상태
headerRow1.createCell(colCount).setCellValue( i18n.get( "status" ) );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//G/W
headerRow1.createCell(colCount).setCellValue( i18n.get( "gateway" ) );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//N/W
headerRow1.createCell(colCount).setCellValue( i18n.get( "network" ) );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//Sync.
headerRow1.createCell(colCount).setCellValue( i18n.get( "sync" ) );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//G/W 현황 #전체
headerRow1.createCell(colCount).setCellValue( i18n.get( "gateway.present.condition" ) );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//G/W 현황 #접속
headerRow1.createCell(colCount);
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//G/W 현황 #미접속
headerRow1.createCell(colCount);
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//태그 현황 #전체
headerRow1.createCell(colCount).setCellValue( i18n.get( "tag.present.condition" ) );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//태그 현황 #사용중
headerRow1.createCell(colCount);
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//태그 현황 #미접속
headerRow1.createCell(colCount);
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//태그 현황 #미사용
headerRow1.createCell(colCount);
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//태그 현황 #보관박스
headerRow1.createCell(colCount);
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//태그 현황 #LowBattery
headerRow1.createCell(colCount);
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//ESL파일
headerRow1.createCell(colCount).setCellValue( i18n.get( "esl.file" ) );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//업데이트 일시
headerRow1.createCell(colCount).setCellValue( i18n.get( "update.date.time" ) );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
colCount = 0;
Row headerRow2 = sheet.createRow(rowCount++);
headerRow2.setHeight(headerHeight);
//No.
headerRow2.createCell(colCount++).setCellStyle(styleHeader);
//group1
headerRow2.createCell(colCount++).setCellStyle(styleHeader);
//group2
headerRow2.createCell(colCount++).setCellStyle(styleHeader);
//group3
headerRow2.createCell(colCount++).setCellStyle(styleHeader);
//매장 #업태
headerRow2.createCell(colCount).setCellValue( i18n.get( "business.conditions" ) );
headerRow2.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//매장 #코드
headerRow2.createCell(colCount).setCellValue( i18n.get( "code" ) );
headerRow2.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//매장 #매장명
headerRow2.createCell(colCount).setCellValue( i18n.get( "store.name" ) );
headerRow2.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//Core 타입
headerRow2.createCell(colCount++).setCellStyle(styleHeader);
//IP 주소
headerRow2.createCell(colCount++).setCellStyle(styleHeader);
//상태
headerRow2.createCell(colCount++).setCellStyle(styleHeader);
//G/W
headerRow2.createCell(colCount++).setCellStyle(styleHeader);
//N/W
headerRow2.createCell(colCount++).setCellStyle(styleHeader);
//Sync.
headerRow2.createCell(colCount++).setCellStyle(styleHeader);
//G/W 현황 #전체
headerRow2.createCell(colCount).setCellValue( i18n.get( "total" ) );
headerRow2.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//G/W 현황 #접속
headerRow2.createCell(colCount).setCellValue( i18n.get( "connected" ) );
headerRow2.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//G/W 현황 #미접속
headerRow2.createCell(colCount).setCellValue( i18n.get( "disconnected" ) );
headerRow2.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//태그 현황 #전체
headerRow2.createCell(colCount).setCellValue( i18n.get( "total" ) );
headerRow2.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//태그 현황 #사용중
headerRow2.createCell(colCount).setCellValue( i18n.get( "in_use" ) );
headerRow2.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//태그 현황 #미접속
headerRow2.createCell(colCount).setCellValue( i18n.get( "disconnected" ) );
headerRow2.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//태그 현황 #미사용
headerRow2.createCell(colCount).setCellValue( i18n.get( "unused" ) );
headerRow2.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//태그 현황 #보관박스
headerRow2.createCell(colCount).setCellValue( i18n.get( "onstorage" ) );
headerRow2.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//태그 현황 #LowBattery
headerRow2.createCell(colCount).setCellValue( i18n.get( "low_battery" ) );
headerRow2.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//ESL파일
headerRow2.createCell(colCount++).setCellStyle(styleHeader);
//업데이트 일시
headerRow2.createCell(colCount++).setCellStyle(styleHeader);
// create body row
final String BLANK = new String("-");
final Double ZERO = new Double(0);
for(StoreVo vo : storeList){
Row bodyRow = sheet.createRow(rowCount);
int striped = (rowCount%2 == 0 ? MyStriped.GREYED.ordinal() : MyStriped.WHITE.ordinal());
rowCount++;
colCount = 0;
//No.
bodyRow.createCell(colCount).setCellValue( bodyRow.createCell(colCount).getRowIndex() - 1 );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.BLACK.ordinal()] );
colCount++;
//group1
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getGroup1_name()) ? BLANK : vo.getGroup1_name() );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.BLACK.ordinal()] );
colCount++;
//group2
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getGroup2_name()) ? BLANK : vo.getGroup2_name() );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.BLACK.ordinal()] );
colCount++;
//group3
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getGroup3_name()) ? BLANK : vo.getGroup3_name() );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.BLACK.ordinal()] );
colCount++;
//매장 #업태
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getBiztp_code()) ? BLANK : biztpMap.get(vo.getBiztp_code()) );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.BLACK.ordinal()] );
colCount++;
//매장 #코드
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getStr_code()) ? BLANK : vo.getStr_code() );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.BLACK.ordinal()] );
colCount++;
//매장 #매장명
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getStr_name()) ? BLANK : vo.getStr_name() );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.BLACK.ordinal()] );
colCount++;
//Core 타입
String activeDeviceType = activeDeviceTypeMap.get( vo.getActive_device_type() );
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(activeDeviceType) ? BLANK : activeDeviceType );
bodyRow.getCell(colCount).setCellStyle( StringUtils.equalsIgnoreCase(vo.getActive_device_type(), "secondary") ? BODY_STYLES[striped][MyScriped.RED.ordinal()] : BODY_STYLES[striped][MyScriped.BLACK.ordinal()] );
colCount++;
//IP 주소
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getIp_addr()) ? BLANK : vo.getIp_addr() );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.BLACK.ordinal()] );
colCount++;
String[] status = new String[] {
(vo.getCore_status() == null ? BLANK : vo.getCore_status())
, (vo.getGateway_status() == null ? BLANK : vo.getGateway_status())
, (vo.getNetwork_status() == null ? BLANK : vo.getNetwork_status())
, (vo.getSync_status() == null ? BLANK : vo.getSync_status())
};
//상태
bodyRow.createCell(colCount).setCellValue( status[0] );
bodyRow.getCell(colCount).setCellStyle( status[0].length()==0
? BODY_STYLES[striped][MyScriped.BLACK.ordinal()]
: (StringUtils.equalsIgnoreCase("GOOD", status[0]) ? BODY_STYLES[striped][MyScriped.GREEN.ordinal()] : BODY_STYLES[striped][MyScriped.DARK_RED.ordinal()]) );
colCount++;
//G/W
bodyRow.createCell(colCount).setCellValue( status[1] );
bodyRow.getCell(colCount).setCellStyle( status[1].length()==0
? BODY_STYLES[striped][MyScriped.BLACK.ordinal()]
: (StringUtils.equalsIgnoreCase("GOOD", status[1]) ? BODY_STYLES[striped][MyScriped.GREEN.ordinal()] : BODY_STYLES[striped][MyScriped.DARK_RED.ordinal()]) );
colCount++;
//N/W
bodyRow.createCell(colCount).setCellValue( status[2] );
bodyRow.getCell(colCount).setCellStyle( status[2].length()==0
? BODY_STYLES[striped][MyScriped.BLACK.ordinal()]
: (StringUtils.equalsIgnoreCase("GOOD", status[2]) ? BODY_STYLES[striped][MyScriped.GREEN.ordinal()] : BODY_STYLES[striped][MyScriped.DARK_RED.ordinal()]) );
colCount++;
//Sync.
bodyRow.createCell(colCount).setCellValue( status[3] );
bodyRow.getCell(colCount).setCellStyle( status[3].length()==0
? BODY_STYLES[striped][MyScriped.BLACK.ordinal()]
: (StringUtils.equalsIgnoreCase("GOOD", status[3]) ? BODY_STYLES[striped][MyScriped.GREEN.ordinal()] : BODY_STYLES[striped][MyScriped.DARK_RED.ordinal()]) );
colCount++;
Double gw_tot_cnt = Double.valueOf(vo.getGw_tot_cnt()), gw_fail_cnt = Double.valueOf(vo.getGw_fail_cnt());
//G/W 현황 #전체
bodyRow.createCell(colCount).setCellValue( gw_tot_cnt);
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.NUMBER_BOLD.ordinal()] );
colCount++;
//G/W 현황 #접속
bodyRow.createCell(colCount).setCellType(Cell.CELL_TYPE_FORMULA);
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.NUMBER.ordinal()] );
String formula = new StringBuffer()
.append( (char)('A'-1+colCount) )
.append( rowCount )
.append( '-' )
.append( (char)('A'-1+colCount+2) )
.append( rowCount )
.toString(); //N3-P3, N4-P4....
logger.debug("formula : " + formula);
bodyRow.getCell(colCount).setCellFormula( formula );
bodyRow.getCell(colCount).setCellValue( gw_tot_cnt - gw_fail_cnt );
colCount++;
//G/W 현황 #미접속
bodyRow.createCell(colCount).setCellValue( gw_fail_cnt );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.NUMBER.ordinal()] );
colCount++;
//태그 현황 #전체
bodyRow.createCell(colCount).setCellValue( Double.valueOf(vo.getTotal()) );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.NUMBER_BOLD.ordinal()] );
colCount++;
//태그 현황 #사용중
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getConnected()) ? ZERO : Double.valueOf(vo.getConnected()) );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.NUMBER.ordinal()] );
colCount++;
//태그 현황 #미접속
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getDisconnected()) ? ZERO : Double.valueOf(vo.getDisconnected()) );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.NUMBER.ordinal()] );
colCount++;
//태그 현황 #미사용
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getRemoved()) ? ZERO : Double.valueOf(vo.getRemoved()) );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.NUMBER.ordinal()] );
colCount++;
//태그 현황 #보관박스
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getStorage()) ? ZERO : Double.valueOf(vo.getStorage()) );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.NUMBER.ordinal()] );
colCount++;
//태그 현황 #LowBattery
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getLow_battery()) ? ZERO : Double.valueOf(vo.getLow_battery()) );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.NUMBER.ordinal()] );
colCount++;
//ESL파일
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getG4_file_name()) ? BLANK : vo.getG4_file_name() );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.BLACK.ordinal()] );
colCount++;
//업데이트 일시
Cell cellUpdateTime = bodyRow.createCell(colCount);
try {
cellUpdateTime.setCellValue( new SimpleDateFormat(MY_JAVA_DATE_FORMAT).parse(vo.getUpdate_time()) );
cellUpdateTime.setCellStyle( BODY_STYLES[striped][MyScriped.DATE.ordinal()] );
} catch(NullPointerException|ParseException e) {
cellUpdateTime.setCellValue( BLANK );
cellUpdateTime.setCellStyle( BODY_STYLES[striped][MyScriped.BLACK.ordinal()] );
} finally {
colCount++;
}
} //end of loop
//Widths
final Double[] WIDTHS = new Double[] {
1.5D //No.
, 5.0D //Group 1
, 5.0D //Group 2
, 5.0D //Group 3
, 5.0D //매장 #업태
, 2.0D //매장 #코드
, 6.0D //매장 #매장명
, 3.0D //Core 타입
, 4.0D //IP 주소
, 2.0D //상태
, 2.0D //G/W
, 2.0D //N/W
, 2.0D //Sync.
, 3.0D //G/W 현황 #전체
, 3.0D //G/W 현황 #접속
, 3.0D //G/W 현황 #미접속
, 3.0D //태그 현황 #전체
, 3.0D //태그 현황 #사용중
, 3.0D //태그 현황 #미접속
, 3.0D //태그 현황 #미사용
, 3.0D //태그 현황 #보관박스
, 3.0D //태그 현황 #Low Battery
, 8.0D //ESL파일
, 4.5D //업데이트 일시
};
sheet.setDefaultColumnWidth(10);
for (int columnIndex = 0; columnIndex < WIDTHS.length; columnIndex++) {
sheet.setColumnWidth(columnIndex, Double.valueOf( WIDTHS[columnIndex] * 1000D ).intValue());
} //end of loop
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@ -0,0 +1,428 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sample</groupId>
<artifactId>mybatis</artifactId>
<name>Spring_EX_01</name>
<packaging>war</packaging>
<version>1.0.0-BUILD-SNAPSHOT</version>
<properties>
<java-version>1.8</java-version>
<org.springframework-version>4.3.3.RELEASE</org.springframework-version>
<org.aspectj-version>1.6.10</org.aspectj-version>
<org.slf4j-version>1.6.6</org.slf4j-version>
</properties>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-tomcat -->
<!--
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<version>2.3.0.RELEASE</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web -->
<!--
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.3.0.RELEASE</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-autoconfigure -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.9</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.thymeleaf.extras/thymeleaf-extras-springsecurity4 -->
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity4</artifactId>
<version>3.0.2.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180813</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-codec.wso2/commons-codec -->
<!--
<dependency>
<groupId>commons-codec.wso2</groupId>
<artifactId>commons-codec</artifactId>
<version>1.4.0.wso2v1</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/net.lingala.zip4j/zip4j -->
<dependency>
<groupId>net.lingala.zip4j</groupId>
<artifactId>zip4j</artifactId>
<version>1.3.2</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
<scope>runtime</scope>
</dependency>
<!-- @Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- MySQL -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.5</version>
</dependency>
<!-- MyBatis 3.4.1 -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.1</version>
</dependency>
<!-- MyBatis-Spring -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.0</version>
</dependency>
<!-- Spring-jdbc -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Spring-test -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-test -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Mybatis log -->
<!-- https://mvnrepository.com/artifact/org.bgee.log4jdbc-log4j2/log4jdbc-log4j2-jdbc4.1 -->
<dependency>
<groupId>org.bgee.log4jdbc-log4j2</groupId>
<artifactId>log4jdbc-log4j2-jdbc4</artifactId>
<version>1.16</version>
</dependency>
<!-- mariaDB -->
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.0.1</version>
</dependency>
<!-- PostgreSQL -->
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.5</version>
</dependency>
<!-- MSSQL -->
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.0.0.jre8</version>
</dependency>
<!-- Oracle 11 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>11.2.0.3.0</version>
</dependency>
-->
<!-- Oracle 12 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>12.1.0.2</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-tomcat -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<version>2.1.5.RELEASE</version>
</dependency>
<!-- 엑셀 제어(xls) maven setting -->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<!--
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<!-- 엑셀 제어(xlsx) maven setting-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<!--
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-core -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.3.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-web -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>5.3.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.13.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>org.test.int1.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,159 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--><!-- Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" at this level.
Documentation at /docs/config/server.html
--><Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener"/>
<!-- Security listener. Documentation at /docs/config/listeners.html
<Listener className="org.apache.catalina.security.SecurityListener" />
-->
<!--APR library loader. Documentation at /docs/apr.html -->
<Listener SSLEngine="on" className="org.apache.catalina.core.AprLifecycleListener"/>
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>
<!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
-->
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
</GlobalNamingResources>
<!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" Note: A "Service" is not itself a "Container",
so you may not define subcomponents such as "Valves" at this level.
Documentation at /docs/config/service.html
-->
<Service name="Catalina">
<!--The connectors can use a shared executor, you can define one or more named thread pools-->
<!--
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="150" minSpareThreads="4"/>
-->
<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL/TLS HTTP/1.1 Connector on port 8080
-->
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
-->
<!-- Define an SSL/TLS HTTP/1.1 Connector on port 8443
This connector uses the NIO implementation. The default
SSLImplementation will depend on the presence of the APR/native
library and the useOpenSSL attribute of the
AprLifecycleListener.
Either JSSE or OpenSSL style configuration may be used regardless of
the SSLImplementation selected. JSSE style configuration is used below.
-->
<!--
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true">
<SSLHostConfig>
<Certificate certificateKeystoreFile="conf/localhost-rsa.jks"
type="RSA" />
</SSLHostConfig>
</Connector>
-->
<!-- Define an SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2
This connector uses the APR/native implementation which always uses
OpenSSL for TLS.
Either JSSE or OpenSSL style configuration may be used. OpenSSL style
configuration is used below.
-->
<!--
<Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
maxThreads="150" SSLEnabled="true" >
<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
<SSLHostConfig>
<Certificate certificateKeyFile="conf/localhost-rsa-key.pem"
certificateFile="conf/localhost-rsa-cert.pem"
certificateChainFile="conf/localhost-rsa-chain.pem"
type="RSA" />
</SSLHostConfig>
</Connector>
-->
<!-- Define an AJP 1.3 Connector on port 8009 -->
<!--
<Connector protocol="AJP/1.3"
address="::1"
port="8009"
redirectPort="8443" />
-->
<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host).
Documentation at /docs/config/engine.html -->
<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
-->
<Engine defaultHost="localhost" name="Catalina">
<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->
<!-- Use the LockOutRealm to prevent attempts to guess user passwords
via a brute-force attack -->
<Realm className="org.apache.catalina.realm.LockOutRealm">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
</Realm>
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t &quot;%r&quot; %s %b" prefix="localhost_access_log" suffix=".txt"/>
<Context docBase="Spring_EX_02" path="/controller" reloadable="true" source="org.eclipse.jst.jee.server:Spring_EX_02"/></Host>
</Engine>
</Service>
</Server>

View File

@ -0,0 +1,315 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sample</groupId>
<artifactId>mybatis</artifactId>
<name>Spring_EX_01</name>
<packaging>war</packaging>
<version>1.0.0-BUILD-SNAPSHOT</version>
<properties>
<java-version>1.8</java-version>
<org.springframework-version>4.3.3.RELEASE</org.springframework-version>
<org.aspectj-version>1.6.10</org.aspectj-version>
<org.slf4j-version>1.6.6</org.slf4j-version>
</properties>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
<scope>runtime</scope>
</dependency>
<!-- @Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- MySQL -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.5</version>
</dependency>
<!-- MyBatis 3.4.1 -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.1</version>
</dependency>
<!-- MyBatis-Spring -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.0</version>
</dependency>
<!-- Spring-jdbc -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Spring-test -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-test -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Mybatis log -->
<!-- https://mvnrepository.com/artifact/org.bgee.log4jdbc-log4j2/log4jdbc-log4j2-jdbc4.1 -->
<dependency>
<groupId>org.bgee.log4jdbc-log4j2</groupId>
<artifactId>log4jdbc-log4j2-jdbc4</artifactId>
<version>1.16</version>
</dependency>
<!-- mariaDB -->
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.0.1</version>
</dependency>
<!-- PostgreSQL -->
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.5</version>
</dependency>
<!-- MSSQL -->
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.0.0.jre8</version>
</dependency>
<!-- Oracle 11 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>11.2.0.3.0</version>
</dependency>
-->
<!-- Oracle 12 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>12.1.0.2</version>
</dependency>
-->
<!-- 엑셀 제어(xls) maven setting -->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<!--
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<!-- 엑셀 제어(xlsx) maven setting-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<!--
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.13.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>org.test.int1.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,281 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sample</groupId>
<artifactId>mybatis</artifactId>
<name>Spring_EX_01</name>
<packaging>war</packaging>
<version>1.0.0-BUILD-SNAPSHOT</version>
<properties>
<java-version>1.8</java-version>
<org.springframework-version>4.3.3.RELEASE</org.springframework-version>
<org.aspectj-version>1.6.10</org.aspectj-version>
<org.slf4j-version>1.6.6</org.slf4j-version>
</properties>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
<scope>runtime</scope>
</dependency>
<!-- @Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- MySQL -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.5</version>
</dependency>
<!-- MyBatis 3.4.1 -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.1</version>
</dependency>
<!-- MyBatis-Spring -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.0</version>
</dependency>
<!-- Spring-jdbc -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Spring-test -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-test -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Mybatis log -->
<!-- https://mvnrepository.com/artifact/org.bgee.log4jdbc-log4j2/log4jdbc-log4j2-jdbc4.1 -->
<dependency>
<groupId>org.bgee.log4jdbc-log4j2</groupId>
<artifactId>log4jdbc-log4j2-jdbc4</artifactId>
<version>1.16</version>
</dependency>
<!-- mariaDB -->
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.0.1</version>
</dependency>
<!-- PostgreSQL -->
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.5</version>
</dependency>
<!-- MSSQL -->
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.0.0.jre8</version>
</dependency>
<!-- Oracle 11 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>11.2.0.3.0</version>
</dependency>
-->
<!-- Oracle 12 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>12.1.0.2</version>
</dependency>
-->
<!-- 엑셀 제어(xls) maven setting -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.12</version>
</dependency>
<!-- 엑셀 제어(xlsx) maven setting-->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.9</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>org.test.int1.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,427 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sample</groupId>
<artifactId>mybatis</artifactId>
<name>Spring_EX_01</name>
<packaging>war</packaging>
<version>1.0.0-BUILD-SNAPSHOT</version>
<properties>
<java-version>1.8</java-version>
<org.springframework-version>4.3.3.RELEASE</org.springframework-version>
<org.aspectj-version>1.6.10</org.aspectj-version>
<org.slf4j-version>1.6.6</org.slf4j-version>
</properties>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-tomcat -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<version>2.3.0.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.3.0.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-autoconfigure -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.9</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.thymeleaf.extras/thymeleaf-extras-springsecurity4 -->
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity4</artifactId>
<version>3.0.2.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180813</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-codec.wso2/commons-codec -->
<!--
<dependency>
<groupId>commons-codec.wso2</groupId>
<artifactId>commons-codec</artifactId>
<version>1.4.0.wso2v1</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/net.lingala.zip4j/zip4j -->
<dependency>
<groupId>net.lingala.zip4j</groupId>
<artifactId>zip4j</artifactId>
<version>1.3.2</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
<scope>runtime</scope>
</dependency>
<!-- @Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- MySQL -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.5</version>
</dependency>
<!-- MyBatis 3.4.1 -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.1</version>
</dependency>
<!-- MyBatis-Spring -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.0</version>
</dependency>
<!-- Spring-jdbc -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Spring-test -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-test -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Mybatis log -->
<!-- https://mvnrepository.com/artifact/org.bgee.log4jdbc-log4j2/log4jdbc-log4j2-jdbc4.1 -->
<dependency>
<groupId>org.bgee.log4jdbc-log4j2</groupId>
<artifactId>log4jdbc-log4j2-jdbc4</artifactId>
<version>1.16</version>
</dependency>
<!-- mariaDB -->
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.0.1</version>
</dependency>
<!-- PostgreSQL -->
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.5</version>
</dependency>
<!-- MSSQL -->
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.0.0.jre8</version>
</dependency>
<!-- Oracle 11 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>11.2.0.3.0</version>
</dependency>
-->
<!-- Oracle 12 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>12.1.0.2</version>
</dependency>
-->
<!-- 엑셀 제어(xls) maven setting -->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<!--
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<!-- 엑셀 제어(xlsx) maven setting-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<!--
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-core -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.3.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-web -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>5.3.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.13.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-tomcat -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<version>2.3.0.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jasypt/jasypt -->
<dependency>
<groupId>org.jasypt</groupId>
<artifactId>jasypt</artifactId>
<version>1.9.3</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>org.test.int1.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,306 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sample</groupId>
<artifactId>mybatis</artifactId>
<name>Spring_EX_01</name>
<packaging>war</packaging>
<version>1.0.0-BUILD-SNAPSHOT</version>
<properties>
<java-version>1.8</java-version>
<org.springframework-version>4.3.3.RELEASE</org.springframework-version>
<org.aspectj-version>1.6.10</org.aspectj-version>
<org.slf4j-version>1.6.6</org.slf4j-version>
</properties>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
<scope>runtime</scope>
</dependency>
<!-- @Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- MySQL -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.5</version>
</dependency>
<!-- MyBatis 3.4.1 -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.1</version>
</dependency>
<!-- MyBatis-Spring -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.0</version>
</dependency>
<!-- Spring-jdbc -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Spring-test -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-test -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Mybatis log -->
<!-- https://mvnrepository.com/artifact/org.bgee.log4jdbc-log4j2/log4jdbc-log4j2-jdbc4.1 -->
<dependency>
<groupId>org.bgee.log4jdbc-log4j2</groupId>
<artifactId>log4jdbc-log4j2-jdbc4</artifactId>
<version>1.16</version>
</dependency>
<!-- mariaDB -->
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.0.1</version>
</dependency>
<!-- PostgreSQL -->
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.5</version>
</dependency>
<!-- MSSQL -->
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.0.0.jre8</version>
</dependency>
<!-- Oracle 11 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>11.2.0.3.0</version>
</dependency>
-->
<!-- Oracle 12 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>12.1.0.2</version>
</dependency>
-->
<!-- 엑셀 제어(xls) maven setting -->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<!--
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<!-- 엑셀 제어(xlsx) maven setting-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.13.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>org.test.int1.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--><!-- The contents of this file will be loaded for each web application --><Context>
<!-- Default set of monitored resources. If one of these changes, the -->
<!-- web application will be reloaded. -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
-->
</Context>

View File

@ -0,0 +1,272 @@
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ============================================================================
// catalina.policy - Security Policy Permissions for Tomcat
//
// This file contains a default set of security policies to be enforced (by the
// JVM) when Catalina is executed with the "-security" option. In addition
// to the permissions granted here, the following additional permissions are
// granted to each web application:
//
// * Read access to the web application's document root directory
// * Read, write and delete access to the web application's working directory
// ============================================================================
// ========== SYSTEM CODE PERMISSIONS =========================================
// These permissions apply to javac
grant codeBase "file:${java.home}/lib/-" {
permission java.security.AllPermission;
};
// These permissions apply to all shared system extensions
grant codeBase "file:${java.home}/jre/lib/ext/-" {
permission java.security.AllPermission;
};
// These permissions apply to javac when ${java.home] points at $JAVA_HOME/jre
grant codeBase "file:${java.home}/../lib/-" {
permission java.security.AllPermission;
};
// These permissions apply to all shared system extensions when
// ${java.home} points at $JAVA_HOME/jre
grant codeBase "file:${java.home}/lib/ext/-" {
permission java.security.AllPermission;
};
// ========== CATALINA CODE PERMISSIONS =======================================
// These permissions apply to the daemon code
grant codeBase "file:${catalina.home}/bin/commons-daemon.jar" {
permission java.security.AllPermission;
};
// These permissions apply to the logging API
// Note: If tomcat-juli.jar is in ${catalina.base} and not in ${catalina.home},
// update this section accordingly.
// grant codeBase "file:${catalina.base}/bin/tomcat-juli.jar" {..}
grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
permission java.io.FilePermission
"${java.home}${file.separator}lib${file.separator}logging.properties", "read";
permission java.io.FilePermission
"${catalina.base}${file.separator}conf${file.separator}logging.properties", "read";
permission java.io.FilePermission
"${catalina.base}${file.separator}logs", "read, write";
permission java.io.FilePermission
"${catalina.base}${file.separator}logs${file.separator}*", "read, write, delete";
permission java.lang.RuntimePermission "shutdownHooks";
permission java.lang.RuntimePermission "getClassLoader";
permission java.lang.RuntimePermission "setContextClassLoader";
permission java.lang.management.ManagementPermission "monitor";
permission java.util.logging.LoggingPermission "control";
permission java.util.PropertyPermission "java.util.logging.config.class", "read";
permission java.util.PropertyPermission "java.util.logging.config.file", "read";
permission java.util.PropertyPermission "org.apache.juli.AsyncLoggerPollInterval", "read";
permission java.util.PropertyPermission "org.apache.juli.AsyncMaxRecordCount", "read";
permission java.util.PropertyPermission "org.apache.juli.AsyncOverflowDropType", "read";
permission java.util.PropertyPermission "org.apache.juli.ClassLoaderLogManager.debug", "read";
permission java.util.PropertyPermission "catalina.base", "read";
// Note: To enable per context logging configuration, permit read access to
// the appropriate file. Be sure that the logging configuration is
// secure before enabling such access.
// E.g. for the examples web application (uncomment and unwrap
// the following to be on a single line):
// permission java.io.FilePermission "${catalina.base}${file.separator}
// webapps${file.separator}examples${file.separator}WEB-INF
// ${file.separator}classes${file.separator}logging.properties", "read";
};
// These permissions apply to the server startup code
grant codeBase "file:${catalina.home}/bin/bootstrap.jar" {
permission java.security.AllPermission;
};
// These permissions apply to the servlet API classes
// and those that are shared across all class loaders
// located in the "lib" directory
grant codeBase "file:${catalina.home}/lib/-" {
permission java.security.AllPermission;
};
// If using a per instance lib directory, i.e. ${catalina.base}/lib,
// then the following permission will need to be uncommented
// grant codeBase "file:${catalina.base}/lib/-" {
// permission java.security.AllPermission;
// };
// ========== WEB APPLICATION PERMISSIONS =====================================
// These permissions are granted by default to all web applications
// In addition, a web application will be given a read FilePermission
// for all files and directories in its document root.
grant {
// Required for JNDI lookup of named JDBC DataSource's and
// javamail named MimePart DataSource used to send mail
permission java.util.PropertyPermission "java.home", "read";
permission java.util.PropertyPermission "java.naming.*", "read";
permission java.util.PropertyPermission "javax.sql.*", "read";
// OS Specific properties to allow read access
permission java.util.PropertyPermission "os.name", "read";
permission java.util.PropertyPermission "os.version", "read";
permission java.util.PropertyPermission "os.arch", "read";
permission java.util.PropertyPermission "file.separator", "read";
permission java.util.PropertyPermission "path.separator", "read";
permission java.util.PropertyPermission "line.separator", "read";
// JVM properties to allow read access
permission java.util.PropertyPermission "java.version", "read";
permission java.util.PropertyPermission "java.vendor", "read";
permission java.util.PropertyPermission "java.vendor.url", "read";
permission java.util.PropertyPermission "java.class.version", "read";
permission java.util.PropertyPermission "java.specification.version", "read";
permission java.util.PropertyPermission "java.specification.vendor", "read";
permission java.util.PropertyPermission "java.specification.name", "read";
permission java.util.PropertyPermission "java.vm.specification.version", "read";
permission java.util.PropertyPermission "java.vm.specification.vendor", "read";
permission java.util.PropertyPermission "java.vm.specification.name", "read";
permission java.util.PropertyPermission "java.vm.version", "read";
permission java.util.PropertyPermission "java.vm.vendor", "read";
permission java.util.PropertyPermission "java.vm.name", "read";
// Required for OpenJMX
permission java.lang.RuntimePermission "getAttribute";
// Allow read of JAXP compliant XML parser debug
permission java.util.PropertyPermission "jaxp.debug", "read";
// All JSPs need to be able to read this package
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat";
// Precompiled JSPs need access to these packages.
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.el";
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime";
permission java.lang.RuntimePermission
"accessClassInPackage.org.apache.jasper.runtime.*";
// The cookie code needs these.
permission java.util.PropertyPermission
"org.apache.catalina.STRICT_SERVLET_COMPLIANCE", "read";
permission java.util.PropertyPermission
"org.apache.tomcat.util.http.ServerCookie.STRICT_NAMING", "read";
permission java.util.PropertyPermission
"org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR", "read";
// Applications using WebSocket need to be able to access these packages
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat.websocket";
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat.websocket.server";
// Applications need to access these packages to use the Servlet 4.0 Preview
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.servlet4preview";
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.servlet4preview.http";
};
// The Manager application needs access to the following packages to support the
// session display functionality. It also requires the custom Tomcat
// DeployXmlPermission to enable the use of META-INF/context.xml
// These settings support the following configurations:
// - default CATALINA_HOME == CATALINA_BASE
// - CATALINA_HOME != CATALINA_BASE, per instance Manager in CATALINA_BASE
// - CATALINA_HOME != CATALINA_BASE, shared Manager in CATALINA_HOME
grant codeBase "file:${catalina.base}/webapps/manager/-" {
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina";
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.ha.session";
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager";
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager.util";
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.util";
permission org.apache.catalina.security.DeployXmlPermission "manager";
};
grant codeBase "file:${catalina.home}/webapps/manager/-" {
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina";
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.ha.session";
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager";
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager.util";
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.util";
permission org.apache.catalina.security.DeployXmlPermission "manager";
};
// The Host Manager application needs the custom Tomcat DeployXmlPermission to
// enable the use of META-INF/context.xml
// These settings support the following configurations:
// - default CATALINA_HOME == CATALINA_BASE
// - CATALINA_HOME != CATALINA_BASE, per instance Host Manager in CATALINA_BASE
// - CATALINA_HOME != CATALINA_BASE, shared Host Manager in CATALINA_HOME
grant codeBase "file:${catalina.base}/webapps/host-manager/-" {
permission org.apache.catalina.security.DeployXmlPermission "host-manager";
};
grant codeBase "file:${catalina.home}/webapps/host-manager/-" {
permission org.apache.catalina.security.DeployXmlPermission "host-manager";
};
// You can assign additional permissions to particular web applications by
// adding additional "grant" entries here, based on the code base for that
// application, /WEB-INF/classes/, or /WEB-INF/lib/ jar files.
//
// Different permissions can be granted to JSP pages, classes loaded from
// the /WEB-INF/classes/ directory, all jar files in the /WEB-INF/lib/
// directory, or even to individual jar files in the /WEB-INF/lib/ directory.
//
// For instance, assume that the standard "examples" application
// included a JDBC driver that needed to establish a network connection to the
// corresponding database and used the scrape taglib to get the weather from
// the NOAA web server. You might create a "grant" entries like this:
//
// The permissions granted to the context root directory apply to JSP pages.
// grant codeBase "file:${catalina.base}/webapps/examples/-" {
// permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect";
// permission java.net.SocketPermission "*.noaa.gov:80", "connect";
// };
//
// The permissions granted to the context WEB-INF/classes directory
// grant codeBase "file:${catalina.base}/webapps/examples/WEB-INF/classes/-" {
// };
//
// The permission granted to your JDBC driver
// grant codeBase "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/driver.jar!/-" {
// permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect";
// };
// The permission granted to the scrape taglib
// grant codeBase "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/scrape.jar!/-" {
// permission java.net.SocketPermission "*.noaa.gov:80", "connect";
// };
// To grant permissions for web applications using packed WAR files, use the
// Tomcat specific WAR url scheme.
//
// The permissions granted to the entire web application
// grant codeBase "war:file:${catalina.base}/webapps/examples.war*/-" {
// };
//
// The permissions granted to a specific JAR
// grant codeBase "war:file:${catalina.base}/webapps/examples.war*/WEB-INF/lib/foo.jar" {
// };

View File

@ -0,0 +1,563 @@
package com.zioinfo.esn.web.view.excel;
import java.lang.reflect.Type;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.DataFormat;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.PatternFormatting;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.util.CellRangeAddressList;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.zioinfo.esn.web.domain.ProcessResponse;
import com.zioinfo.esn.web.domain.enumerate.ExcelExtension;
import com.zioinfo.esn.web.domain.vo.BiztpVo;
import com.zioinfo.esn.web.domain.vo.StoreGroupVo;
import com.zioinfo.esn.web.domain.vo.StoreVo;
import com.zioinfo.esn.web.util.CommonUtil;
public class StoreListExcelView extends AbstractExcelViewAdapter {
protected enum MyStriped {WHITE, GREYED;}
protected enum MyScriped {BLACK, BLACK_BOLD, GREEN, DARK_RED, RED, NUMBER, NUMBER_BOLD, DATE;}
protected Map<String, String> activeDeviceTypeMap = new HashMap<String, String>();
protected final String MY_JAVA_DATE_FORMAT = "yy-MM-dd HH:mm:ss";
public StoreListExcelView(ExcelExtension excelExtension, Map<String, String> i18n) {
super(excelExtension, i18n);
activeDeviceTypeMap.put("primary", i18n.get("active.device.type.primary"));
activeDeviceTypeMap.put("secondary", i18n.get("backup"));
activeDeviceTypeMap.put("single", i18n.get("active.device.type.single"));
}
@Override
protected void buildExcelDocument(Map<String, Object> model,
Workbook workbook,
HttpServletRequest request,
HttpServletResponse response) throws Exception {
//set Filename
setAttachedFilename(request, response, new StringBuilder()
.append(i18n.get("store"))
.append(i18n.get("list"))
.append(".")
.append(super.excelExtension).toString());
//parse JSONs from model
Type classOfT = null;
classOfT = new TypeToken<ProcessResponse<List<StoreVo>>>(){}.getType();
ProcessResponse<List<StoreVo>> pr = new Gson().fromJson(model.get("storeList").toString(), classOfT);
List<StoreVo> storeList = (pr.getBody() == null ? new ArrayList<StoreVo>() : pr.getBody());
classOfT = new TypeToken<ProcessResponse<List<StoreGroupVo>>>(){}.getType();
ProcessResponse<List<StoreGroupVo>> pr2 = new Gson().fromJson(model.get("groupList").toString(), classOfT);
List<StoreGroupVo> storeGroupList = (pr2.getBody() == null ? new ArrayList<StoreGroupVo>() : pr2.getBody());
classOfT = new TypeToken<ProcessResponse<List<BiztpVo>>>(){}.getType();
ProcessResponse<List<BiztpVo>> pr3 = new Gson().fromJson(model.get("biztpList").toString(), classOfT);
List<BiztpVo> biztpList = (pr3.getBody() == null ? new ArrayList<BiztpVo>() : pr3.getBody());
Map<String, String> biztpMap = new HashMap<String, String>();
for (BiztpVo vo : biztpList) {
biztpMap.put(vo.getBiztp_code(), vo.getBiztp_name());
}
boolean[] groupYns = new boolean[] {false, false, false};
String[] groupNames = new String[] {new String(), new String(), new String()};
if(storeGroupList.size() == 3 && groupYns.length == 3 && groupNames.length == 3) {
for (int i = 0; i < storeGroupList.size(); i++) {
StoreGroupVo vo = storeGroupList.get(i);
groupNames[i] = vo.getGroup_name();
groupYns[i] = (!StringUtils.isBlank(vo.getUse_yn()) && !StringUtils.equalsIgnoreCase("Y", vo.getUse_yn()));
}
}
// create excel xls sheet
Sheet sheet = workbook.createSheet("매장");
try {
CellRangeAddressList addrList = new CellRangeAddressList();
addrList.addCellRangeAddress( CellRangeAddress.valueOf("A1:A2") ); //no
addrList.addCellRangeAddress( CellRangeAddress.valueOf("B1:B2") ); //group1
addrList.addCellRangeAddress( CellRangeAddress.valueOf("C1:C2") ); //group2
addrList.addCellRangeAddress( CellRangeAddress.valueOf("D1:D2") ); //group3
addrList.addCellRangeAddress( CellRangeAddress.valueOf("E1:G1") ); //매장
addrList.addCellRangeAddress( CellRangeAddress.valueOf("H1:H2") ); //Core 타입
addrList.addCellRangeAddress( CellRangeAddress.valueOf("I1:I2") ); //IP 주소
addrList.addCellRangeAddress( CellRangeAddress.valueOf("J1:J2") ); //상태
addrList.addCellRangeAddress( CellRangeAddress.valueOf("K1:K2") ); //G/W
addrList.addCellRangeAddress( CellRangeAddress.valueOf("L1:L2") ); //N/W
addrList.addCellRangeAddress( CellRangeAddress.valueOf("M1:M2") ); //Sync.
addrList.addCellRangeAddress( CellRangeAddress.valueOf("N1:P1") ); //G/W 현황
addrList.addCellRangeAddress( CellRangeAddress.valueOf("Q1:V1") ); //태그 현황
addrList.addCellRangeAddress( CellRangeAddress.valueOf("W1:W2") ); //ESL파일
addrList.addCellRangeAddress( CellRangeAddress.valueOf("X1:X2") ); //업데이트 일시
//Cell Merged Region
for (CellRangeAddress addr : addrList.getCellRangeAddresses()) {
sheet.addMergedRegion( addr );
}
//Column Hidden
int indexOfGroup1 = 1;
for (int i = 0; i < groupYns.length; i++) {
sheet.setColumnHidden(addrList.getCellRangeAddress(i + indexOfGroup1).getFirstColumn(), groupYns[i]);
}
//Auto Filter
int firstRow = addrList.getCellRangeAddress(0).getLastRow();
int lastRow = addrList.getCellRangeAddress(addrList.countRanges() - 1).getLastRow();
int firstCol = addrList.getCellRangeAddress(0).getFirstColumn();
int lastCol = addrList.getCellRangeAddress(addrList.countRanges() - 1).getLastColumn();
sheet.setAutoFilter( new CellRangeAddress(firstRow, lastRow, firstCol, lastCol) );
} catch (Exception e) {
e.printStackTrace();
}
try {
// create style for header cells
Font fontBlackBold = workbook.createFont();
fontBlackBold.setFontName(CommonUtil.isAvailableSystemFontname("맑은 고딕") ? "맑은 고딕" : "Arial");
//fontBlackBold.setBoldweight(Font.BOLDWEIGHT_BOLD);
fontBlackBold.setBold(true);
Font fontBlack = workbook.createFont();
fontBlack.setFontName(CommonUtil.isAvailableSystemFontname("맑은 고딕") ? "맑은 고딕" : "Arial");
Font fontGreen = workbook.createFont();
fontGreen.setFontName(CommonUtil.isAvailableSystemFontname("맑은 고딕") ? "맑은 고딕" : "Arial");
fontGreen.setColor(HSSFColor.HSSFColorPredefined.DARK_GREEN.getIndex());
//fontGreen.setColor(HSSFColor.GREEN.index);
Font fontDarkRed = workbook.createFont();
fontDarkRed.setFontName(CommonUtil.isAvailableSystemFontname("맑은 고딕") ? "맑은 고딕" : "Arial");
//fontDarkRed.setColor(HSSFColor.DARK_RED.index);
fontDarkRed.setColor(HSSFColor.HSSFColorPredefined.DARK_TEAL.getIndex());
Font fontRed = workbook.createFont();
fontRed.setFontName(CommonUtil.isAvailableSystemFontname("맑은 고딕") ? "맑은 고딕" : "Arial");
//fontRed.setColor(HSSFColor.RED.index);
fontRed.setColor(HSSFColor.HSSFColorPredefined.valueOf("RED").getIndex());
short borderThin = (short)BorderStyle.THIN.ordinal();
CellStyle styleBase = workbook.createCellStyle();
styleBase.setFillPattern(PatternFormatting.SOLID_FOREGROUND);
styleBase.setAlignment(CellStyle.ALIGN_CENTER);
styleBase.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
styleBase.setFont(fontBlack);
styleBase.setBorderTop(borderThin);
styleBase.setBorderLeft(borderThin);
styleBase.setBorderRight(borderThin);
styleBase.setBorderBottom(borderThin);
CellStyle styleHeader = workbook.createCellStyle();
styleHeader.cloneStyleFrom(styleBase);
styleHeader.setFillForegroundColor(HSSFColor.LIGHT_ORANGE.index);
styleHeader.setFont(fontBlackBold);
final CellStyle[][] BODY_STYLES = new CellStyle[MyStriped.values().length][MyScriped.values().length];
for (int i = 0; i < BODY_STYLES.length; i++) {
for (int j = 0; j < BODY_STYLES[i].length; j++) {
BODY_STYLES[i][j] = workbook.createCellStyle();
}
}
DataFormat dataFormat = workbook.getCreationHelper().createDataFormat();
CellStyle[] wh = BODY_STYLES[ MyStriped.WHITE.ordinal() ];
CellStyle[] gr = BODY_STYLES[ MyStriped.GREYED.ordinal()];
//WHITE
wh[ MyScriped.BLACK.ordinal() ].cloneStyleFrom( styleBase );
wh[ MyScriped.BLACK.ordinal() ].setFillForegroundColor(HSSFColor.WHITE.index);
wh[ MyScriped.BLACK.ordinal() ].setFont(fontBlack);
wh[ MyScriped.BLACK_BOLD.ordinal() ].cloneStyleFrom( styleBase );
wh[ MyScriped.BLACK_BOLD.ordinal() ].setFillForegroundColor(HSSFColor.WHITE.index);
wh[ MyScriped.BLACK_BOLD.ordinal() ].setFont(fontBlackBold);
wh[ MyScriped.GREEN.ordinal() ].cloneStyleFrom( BODY_STYLES[MyStriped.WHITE.ordinal()][MyScriped.BLACK.ordinal()] );
wh[ MyScriped.GREEN.ordinal() ].setFont(fontGreen);
wh[ MyScriped.DARK_RED.ordinal() ].cloneStyleFrom( BODY_STYLES[MyStriped.WHITE.ordinal()][MyScriped.BLACK.ordinal()] );
wh[ MyScriped.DARK_RED.ordinal() ].setFont(fontDarkRed);
wh[ MyScriped.RED.ordinal() ].cloneStyleFrom( BODY_STYLES[MyStriped.WHITE.ordinal()][MyScriped.BLACK.ordinal()] );
wh[ MyScriped.RED.ordinal() ].setFont(fontRed);
wh[ MyScriped.NUMBER.ordinal() ].cloneStyleFrom( BODY_STYLES[MyStriped.WHITE.ordinal()][MyScriped.BLACK.ordinal()] );
wh[ MyScriped.NUMBER.ordinal() ].setDataFormat(dataFormat.getFormat("#,##0"));
wh[ MyScriped.NUMBER_BOLD.ordinal() ].cloneStyleFrom( BODY_STYLES[MyStriped.WHITE.ordinal()][MyScriped.BLACK_BOLD.ordinal()] );
wh[ MyScriped.NUMBER_BOLD.ordinal() ].setDataFormat(dataFormat.getFormat("#,##0"));
wh[ MyScriped.DATE.ordinal() ].cloneStyleFrom( BODY_STYLES[MyStriped.WHITE.ordinal()][MyScriped.BLACK.ordinal()] );
wh[ MyScriped.DATE.ordinal() ].setDataFormat(dataFormat.getFormat(MY_JAVA_DATE_FORMAT));
//GREYED
for (MyScriped mcs : MyScriped.values()) { //Same Style.
gr[ mcs.ordinal() ].cloneStyleFrom( BODY_STYLES[MyStriped.WHITE.ordinal()][mcs.ordinal()] );
gr[ mcs.ordinal() ].setFillForegroundColor(HSSFColor.GREY_25_PERCENT.index);
}
// create header row
int rowCount = 0, colCount = 0;
short headerHeight = Short.valueOf("400");
colCount = 0;
Row headerRow1 = sheet.createRow(rowCount++);
headerRow1.setHeight(headerHeight);
//No.
headerRow1.createCell(colCount).setCellValue( i18n.get( "no" ) );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//group1
headerRow1.createCell(colCount).setCellValue( groupNames[0] );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//group2
headerRow1.createCell(colCount).setCellValue( groupNames[1] );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//group3
headerRow1.createCell(colCount).setCellValue( groupNames[2] );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//매장 #업태
headerRow1.createCell(colCount).setCellValue( i18n.get( "store" ) );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//매장 #코드
headerRow1.createCell(colCount);
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//매장 #매장명
headerRow1.createCell(colCount);
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//Core 타입
headerRow1.createCell(colCount).setCellValue( i18n.get( "core" ) + " " + i18n.get( "type" ) );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//IP 주소
headerRow1.createCell(colCount).setCellValue( i18n.get( "ip.address" ) );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//상태
headerRow1.createCell(colCount).setCellValue( i18n.get( "status" ) );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//G/W
headerRow1.createCell(colCount).setCellValue( i18n.get( "gateway" ) );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//N/W
headerRow1.createCell(colCount).setCellValue( i18n.get( "network" ) );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//Sync.
headerRow1.createCell(colCount).setCellValue( i18n.get( "sync" ) );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//G/W 현황 #전체
headerRow1.createCell(colCount).setCellValue( i18n.get( "gateway.present.condition" ) );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//G/W 현황 #접속
headerRow1.createCell(colCount);
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//G/W 현황 #미접속
headerRow1.createCell(colCount);
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//태그 현황 #전체
headerRow1.createCell(colCount).setCellValue( i18n.get( "tag.present.condition" ) );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//태그 현황 #사용중
headerRow1.createCell(colCount);
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//태그 현황 #미접속
headerRow1.createCell(colCount);
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//태그 현황 #미사용
headerRow1.createCell(colCount);
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//태그 현황 #보관박스
headerRow1.createCell(colCount);
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//태그 현황 #LowBattery
headerRow1.createCell(colCount);
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//ESL파일
headerRow1.createCell(colCount).setCellValue( i18n.get( "esl.file" ) );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//업데이트 일시
headerRow1.createCell(colCount).setCellValue( i18n.get( "update.date.time" ) );
headerRow1.getCell(colCount).setCellStyle(styleHeader);
colCount++;
colCount = 0;
Row headerRow2 = sheet.createRow(rowCount++);
headerRow2.setHeight(headerHeight);
//No.
headerRow2.createCell(colCount++).setCellStyle(styleHeader);
//group1
headerRow2.createCell(colCount++).setCellStyle(styleHeader);
//group2
headerRow2.createCell(colCount++).setCellStyle(styleHeader);
//group3
headerRow2.createCell(colCount++).setCellStyle(styleHeader);
//매장 #업태
headerRow2.createCell(colCount).setCellValue( i18n.get( "business.conditions" ) );
headerRow2.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//매장 #코드
headerRow2.createCell(colCount).setCellValue( i18n.get( "code" ) );
headerRow2.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//매장 #매장명
headerRow2.createCell(colCount).setCellValue( i18n.get( "store.name" ) );
headerRow2.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//Core 타입
headerRow2.createCell(colCount++).setCellStyle(styleHeader);
//IP 주소
headerRow2.createCell(colCount++).setCellStyle(styleHeader);
//상태
headerRow2.createCell(colCount++).setCellStyle(styleHeader);
//G/W
headerRow2.createCell(colCount++).setCellStyle(styleHeader);
//N/W
headerRow2.createCell(colCount++).setCellStyle(styleHeader);
//Sync.
headerRow2.createCell(colCount++).setCellStyle(styleHeader);
//G/W 현황 #전체
headerRow2.createCell(colCount).setCellValue( i18n.get( "total" ) );
headerRow2.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//G/W 현황 #접속
headerRow2.createCell(colCount).setCellValue( i18n.get( "connected" ) );
headerRow2.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//G/W 현황 #미접속
headerRow2.createCell(colCount).setCellValue( i18n.get( "disconnected" ) );
headerRow2.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//태그 현황 #전체
headerRow2.createCell(colCount).setCellValue( i18n.get( "total" ) );
headerRow2.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//태그 현황 #사용중
headerRow2.createCell(colCount).setCellValue( i18n.get( "in_use" ) );
headerRow2.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//태그 현황 #미접속
headerRow2.createCell(colCount).setCellValue( i18n.get( "disconnected" ) );
headerRow2.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//태그 현황 #미사용
headerRow2.createCell(colCount).setCellValue( i18n.get( "unused" ) );
headerRow2.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//태그 현황 #보관박스
headerRow2.createCell(colCount).setCellValue( i18n.get( "onstorage" ) );
headerRow2.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//태그 현황 #LowBattery
headerRow2.createCell(colCount).setCellValue( i18n.get( "low_battery" ) );
headerRow2.getCell(colCount).setCellStyle(styleHeader);
colCount++;
//ESL파일
headerRow2.createCell(colCount++).setCellStyle(styleHeader);
//업데이트 일시
headerRow2.createCell(colCount++).setCellStyle(styleHeader);
// create body row
final String BLANK = new String("-");
final Double ZERO = new Double(0);
for(StoreVo vo : storeList){
Row bodyRow = sheet.createRow(rowCount);
int striped = (rowCount%2 == 0 ? MyStriped.GREYED.ordinal() : MyStriped.WHITE.ordinal());
rowCount++;
colCount = 0;
//No.
bodyRow.createCell(colCount).setCellValue( bodyRow.createCell(colCount).getRowIndex() - 1 );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.BLACK.ordinal()] );
colCount++;
//group1
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getGroup1_name()) ? BLANK : vo.getGroup1_name() );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.BLACK.ordinal()] );
colCount++;
//group2
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getGroup2_name()) ? BLANK : vo.getGroup2_name() );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.BLACK.ordinal()] );
colCount++;
//group3
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getGroup3_name()) ? BLANK : vo.getGroup3_name() );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.BLACK.ordinal()] );
colCount++;
//매장 #업태
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getBiztp_code()) ? BLANK : biztpMap.get(vo.getBiztp_code()) );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.BLACK.ordinal()] );
colCount++;
//매장 #코드
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getStr_code()) ? BLANK : vo.getStr_code() );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.BLACK.ordinal()] );
colCount++;
//매장 #매장명
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getStr_name()) ? BLANK : vo.getStr_name() );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.BLACK.ordinal()] );
colCount++;
//Core 타입
String activeDeviceType = activeDeviceTypeMap.get( vo.getActive_device_type() );
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(activeDeviceType) ? BLANK : activeDeviceType );
bodyRow.getCell(colCount).setCellStyle( StringUtils.equalsIgnoreCase(vo.getActive_device_type(), "secondary") ? BODY_STYLES[striped][MyScriped.RED.ordinal()] : BODY_STYLES[striped][MyScriped.BLACK.ordinal()] );
colCount++;
//IP 주소
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getIp_addr()) ? BLANK : vo.getIp_addr() );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.BLACK.ordinal()] );
colCount++;
String[] status = new String[] {
(vo.getCore_status() == null ? BLANK : vo.getCore_status())
, (vo.getGateway_status() == null ? BLANK : vo.getGateway_status())
, (vo.getNetwork_status() == null ? BLANK : vo.getNetwork_status())
, (vo.getSync_status() == null ? BLANK : vo.getSync_status())
};
//상태
bodyRow.createCell(colCount).setCellValue( status[0] );
bodyRow.getCell(colCount).setCellStyle( status[0].length()==0
? BODY_STYLES[striped][MyScriped.BLACK.ordinal()]
: (StringUtils.equalsIgnoreCase("GOOD", status[0]) ? BODY_STYLES[striped][MyScriped.GREEN.ordinal()] : BODY_STYLES[striped][MyScriped.DARK_RED.ordinal()]) );
colCount++;
//G/W
bodyRow.createCell(colCount).setCellValue( status[1] );
bodyRow.getCell(colCount).setCellStyle( status[1].length()==0
? BODY_STYLES[striped][MyScriped.BLACK.ordinal()]
: (StringUtils.equalsIgnoreCase("GOOD", status[1]) ? BODY_STYLES[striped][MyScriped.GREEN.ordinal()] : BODY_STYLES[striped][MyScriped.DARK_RED.ordinal()]) );
colCount++;
//N/W
bodyRow.createCell(colCount).setCellValue( status[2] );
bodyRow.getCell(colCount).setCellStyle( status[2].length()==0
? BODY_STYLES[striped][MyScriped.BLACK.ordinal()]
: (StringUtils.equalsIgnoreCase("GOOD", status[2]) ? BODY_STYLES[striped][MyScriped.GREEN.ordinal()] : BODY_STYLES[striped][MyScriped.DARK_RED.ordinal()]) );
colCount++;
//Sync.
bodyRow.createCell(colCount).setCellValue( status[3] );
bodyRow.getCell(colCount).setCellStyle( status[3].length()==0
? BODY_STYLES[striped][MyScriped.BLACK.ordinal()]
: (StringUtils.equalsIgnoreCase("GOOD", status[3]) ? BODY_STYLES[striped][MyScriped.GREEN.ordinal()] : BODY_STYLES[striped][MyScriped.DARK_RED.ordinal()]) );
colCount++;
Double gw_tot_cnt = Double.valueOf(vo.getGw_tot_cnt()), gw_fail_cnt = Double.valueOf(vo.getGw_fail_cnt());
//G/W 현황 #전체
bodyRow.createCell(colCount).setCellValue( gw_tot_cnt);
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.NUMBER_BOLD.ordinal()] );
colCount++;
//G/W 현황 #접속
bodyRow.createCell(colCount).setCellType(Cell.CELL_TYPE_FORMULA);
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.NUMBER.ordinal()] );
String formula = new StringBuffer()
.append( (char)('A'-1+colCount) )
.append( rowCount )
.append( '-' )
.append( (char)('A'-1+colCount+2) )
.append( rowCount )
.toString(); //N3-P3, N4-P4....
logger.debug("formula : " + formula);
bodyRow.getCell(colCount).setCellFormula( formula );
bodyRow.getCell(colCount).setCellValue( gw_tot_cnt - gw_fail_cnt );
colCount++;
//G/W 현황 #미접속
bodyRow.createCell(colCount).setCellValue( gw_fail_cnt );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.NUMBER.ordinal()] );
colCount++;
//태그 현황 #전체
bodyRow.createCell(colCount).setCellValue( Double.valueOf(vo.getTotal()) );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.NUMBER_BOLD.ordinal()] );
colCount++;
//태그 현황 #사용중
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getConnected()) ? ZERO : Double.valueOf(vo.getConnected()) );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.NUMBER.ordinal()] );
colCount++;
//태그 현황 #미접속
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getDisconnected()) ? ZERO : Double.valueOf(vo.getDisconnected()) );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.NUMBER.ordinal()] );
colCount++;
//태그 현황 #미사용
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getRemoved()) ? ZERO : Double.valueOf(vo.getRemoved()) );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.NUMBER.ordinal()] );
colCount++;
//태그 현황 #보관박스
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getStorage()) ? ZERO : Double.valueOf(vo.getStorage()) );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.NUMBER.ordinal()] );
colCount++;
//태그 현황 #LowBattery
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getLow_battery()) ? ZERO : Double.valueOf(vo.getLow_battery()) );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.NUMBER.ordinal()] );
colCount++;
//ESL파일
bodyRow.createCell(colCount).setCellValue( StringUtils.isBlank(vo.getG4_file_name()) ? BLANK : vo.getG4_file_name() );
bodyRow.getCell(colCount).setCellStyle( BODY_STYLES[striped][MyScriped.BLACK.ordinal()] );
colCount++;
//업데이트 일시
Cell cellUpdateTime = bodyRow.createCell(colCount);
try {
cellUpdateTime.setCellValue( new SimpleDateFormat(MY_JAVA_DATE_FORMAT).parse(vo.getUpdate_time()) );
cellUpdateTime.setCellStyle( BODY_STYLES[striped][MyScriped.DATE.ordinal()] );
} catch(NullPointerException|ParseException e) {
cellUpdateTime.setCellValue( BLANK );
cellUpdateTime.setCellStyle( BODY_STYLES[striped][MyScriped.BLACK.ordinal()] );
} finally {
colCount++;
}
} //end of loop
//Widths
final Double[] WIDTHS = new Double[] {
1.5D //No.
, 5.0D //Group 1
, 5.0D //Group 2
, 5.0D //Group 3
, 5.0D //매장 #업태
, 2.0D //매장 #코드
, 6.0D //매장 #매장명
, 3.0D //Core 타입
, 4.0D //IP 주소
, 2.0D //상태
, 2.0D //G/W
, 2.0D //N/W
, 2.0D //Sync.
, 3.0D //G/W 현황 #전체
, 3.0D //G/W 현황 #접속
, 3.0D //G/W 현황 #미접속
, 3.0D //태그 현황 #전체
, 3.0D //태그 현황 #사용중
, 3.0D //태그 현황 #미접속
, 3.0D //태그 현황 #미사용
, 3.0D //태그 현황 #보관박스
, 3.0D //태그 현황 #Low Battery
, 8.0D //ESL파일
, 4.5D //업데이트 일시
};
sheet.setDefaultColumnWidth(10);
for (int columnIndex = 0; columnIndex < WIDTHS.length; columnIndex++) {
sheet.setColumnWidth(columnIndex, Double.valueOf( WIDTHS[columnIndex] * 1000D ).intValue());
} //end of loop
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@ -0,0 +1,21 @@
[{
"str_code": "1117",
"str_name": "왕십리점",
"esn_url": "http://10.253.32.230:8081"
},
{
"str_code": "1036",
"str_name": "만촌점",
"esn_url": "http://192.168.0.118:8081"
},
{
"str_code": "1234",
"str_name": "서귀포점",
"esn_url": "http://192.168.0.18:8081"
},
{
"str_code": "1035",
"str_name": "동인천점",
"esn_url": "http://192.168.0.18:8081"
}
]

View File

@ -0,0 +1,243 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sample</groupId>
<artifactId>mybatis</artifactId>
<name>Spring_EX_01</name>
<packaging>war</packaging>
<version>1.0.0-BUILD-SNAPSHOT</version>
<properties>
<java-version>1.8</java-version>
<org.springframework-version>4.3.3.RELEASE</org.springframework-version>
<org.aspectj-version>1.6.10</org.aspectj-version>
<org.slf4j-version>1.6.6</org.slf4j-version>
</properties>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
<scope>runtime</scope>
</dependency>
<!-- @Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- MySQL -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.5</version>
</dependency>
<!-- MyBatis 3.4.1 -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.1</version>
</dependency>
<!-- MyBatis-Spring -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.0</version>
</dependency>
<!-- Spring-jdbc -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Spring-test -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-test -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Mybatis log -->
<!-- https://mvnrepository.com/artifact/org.bgee.log4jdbc-log4j2/log4jdbc-log4j2-jdbc4.1 -->
<dependency>
<groupId>org.bgee.log4jdbc-log4j2</groupId>
<artifactId>log4jdbc-log4j2-jdbc4</artifactId>
<version>1.16</version>
</dependency>
<!-- mariaDB -->
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.0.1</version>
</dependency>
<!-- PostgreSQL -->
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.5</version>
</dependency>
<!-- Oracle 11 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>11.2.0.3.0</version>
</dependency>
<!-- Oracle 12 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>12.1.0.2</version>
</dependency>
-->
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>org.test.int1.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,375 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sample</groupId>
<artifactId>mybatis</artifactId>
<name>Spring_EX_01</name>
<packaging>war</packaging>
<version>1.0.0-BUILD-SNAPSHOT</version>
<properties>
<java-version>1.8</java-version>
<org.springframework-version>4.3.3.RELEASE</org.springframework-version>
<org.aspectj-version>1.6.10</org.aspectj-version>
<org.slf4j-version>1.6.6</org.slf4j-version>
</properties>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-tomcat -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<version>2.3.0.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.3.0.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-autoconfigure -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.lingala.zip4j/zip4j -->
<dependency>
<groupId>net.lingala.zip4j</groupId>
<artifactId>zip4j</artifactId>
<version>1.3.2</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
<scope>runtime</scope>
</dependency>
<!-- @Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- MySQL -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.5</version>
</dependency>
<!-- MyBatis 3.4.1 -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.1</version>
</dependency>
<!-- MyBatis-Spring -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.0</version>
</dependency>
<!-- Spring-jdbc -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Spring-test -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-test -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Mybatis log -->
<!-- https://mvnrepository.com/artifact/org.bgee.log4jdbc-log4j2/log4jdbc-log4j2-jdbc4.1 -->
<dependency>
<groupId>org.bgee.log4jdbc-log4j2</groupId>
<artifactId>log4jdbc-log4j2-jdbc4</artifactId>
<version>1.16</version>
</dependency>
<!-- mariaDB -->
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.0.1</version>
</dependency>
<!-- PostgreSQL -->
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.5</version>
</dependency>
<!-- MSSQL -->
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.0.0.jre8</version>
</dependency>
<!-- Oracle 11 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>11.2.0.3.0</version>
</dependency>
-->
<!-- Oracle 12 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>12.1.0.2</version>
</dependency>
-->
<!-- 엑셀 제어(xls) maven setting -->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<!--
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<!-- 엑셀 제어(xlsx) maven setting-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<!--
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-core -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.3.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-web -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>5.3.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.13.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>org.test.int1.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,12 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8

View File

@ -0,0 +1,11 @@
[{
"str_code": "8808983710440",
"str_name": "강화지점",
"esn_url": "http://220.87.30.52:8081"
},
{
"str_code": "1036",
"str_name": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
"esn_url": "http://192.168.0.118:8081"
}
]

View File

@ -0,0 +1,434 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sample</groupId>
<artifactId>mybatis</artifactId>
<name>Spring_EX_01</name>
<packaging>war</packaging>
<version>1.0.0-BUILD-SNAPSHOT</version>
<properties>
<java-version>1.8</java-version>
<org.springframework-version>4.3.3.RELEASE</org.springframework-version>
<org.aspectj-version>1.6.10</org.aspectj-version>
<org.slf4j-version>1.6.6</org.slf4j-version>
</properties>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-tomcat -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<version>2.3.0.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.3.0.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-autoconfigure -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.9</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.thymeleaf.extras/thymeleaf-extras-springsecurity4 -->
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity4</artifactId>
<version>3.0.2.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180813</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-codec.wso2/commons-codec -->
<!--
<dependency>
<groupId>commons-codec.wso2</groupId>
<artifactId>commons-codec</artifactId>
<version>1.4.0.wso2v1</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/net.lingala.zip4j/zip4j -->
<dependency>
<groupId>net.lingala.zip4j</groupId>
<artifactId>zip4j</artifactId>
<version>1.3.2</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
<scope>runtime</scope>
</dependency>
<!-- @Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- MySQL -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.5</version>
</dependency>
<!-- MyBatis 3.4.1 -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.1</version>
</dependency>
<!-- MyBatis-Spring -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.0</version>
</dependency>
<!-- Spring-jdbc -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Spring-test -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-test -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Mybatis log -->
<!-- https://mvnrepository.com/artifact/org.bgee.log4jdbc-log4j2/log4jdbc-log4j2-jdbc4.1 -->
<dependency>
<groupId>org.bgee.log4jdbc-log4j2</groupId>
<artifactId>log4jdbc-log4j2-jdbc4</artifactId>
<version>1.16</version>
</dependency>
<!-- mariaDB -->
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.0.1</version>
</dependency>
<!-- PostgreSQL -->
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.5</version>
</dependency>
<!-- MSSQL -->
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.0.0.jre8</version>
</dependency>
<!-- Oracle 11 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>11.2.0.3.0</version>
</dependency>
-->
<!-- Oracle 12 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>12.1.0.2</version>
</dependency>
-->
<!-- 엑셀 제어(xls) maven setting -->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<!--
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<!-- 엑셀 제어(xlsx) maven setting-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<!--
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-core -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.3.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-web -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>5.3.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.13.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-tomcat -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<version>2.3.0.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jasypt/jasypt -->
<dependency>
<groupId>org.jasypt</groupId>
<artifactId>jasypt</artifactId>
<version>1.9.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-config -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>5.3.2.RELEASE</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>org.test.int1.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,41 @@
package com.zioinfo.esn.web.config;
import org.apache.catalina.connector.Connector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.embedded.tomcat.TomcatConnectorCustomizer;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextClosedEvent;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
public class GracefulShutdown implements TomcatConnectorCustomizer, ApplicationListener<ContextClosedEvent> {
private static final Logger logger = LoggerFactory.getLogger(GracefulShutdown.class);
private volatile Connector connector;
@Override
public void customize(Connector connector) {
this.connector = connector;
}
@Override
public void onApplicationEvent(ContextClosedEvent event) {
this.connector.pause();
Executor executor = this.connector.getProtocolHandler().getExecutor();
if (executor instanceof ThreadPoolExecutor) {
try {
ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) executor;
threadPoolExecutor.shutdown();
if (!threadPoolExecutor.awaitTermination(30, TimeUnit.SECONDS)) {
logger.warn("Tomcat thread pool did not shut down gracefully within "
+ "30 seconds. Proceeding with forceful shutdown");
}
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
}
}
}
}

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--><!-- The contents of this file will be loaded for each web application --><Context>
<!-- Default set of monitored resources. If one of these changes, the -->
<!-- web application will be reloaded. -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
-->
</Context>

View File

@ -0,0 +1,283 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sample</groupId>
<artifactId>mybatis</artifactId>
<name>Spring_EX_01</name>
<packaging>war</packaging>
<version>1.0.0-BUILD-SNAPSHOT</version>
<properties>
<java-version>1.8</java-version>
<org.springframework-version>4.3.3.RELEASE</org.springframework-version>
<org.aspectj-version>1.6.10</org.aspectj-version>
<org.slf4j-version>1.6.6</org.slf4j-version>
</properties>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
<scope>runtime</scope>
</dependency>
<!-- @Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- MySQL -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.5</version>
</dependency>
<!-- MyBatis 3.4.1 -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.1</version>
</dependency>
<!-- MyBatis-Spring -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.0</version>
</dependency>
<!-- Spring-jdbc -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Spring-test -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-test -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Mybatis log -->
<!-- https://mvnrepository.com/artifact/org.bgee.log4jdbc-log4j2/log4jdbc-log4j2-jdbc4.1 -->
<dependency>
<groupId>org.bgee.log4jdbc-log4j2</groupId>
<artifactId>log4jdbc-log4j2-jdbc4</artifactId>
<version>1.16</version>
</dependency>
<!-- mariaDB -->
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.0.1</version>
</dependency>
<!-- PostgreSQL -->
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.5</version>
</dependency>
<!-- MSSQL -->
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.0.0.jre8</version>
</dependency>
<!-- Oracle 11 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>11.2.0.3.0</version>
</dependency>
-->
<!-- Oracle 12 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>12.1.0.2</version>
</dependency>
-->
<!-- 엑셀 제어(xls) maven setting -->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>
<!-- 엑셀 제어(xlsx) maven setting-->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.9</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>org.test.int1.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,427 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sample</groupId>
<artifactId>mybatis</artifactId>
<name>Spring_EX_01</name>
<packaging>war</packaging>
<version>1.0.0-BUILD-SNAPSHOT</version>
<properties>
<java-version>1.8</java-version>
<org.springframework-version>4.3.3.RELEASE</org.springframework-version>
<org.aspectj-version>1.6.10</org.aspectj-version>
<org.slf4j-version>1.6.6</org.slf4j-version>
</properties>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-tomcat -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<version>2.3.0.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.3.0.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-autoconfigure -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.9</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.thymeleaf.extras/thymeleaf-extras-springsecurity4 -->
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity4</artifactId>
<version>3.0.2.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180813</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-codec.wso2/commons-codec -->
<!--
<dependency>
<groupId>commons-codec.wso2</groupId>
<artifactId>commons-codec</artifactId>
<version>1.4.0.wso2v1</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/net.lingala.zip4j/zip4j -->
<dependency>
<groupId>net.lingala.zip4j</groupId>
<artifactId>zip4j</artifactId>
<version>1.3.2</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
<scope>runtime</scope>
</dependency>
<!-- @Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- MySQL -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.5</version>
</dependency>
<!-- MyBatis 3.4.1 -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.1</version>
</dependency>
<!-- MyBatis-Spring -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.0</version>
</dependency>
<!-- Spring-jdbc -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Spring-test -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-test -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Mybatis log -->
<!-- https://mvnrepository.com/artifact/org.bgee.log4jdbc-log4j2/log4jdbc-log4j2-jdbc4.1 -->
<dependency>
<groupId>org.bgee.log4jdbc-log4j2</groupId>
<artifactId>log4jdbc-log4j2-jdbc4</artifactId>
<version>1.16</version>
</dependency>
<!-- mariaDB -->
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.0.1</version>
</dependency>
<!-- PostgreSQL -->
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.5</version>
</dependency>
<!-- MSSQL -->
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.0.0.jre8</version>
</dependency>
<!-- Oracle 11 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>11.2.0.3.0</version>
</dependency>
-->
<!-- Oracle 12 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>12.1.0.2</version>
</dependency>
-->
<!-- 엑셀 제어(xls) maven setting -->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<!--
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<!-- 엑셀 제어(xlsx) maven setting-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<!--
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-core -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.3.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-web -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>5.3.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.13.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-tomcat -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<version>2.3.0.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jasypt/jasypt -->
<dependency>
<groupId>org.jasypt</groupId>
<artifactId>jasypt</artifactId>
<version>1.9.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>org.test.int1.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,334 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sample</groupId>
<artifactId>mybatis</artifactId>
<name>Spring_EX_01</name>
<packaging>war</packaging>
<version>1.0.0-BUILD-SNAPSHOT</version>
<properties>
<java-version>1.8</java-version>
<org.springframework-version>4.3.3.RELEASE</org.springframework-version>
<org.aspectj-version>1.6.10</org.aspectj-version>
<org.slf4j-version>1.6.6</org.slf4j-version>
</properties>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-autoconfigure -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
<scope>runtime</scope>
</dependency>
<!-- @Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- MySQL -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.5</version>
</dependency>
<!-- MyBatis 3.4.1 -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.1</version>
</dependency>
<!-- MyBatis-Spring -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.0</version>
</dependency>
<!-- Spring-jdbc -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Spring-test -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-test -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Mybatis log -->
<!-- https://mvnrepository.com/artifact/org.bgee.log4jdbc-log4j2/log4jdbc-log4j2-jdbc4.1 -->
<dependency>
<groupId>org.bgee.log4jdbc-log4j2</groupId>
<artifactId>log4jdbc-log4j2-jdbc4</artifactId>
<version>1.16</version>
</dependency>
<!-- mariaDB -->
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.0.1</version>
</dependency>
<!-- PostgreSQL -->
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.5</version>
</dependency>
<!-- MSSQL -->
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.0.0.jre8</version>
</dependency>
<!-- Oracle 11 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>11.2.0.3.0</version>
</dependency>
-->
<!-- Oracle 12 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>12.1.0.2</version>
</dependency>
-->
<!-- 엑셀 제어(xls) maven setting -->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<!--
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<!-- 엑셀 제어(xlsx) maven setting-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<!--
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-core -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.3.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-web -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>5.3.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.13.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>org.test.int1.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,354 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sample</groupId>
<artifactId>mybatis</artifactId>
<name>Spring_EX_01</name>
<packaging>war</packaging>
<version>1.0.0-BUILD-SNAPSHOT</version>
<properties>
<java-version>1.8</java-version>
<org.springframework-version>4.3.3.RELEASE</org.springframework-version>
<org.aspectj-version>1.6.10</org.aspectj-version>
<org.slf4j-version>1.6.6</org.slf4j-version>
</properties>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-tomcat -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<version>2.3.0.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-autoconfigure -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.0</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
<scope>runtime</scope>
</dependency>
<!-- @Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- MySQL -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.5</version>
</dependency>
<!-- MyBatis 3.4.1 -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.1</version>
</dependency>
<!-- MyBatis-Spring -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.0</version>
</dependency>
<!-- Spring-jdbc -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Spring-test -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-test -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Mybatis log -->
<!-- https://mvnrepository.com/artifact/org.bgee.log4jdbc-log4j2/log4jdbc-log4j2-jdbc4.1 -->
<dependency>
<groupId>org.bgee.log4jdbc-log4j2</groupId>
<artifactId>log4jdbc-log4j2-jdbc4</artifactId>
<version>1.16</version>
</dependency>
<!-- mariaDB -->
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.0.1</version>
</dependency>
<!-- PostgreSQL -->
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.5</version>
</dependency>
<!-- MSSQL -->
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.0.0.jre8</version>
</dependency>
<!-- Oracle 11 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>11.2.0.3.0</version>
</dependency>
-->
<!-- Oracle 12 -->
<!-- https://mvnrepository.com/artifact/oracle/oracle-jdbc -->
<!--
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>12.1.0.2</version>
</dependency>
-->
<!-- 엑셀 제어(xls) maven setting -->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<!--
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<!-- 엑셀 제어(xlsx) maven setting-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<!--
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-core -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.3.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-web -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>5.3.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.13.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>org.test.int1.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,92 @@
buildscript {
ext {
springBootVersion = '1.5.12.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse-wtp'
apply plugin: 'org.springframework.boot'
jar {
manifest {
attributes 'Title':'ESN_DAEMON','Version':1.0,'Main-Class':'com.northbr.esn.daemon.EsnDaemonApplication'
}
baseName 'ESN'
dependsOn configurations.runtime
from {
configurations.compile.collect {it.isDirectory()? it: zipTree(it)}
}
exclude 'META-INF/*.RSA','META-INF/*.SF','META-INF/*.DSA'
}
group = 'com.northbr.esn.daemon'
sourceCompatibility = 1.8
repositories {
mavenCentral()
maven { url "https://code.lds.org/nexus/content/groups/main-repo"}
}
configurations {
providedRuntime
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.2')
compile('org.springframework.boot:spring-boot-starter-security')
runtime('org.springframework.boot:spring-boot-devtools')
compile group: 'org.codehaus.janino', name: 'janino', version: '3.0.6'
compileOnly('org.projectlombok:lombok')
compile('com.oracle:ojdbc6:11.2.0.3')
compile group: 'commons-io', name: 'commons-io', version: '2.6'
compile group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1'
// compile files('libs/tibero6-jdbc-14.jar')
compile fileTree(dir: 'libs', include: ['*.jar'])
// compile 'org.postgresql:postgresql:42.2.2'
compile 'com.github.ulisesbocchio:jasypt-spring-boot-starter:1.17'
compile 'org.springframework.session:spring-session-core:2.0.2.RELEASE'
compile('org.springframework.session:spring-session')
compile group: 'org.springframework.data', name: 'spring-data-redis', version: '2.0.6.RELEASE'
compile 'io.jsonwebtoken:jjwt:0.7.0'
// https://mvnrepository.com/artifact/org.springframework.mobile/spring-mobile-device
compile group: 'org.springframework.mobile', name: 'spring-mobile-device', version: '1.1.5.RELEASE'
// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.1'
// https://mvnrepository.com/artifact/commons-codec/commons-codec
compile group: 'commons-codec', name: 'commons-codec', version: '1.11'
// https://mvnrepository.com/artifact/net.lingala.zip4j/zip4j
compile group: 'net.lingala.zip4j', name: 'zip4j', version: '1.3.2'
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
// https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.2'
// https://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore
compile group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.4.4'
// https://mvnrepository.com/artifact/com.google.code.gson/gson
compile group: 'com.google.code.gson', name: 'gson', version: '2.7'
// compile 'org.apache.httpcomponents:httpclient:4.5.6'
// compile group: 'net.shibboleth.utilities', name: 'trustany-ssl', version: '1.0.0'
// compile 'io.springfox:springfox-swagger2:2.6.1'
// compile 'io.springfox:springfox-swagger-ui:2.6.1'
providedRuntime('org.springframework.boot:spring-boot-starter-tomcat')
//testCompile('org.springframework.boot:spring-boot-starter-test')
//testCompile('org.springframework.security:spring-security-test')
}

Some files were not shown because too many files have changed in this diff Show More