Initial commit

This commit is contained in:
jade
2026-08-04 21:59:08 +09:00
commit b698c0e8f8
290 changed files with 16715 additions and 0 deletions

8
dap-tool-sms/Dockerfile Normal file
View File

@@ -0,0 +1,8 @@
FROM eclipse-temurin:21-jre-alpine
WORKDIR /app
RUN apk add --no-cache tzdata
ENV TZ=Asia/Seoul
COPY 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,29 @@
package io.shinhanlife.dap.mcc.biz.sms.converter;
/**
* @package io.shinhanlife.dap.mcc.sms.converter
* @className SmsLegacyConverter
* @description AX HUB 시스템 처리 클래스
* @author 0986406
* @create 2026.09.01
* <pre>
* ---------- 개정이력 ----------
* 수정일 수정자 수정내용
* ---------- -------- ---------------------------
* 2026.09.01 0986406 최초생성
*
* </pre>
*/
import io.shinhanlife.dap.mcc.biz.sms.dto.SmsSendRequest;
import io.shinhanlife.dap.mcc.biz.sms.legacy.SmsLegacyRequest;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
@Mapper(componentModel = "spring")
public interface SmsLegacyConverter {
@Mapping(source = "phoneNumber", target = "phone")
@Mapping(source = "message", target = "content")
SmsLegacyRequest toLegacyRequest(SmsSendRequest req);
}

View File

@@ -0,0 +1,42 @@
package io.shinhanlife.dap.mcc.biz.sms.dto;
import lombok.Builder;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import io.shinhanlife.dap.lib.annotation.McpParameter;
import io.shinhanlife.dap.lib.annotation.McpValidation;
import lombok.Getter;
import lombok.Setter;
/**
* @package io.shinhanlife.dap.mcc.dto
* @className SmsSendRequest
* @description AX HUB 시스템 처리 클래스
* @author 0986406
* @create 2026.09.01
* <pre>
* ---------- 개정이력 ----------
* 수정일 수정자 수정내용
* ---------- -------- ---------------------------
* 2026.09.01 0986406 최초생성
*
* </pre>
*/
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SmsSendRequest {
@McpParameter(description = "수신자 전화번호", required = true)
@McpValidation(pattern = "^01[0-9]-?\\d{3,4}-?\\d{4}$")
private String phoneNumber;
@McpParameter(description = "전송할 메시지 내용", required = true)
@McpValidation(pattern = "\\S")
private String message;
}

View File

@@ -0,0 +1,33 @@
package io.shinhanlife.dap.mcc.biz.sms.legacy;
/**
* @package io.shinhanlife.dap.mcc.sms.dto
* @className SmsLegacyRequest
* @description AX HUB 시스템 처리 클래스
* @author 0986406
* @create 2026.09.01
* <pre>
* ---------- 개정이력 ----------
* 수정일 수정자 수정내용
* ---------- -------- ---------------------------
* 2026.09.01 0986406 최초생성
*
* </pre>
*/
import lombok.Builder;
import lombok.Getter;
@Getter
@Builder
public class SmsLegacyRequest {
/**
* EAI 시스템이 요구하는 수신자 번호 파라미터명
*/
private String phone;
/**
* EAI 시스템이 요구하는 메시지 내용 파라미터명
*/
private String content;
}

View File

@@ -0,0 +1,10 @@
package io.shinhanlife.dap.mcc.biz.sms.usecase;
import io.shinhanlife.dap.lib.annotation.McpTool;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.mcc.biz.sms.dto.*;
@McpTool(routingType = "EAI", categoryKey = "notification")
public interface SmsToolUseCase {
Object sendSms(SmsSendRequest req);
}

View File

@@ -0,0 +1,53 @@
package io.shinhanlife.dap.mcc.biz.sms.usecase.impl;
import io.shinhanlife.dap.mcc.biz.sms.usecase.SmsToolUseCase;
import io.shinhanlife.dap.mcc.usecase.AbstractMcpToolUseCase;
import org.springframework.stereotype.Service;
import io.shinhanlife.dap.mcc.biz.sms.converter.SmsLegacyConverter;
import io.shinhanlife.dap.mcc.biz.sms.dto.SmsSendRequest;
import io.shinhanlife.dap.mcc.biz.sms.legacy.SmsLegacyRequest;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import java.util.Map;
/**
* @package io.shinhanlife.dap.mcc.sms
* @className SmsToolService
* @description AX HUB 시스템 처리 클래스
* @author 0986406
* @create 2026.09.01
* <pre>
* ---------- 개정이력 ----------
* 수정일 수정자 수정내용
* ---------- -------- ---------------------------
* 2026.09.01 0986406 최초생성
*
* </pre>
*/
@Slf4j
@RequiredArgsConstructor
@Service
public class SmsToolUseCaseImpl extends AbstractMcpToolUseCase implements SmsToolUseCase {
private final SmsLegacyConverter converter;
@Override
public Object sendSms(SmsSendRequest req) {
log.info("[SMS] SMS 발송 요청 수신. 수신자: {}", req.getPhoneNumber());
// MapStruct를 이용한 자동 매핑 (AI DTO -> MCI DTO)
SmsLegacyRequest legacyRequest = converter.toLegacyRequest(req);
// 레거시 시스템 연동 (EAI) - DTO 객체를 그대로 넘김
Map<String, Object> result = executeLegacy("EAI", "SMS_SEND_001", legacyRequest);
// 결과 가공
if ("SUCCESS".equals(result.get("status"))) {
result.put("message", "SMS가 성공적으로 발송되었습니다.");
}
return result;
}
}

