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

18
dap-tool-sms/Dockerfile Normal file
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-sms dap-tool-sms
RUN chmod +x gradlew
RUN ./gradlew :dap-tool-sms: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-sms/build/libs/*-SNAPSHOT.jar app.jar
EXPOSE 8082
ENTRYPOINT ["java", "-jar", "app.jar"]

12
dap-tool-sms/build.gradle Normal file
View File

@@ -0,0 +1,12 @@
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,39 @@
package io.shinhanlife.dap.biz.mcp.tool.dto;
import lombok.Builder;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import io.shinhanlife.dap.biz.mcp.tool.annotation.McpParameter;
import lombok.Getter;
import lombok.Setter;
/**
* @package io.shinhanlife.dap.biz.mcp.tool.dto
* @className SmsSendReq
* @description AX HUB 시스템 처리 클래스
* @author 김형식
* @create 2026.09.01
* <pre>
* ---------- 개정이력 ----------
* 수정일 수정자 수정내용
* ---------- -------- ---------------------------
* 2026.09.01 김형식 최초생성
*
* </pre>
*/
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SmsSendReq {
@McpParameter(description = "수신자 전화번호", required = true)
private String phoneNumber;
@McpParameter(description = "전송할 메시지 내용", required = true)
private String message;
}

View File

@@ -0,0 +1,15 @@
package io.shinhanlife.dap.biz.mcp.tool.sms;
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 AxHubToolSmsApplication {
public static void main(String[] args) {
SpringApplication.run(AxHubToolSmsApplication.class, args);
}
}

View File

@@ -0,0 +1,15 @@
package io.shinhanlife.dap.biz.mcp.tool.sms.converter;
import io.shinhanlife.dap.biz.mcp.tool.dto.SmsSendReq;
import io.shinhanlife.dap.biz.mcp.tool.sms.dto.SmsLegacyReqDto;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring")
public interface SmsLegacyConverter {
@Mapping(source = "phoneNumber", target = "phone")
@Mapping(source = "message", target = "content")
SmsLegacyReqDto toLegacyReq(SmsSendReq req);
}

View File

@@ -0,0 +1,18 @@
package io.shinhanlife.dap.biz.mcp.tool.sms.dto;
import lombok.Builder;
import lombok.Getter;
@Getter
@Builder
public class SmsLegacyReqDto {
/**
* EAI 시스템이 요구하는 수신자 번호 파라미터명
*/
private String phone;
/**
* EAI 시스템이 요구하는 메시지 내용 파라미터명
*/
private String content;
}

View File

@@ -0,0 +1,52 @@
package io.shinhanlife.dap.biz.mcp.tool.sms.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.SmsSendReq;
import io.shinhanlife.dap.biz.mcp.tool.service.AbstractMcpToolService;
import io.shinhanlife.dap.biz.mcp.tool.sms.converter.SmsLegacyConverter;
import io.shinhanlife.dap.biz.mcp.tool.sms.dto.SmsLegacyReqDto;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import java.util.Map;
/**
* @package io.shinhanlife.dap.biz.mcp.tool.sms
* @className SmsToolService
* @description AX HUB 시스템 처리 클래스
* @author 김형식
* @create 2026.09.01
* <pre>
* ---------- 개정이력 ----------
* 수정일 수정자 수정내용
* ---------- -------- ---------------------------
* 2026.09.01 김형식 최초생성
*
* </pre>
*/
@Slf4j
@RequiredArgsConstructor
@McpTool(routingType = "EAI", categoryKey = "notification")
public class SmsToolService extends AbstractMcpToolService {
private final SmsLegacyConverter converter;
@McpFunction(displayName = "send_sms 툴", name = "send_sms", description = "SMS 발송", prompt = "고객에게 SMS 메시지를 발송해줘.", mappingId = "SMS_SEND_001")
public Object sendSms(SmsSendReq req) {
log.info("[SMS] SMS 발송 요청 수신. 수신자: {}", req.getPhoneNumber());
// MapStruct를 이용한 자동 매핑 (AI DTO -> MCI DTO)
SmsLegacyReqDto legacyReq = converter.toLegacyReq(req);
// 레거시 시스템 연동 (EAI) - DTO 객체를 그대로 넘김
Map<String, Object> result = executeLegacy("EAI", "SMS_SEND_001", legacyReq);
// 결과 가공
if ("SUCCESS".equals(result.get("status"))) {
result.put("message", "SMS가 성공적으로 발송되었습니다.");
}
return result;
}
}

View File

@@ -0,0 +1,21 @@
# Render 클라우드 환경 전용 설정
server.port=${PORT:8082}
axhub.gateway.url=https://dap-gateway.onrender.com
axhub.tool.url=https://dap-tool-sms.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,24 @@
# 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
# API 보안 키 설정
mcp.security.tenant-domains.mcp-client-1=CUSTOMER,COMMON
mcp.security.tenant-domains.mcp-client-2=ALL
# Gateway/Tool URLs
axhub.gateway.url=http://localhost:8081
axhub.tool.url=http://localhost:${server.port}

View File

@@ -0,0 +1,5 @@
spring:
config:
import: "classpath:config/application-glow-local.yml"

View File

@@ -0,0 +1,13 @@
server.port=8082
spring.application.name=dap-tool-sms
spring.profiles.active=local
# Suppress Kafka Connection Logs
logging.level.org.apache.kafka=ERROR
# Auto Prefix Namespace
mcp.namespace=sms
# 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-sms.log</file> <!-- 현재 로그가 쌓이는 파일 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 매일 자정에 날짜를 붙여서 지난 로그를 분리 저장 -->
<fileNamePattern>logs/axhub-tool-sms-%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>