refactor: 어플리케이션 업무코드(DAP) 전면 전환에 따른 패키지 및 모듈명 대규모 리팩토링

This commit is contained in:
jade
2026-07-16 16:18:04 +09:00
parent 6159b0856a
commit a82bc1a196
285 changed files with 782 additions and 782 deletions

View File

@@ -0,0 +1,18 @@
FROM eclipse-temurin:21-jdk-alpine AS builder
WORKDIR /app
COPY gradlew .
COPY gradle gradle
COPY build.gradle settings.gradle ./
COPY dap-common dap-common
COPY dap-tool-core dap-tool-core
COPY dap-tool-payment dap-tool-payment
RUN chmod +x gradlew
RUN ./gradlew :dap-tool-payment:build -x test
FROM eclipse-temurin:21-jre-alpine
WORKDIR /app
RUN apk add --no-cache tzdata
ENV TZ=Asia/Seoul
COPY --from=builder /app/dap-tool-payment/build/libs/*-SNAPSHOT.jar app.jar
EXPOSE 8085
ENTRYPOINT ["java", "-jar", "app.jar"]

View File

@@ -0,0 +1,10 @@
plugins {
id 'org.springframework.boot'
}
dependencies {
implementation project(':dap-tool-core')
}
dependencies {
compileOnly 'org.projectlombok:lombok:1.18.32'
annotationProcessor 'org.projectlombok:lombok:1.18.32'
}

View File

@@ -0,0 +1,26 @@
package io.shinhanlife.dap.biz.mcp.tool.dto;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
/**
* @package io.shinhanlife.dap.biz.mcp.tool.dto
* @className PaymentApprovalReq
* @description AX HUB 시스템 처리 클래스
* @author 김형식
* @create 2026.09.01
* <pre>
* ---------- 개정이력 ----------
* 수정일 수정자 수정내용
* ---------- -------- ---------------------------
* 2026.09.01 김형식 최초생성
*
* </pre>
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class PaymentApprovalReq {
private String accountNumber;
private long amount;
private String paymentMethod;
}

View File

@@ -0,0 +1,27 @@
package io.shinhanlife.dap.biz.mcp.tool.dto;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
/**
* @package io.shinhanlife.dap.biz.mcp.tool.dto
* @className PaymentApprovalRes
* @description AX HUB 시스템 처리 클래스
* @author 김형식
* @create 2026.09.01
* <pre>
* ---------- 개정이력 ----------
* 수정일 수정자 수정내용
* ---------- -------- ---------------------------
* 2026.09.01 김형식 최초생성
*
* </pre>
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class PaymentApprovalRes {
private String status;
private String message;
private String transactionId;
private long approvedAmount;
}

View File

@@ -0,0 +1,15 @@
package io.shinhanlife.dap.biz.mcp.tool.payment;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.cache.annotation.EnableCaching;
@SpringBootApplication(scanBasePackages = {"io.shinhanlife.dap.biz.mcp.tool", "io.shinhanlife.dap.biz.mcp.adapter", "io.shinhanlife.dap.common.mcp", "io.shinhanlife.dap.common.config"})
@ConfigurationPropertiesScan(basePackages = {"io.shinhanlife.dap.biz.mcp.tool", "io.shinhanlife.dap.biz.mcp.adapter", "io.shinhanlife.dap.common.mcp", "io.shinhanlife.dap.common.config"})
@EnableCaching
public class PaymentToolApplication {
public static void main(String[] args) {
SpringApplication.run(PaymentToolApplication.class, args);
}
}

View File

@@ -0,0 +1,54 @@
package io.shinhanlife.dap.biz.mcp.tool.service;
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpFunction;
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpTool;
import io.shinhanlife.dap.biz.mcp.tool.dto.PaymentApprovalReq;
import io.shinhanlife.dap.biz.mcp.tool.dto.PaymentApprovalRes;
import org.springframework.stereotype.Service;
import lombok.extern.slf4j.Slf4j;
import java.util.Map;
import java.util.UUID;
/**
* @package io.shinhanlife.dap.biz.mcp.tool.service
* @className PaymentApprovalService
* @description AX HUB 시스템 처리 클래스
* @author 김형식
* @create 2026.09.01
* <pre>
* ---------- 개정이력 ----------
* 수정일 수정자 수정내용
* ---------- -------- ---------------------------
* 2026.09.01 김형식 최초생성
*
* </pre>
*/
@Slf4j
@Service
@McpTool(
routingType = "MCI",
categoryKey = "payment"
)
public class PaymentApprovalService extends AbstractMcpToolService {
@McpFunction(displayName = "paymentapproval 툴", name = "paymentapproval",
description = "결제 승인 처리",
prompt = "결제 승인 처리 해줘.",
mappingId = "PAY_001"
)
public Object execute(PaymentApprovalReq req) {
log.info("[Payment] 결제 승인 요청 수신. 계좌: {}, 금액: {}", req.getAccountNumber(), req.getAmount());
// 레거시 연동
Map<String, Object> result = executeLegacy("MCI", "PAY_001", req);
// 가짜 데이터 응답 매핑 (AI 에이전트가 그럴듯하게 보여주기 위함)
if ("SUCCESS".equals(result.get("status"))) {
result.put("transactionId", "TX_" + UUID.randomUUID().toString().substring(0, 8).toUpperCase());
result.put("approvedAmount", req.getAmount());
result.put("message", "결제가 성공적으로 승인되었습니다.");
}
return result;
}
}