View File

@@ -0,0 +1,30 @@
package io.shinhanlife.dap.mcc.sms;
/**
* @package io.shinhanlife.dap.mcc.sms
* @className DapToolSmsApplication
* @description AX HUB 시스템 처리 클래스
* @author 0986406
* @create 2026.09.01
* <pre>
* ---------- 개정이력 ----------
* 수정일 수정자 수정내용
* ---------- -------- ---------------------------
* 2026.09.01 0986406 최초생성
*
* </pre>
*/
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.mcc", "io.shinhanlife.dap.lib.adapter", "io.shinhanlife.dap.lib.mcp", "io.shinhanlife.dap.lib.config", "io.shinhanlife.dap.lib.integration"})
@ConfigurationPropertiesScan(basePackages = {"io.shinhanlife.dap.mcc", "io.shinhanlife.dap.lib.adapter", "io.shinhanlife.dap.lib.mcp", "io.shinhanlife.dap.lib.config", "io.shinhanlife.dap.lib.integration"})
@EnableCaching
public class DapToolSmsApplication {
public static void main(String[] args) {
SpringApplication.run(DapToolSmsApplication.class, args);
}
}

View File

@@ -0,0 +1,28 @@
# OCI ?대씪?곕뱶 ?섍꼍 ?꾩슜 ?ㅼ젙
server:
port: ${PORT:8082}
axhub:
gateway:
url: https://axhubmcp.devjun.net
eims:
http:
url: http://localhost:${server.port}/api/gateway
tcp:
host: 127.0.0.1
port: 8090
timeout: 5000
jsp:
form:
url: http://localhost:${server.port}/mock/jsp-form
json:
url: http://localhost:${server.port}/mock/jsp-json
mci:
url: http://localhost:${server.port}/api/mock/esb/api
mcistring:
url: http://localhost:${server.port}/api/mock/esb/string
spring:
config:
import: optional:classpath:glow/application-glow.yml

View File

@@ -0,0 +1,39 @@
# Local ?섍꼍 ?꾩슜 ?ㅼ젙 (H2 硫붾え由?DB ??
spring:
datasource:
url: jdbc:p6spy:h2:mem:testdb;DB_CLOSE_DELAY=-1;
driverClassName: com.p6spy.engine.spy.P6SpyDriver
username: sa
password: password
h2:
console:
enabled: true
eims:
http:
url: http://localhost:${server.port}/api/gateway
tcp:
host: 127.0.0.1
port: 8090
timeout: 5000
jsp:
form:
url: http://localhost:${server.port}/mock/jsp-form
json:
url: http://localhost:${server.port}/mock/jsp-json
mci:
url: http://localhost:${server.port}/api/mock/esb/api
mcistring:
url: http://localhost:${server.port}/api/mock/esb/string
mcp:
security:
tenant-domains:
mcp-client-1: CUSTOMER,COMMON
mcp-client-2: ALL
axhub:
gateway:
url: http://localhost:8081
tool:
url: ${AXHUB_TOOL_URL:http://localhost:${server.port}}

View File

@@ -0,0 +1,19 @@
server:
port: 8082
spring:
application:
name: dap-tool-sms
profiles:
active: local
logging:
level:
org.apache.kafka: ERROR
mcp:
namespace: ""
manifest:
bundle-id: tool-sms
# Set the AA-assigned prefix before MCP pull activation (for example: sms.).
name-prefix: ""
security:
tenant-domains:
TESTER-DEV: ALL

View File

@@ -0,0 +1,39 @@
<?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) 출력 설정 (서버 운영용) -->
<!-- Logback에서 시스템 Hostname을 가져오기 위한 설정 -->
<property name="HOSTNAME" value="${HOSTNAME}" />
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>/swlog/dap-tool-sms/A01/${HOSTNAME}_A01.log</file> <!-- 현재 로그가 쌓이는 파일 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 매일 자정에 날짜를 붙여서 지난 로그를 분리 저장 -->
<fileNamePattern>/swlog/dap-tool-sms/A01/${HOSTNAME}_A01_%d{yyyyMMdd}.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>