View File

@@ -0,0 +1,21 @@
# Render 클라우드 환경 전용 설정
server.port=${PORT:8085}
axhub.gateway.url=https://dap-gateway.onrender.com
axhub.tool.url=https://dap-tool-payment.onrender.com
# EIMS 동적 라우팅 접속 정보 (Mock)
eims.http.url=http://localhost:${server.port}/api/gateway
eims.tcp.host=127.0.0.1
eims.tcp.port=8090
eims.tcp.timeout=5000
eims.jsp.form.url=http://localhost:${server.port}/mock/jsp-form
eims.jsp.json.url=http://localhost:${server.port}/mock/jsp-json
eims.mci.url=http://localhost:${server.port}/api/mock/esb/api
eims.mcistring.url=http://localhost:${server.port}/api/mock/esb/string
# --- 신한라이프 EAI/MCI 연계 IP 정보 (개발 환경) ---
shinhan.integration.envrTypeCd=D
shinhan.integration.eai.url=http://10.176.32.181
shinhan.integration.internalMci.url=http://10.176.32.173
shinhan.integration.bancaMci.url=http://10.176.32.117
shinhan.integration.externalMci.url=http://10.176.32.176

View File

@@ -0,0 +1,26 @@
# Local 환경 전용 설정 (H2 메모리 DB 등)
spring.datasource.url=jdbc:p6spy:h2:mem:testdb;DB_CLOSE_DELAY=-1;
spring.datasource.driverClassName=com.p6spy.engine.spy.P6SpyDriver
spring.datasource.username=sa
spring.datasource.password=password
spring.h2.console.enabled=true
# EIMS 동적 라우팅 접속 정보
eims.http.url=http://localhost:${server.port}/api/gateway
eims.tcp.host=127.0.0.1
eims.tcp.port=8090
eims.tcp.timeout=5000
eims.jsp.form.url=http://localhost:${server.port}/mock/jsp-form
eims.jsp.json.url=http://localhost:${server.port}/mock/jsp-json
eims.mci.url=http://localhost:${server.port}/api/mock/esb/api
eims.mcistring.url=http://localhost:${server.port}/api/mock/esb/string
# Gateway/Tool URLs
axhub.gateway.url=http://localhost:8081
axhub.tool.url=http://localhost:${server.port}
# Disable Kafka
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration
# Suppress Kafka Connection Logs
logging.level.org.apache.kafka=ERROR

View File

@@ -0,0 +1,12 @@
spring:
application:
name: axhub-tool-payment
config:
import: "classpath:config/application-glow-local.yml"
server:
port: 8085
axhub:
tool:
url: "http://tool-payment:8085"

View File

@@ -0,0 +1,7 @@
spring.profiles.active=local
# Auto Prefix Namespace
mcp.namespace=payment
# API 보안 키 설정
mcp.security.tenant-domains.TESTER-DEV=ALL

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- 1. 로그 패턴 설정 (MDC traceId 포함) -->
<property name="LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId}] %-5level %logger{36} - %msg%n" />
<!-- 2. 콘솔(Console) 출력 설정 (로컬 개발용) -->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
<!-- 3. 파일(File) 출력 설정 (서버 운영용) -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>logs/axhub-tool-payment.log</file> <!-- 현재 로그가 쌓이는 파일 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 매일 자정에 날짜를 붙여서 지난 로그를 분리 저장 -->
<fileNamePattern>logs/axhub-tool-payment-%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 최대 30일치 로그만 보관하고 오래된 것은 자동 삭제 -->
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
<!-- 4. 기본 로깅 레벨 설정 -->
<root level="INFO">
<appender-ref ref="CONSOLE" />
<appender-ref ref="FILE" />
</root>
<!-- 5. 우리 프로젝트 패키지는 디버그 레벨까지 상세히 보기 -->
<logger name="io.shinhanlife" level="DEBUG" />
</configuration>