Compare commits
8 Commits
a59249e1db
...
416b068fcb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
416b068fcb | ||
|
|
933ba2ecfa | ||
|
|
ce96137948 | ||
|
|
e983b47af6 | ||
|
|
1796370a35 | ||
|
|
680dbe098b | ||
|
|
a877103d93 | ||
|
|
6e1ef40380 |
@@ -30,3 +30,9 @@
|
|||||||
* 현재 개발 대상은 **대내MCI / EAI (JSON)** 연동으로 한정한다. (대외MCI FixedLength 연동은 범위에서 제외)
|
* 현재 개발 대상은 **대내MCI / EAI (JSON)** 연동으로 한정한다. (대외MCI FixedLength 연동은 범위에서 제외)
|
||||||
* 통신 노선, 데이터 변환 규격, 시스템별 연계 방식 등은 MCI/EIMS 상에서 관리되므로 코드 레벨에서 식별하거나 분기 처리하지 않는다. (단순 통합 JSON 요청만 수행)
|
* 통신 노선, 데이터 변환 규격, 시스템별 연계 방식 등은 MCI/EIMS 상에서 관리되므로 코드 레벨에서 식별하거나 분기 처리하지 않는다. (단순 통합 JSON 요청만 수행)
|
||||||
* 처리계 UI ↔ 처리계 AP 구간: `HTTPS` / `SSV`를 사용하며, FW에서 x-api를 통해 SSV↔DTO 변환을 수행한다.
|
* 처리계 UI ↔ 처리계 AP 구간: `HTTPS` / `SSV`를 사용하며, FW에서 x-api를 통해 SSV↔DTO 변환을 수행한다.
|
||||||
|
|
||||||
|
* 신한라이프 표준 로그 기준 (Logback 설정):
|
||||||
|
* **로그 생성 경로:** `/swlog/어플리케이션명(모듈명)/코드명/` (예: `/swlog/dap-gateway/A01/`)
|
||||||
|
* **로그 네이밍 규칙:** `${HOSTNAME}_코드명_yyyyMMdd.log` (예: `${HOSTNAME}_A01_20260722.log`)
|
||||||
|
* **기본 로그 구분 코드:** 시스템 운영기록 가동기록의 경우 `A01`을 기본으로 사용한다.
|
||||||
|
* **호스트명 동적 할당:** Logback 설정 시 `<property name="HOSTNAME" value="${HOSTNAME}" />` 를 선언하여 사용한다.
|
||||||
|
|||||||
@@ -12,11 +12,14 @@
|
|||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<!-- 3. 파일(File) 출력 설정 (서버 운영용) -->
|
<!-- 3. 파일(File) 출력 설정 (서버 운영용) -->
|
||||||
|
<!-- Logback에서 시스템 Hostname을 가져오기 위한 설정 -->
|
||||||
|
<property name="HOSTNAME" value="${HOSTNAME}" />
|
||||||
|
|
||||||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<file>logs/dap-gateway.log</file> <!-- 현재 로그가 쌓이는 파일 -->
|
<file>/swlog/dap-gateway/A01/${HOSTNAME}_A01.log</file> <!-- 현재 로그가 쌓이는 파일 -->
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<!-- 매일 자정에 날짜를 붙여서 지난 로그를 분리 저장 -->
|
<!-- 매일 자정에 날짜를 붙여서 지난 로그를 분리 저장 -->
|
||||||
<fileNamePattern>logs/dap-gateway-%d{yyyy-MM-dd}.log</fileNamePattern>
|
<fileNamePattern>/swlog/dap-gateway/A01/${HOSTNAME}_A01_%d{yyyyMMdd}.log</fileNamePattern>
|
||||||
<!-- 최대 30일치 로그만 보관하고 오래된 것은 자동 삭제 -->
|
<!-- 최대 30일치 로그만 보관하고 오래된 것은 자동 삭제 -->
|
||||||
<maxHistory>30</maxHistory>
|
<maxHistory>30</maxHistory>
|
||||||
</rollingPolicy>
|
</rollingPolicy>
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ public class ToolScaffolder {
|
|||||||
package %s.dto;
|
package %s.dto;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import %s.annotation.McpParameter;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -122,9 +123,13 @@ public class ToolScaffolder {
|
|||||||
@Data
|
@Data
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
public class %sReq {
|
public class %sReq {
|
||||||
// TODO: Add request fields here
|
@McpParameter(description = "수신자 전화번호", required = true)
|
||||||
|
private String phoneNumber;
|
||||||
|
|
||||||
|
@McpParameter(description = "전송할 메시지 내용", required = true)
|
||||||
|
private String message;
|
||||||
}
|
}
|
||||||
""".formatted(BASE_PACKAGE, BASE_PACKAGE, baseName, author, createDate, createDate, author, baseName);
|
""".formatted(BASE_PACKAGE, BASE_PACKAGE, BASE_PACKAGE, baseName, author, createDate, createDate, author, baseName);
|
||||||
Files.writeString(dtoDir.resolve(baseName + "Req.java"), reqContent);
|
Files.writeString(dtoDir.resolve(baseName + "Req.java"), reqContent);
|
||||||
|
|
||||||
// Generate Res DTO
|
// Generate Res DTO
|
||||||
@@ -176,6 +181,10 @@ public class ToolScaffolder {
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import java.util.Map;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
import %s.converter.%sLegacyConverter;
|
||||||
|
import %s.legacy.%sLegacyReq;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @package %s.service
|
* @package %s.service
|
||||||
@@ -201,6 +210,7 @@ public class ToolScaffolder {
|
|||||||
public class %sService {
|
public class %sService {
|
||||||
|
|
||||||
private final AxhubMciComponent mci;
|
private final AxhubMciComponent mci;
|
||||||
|
private final %sLegacyConverter converter = Mappers.getMapper(%sLegacyConverter.class);
|
||||||
|
|
||||||
@McpFunction(
|
@McpFunction(
|
||||||
displayName = "%s 툴",
|
displayName = "%s 툴",
|
||||||
@@ -215,16 +225,19 @@ public class ToolScaffolder {
|
|||||||
public Object execute(%sReq req) {
|
public Object execute(%sReq req) {
|
||||||
log.info("[MCI Tool] {} 요청 수신.", "%s");
|
log.info("[MCI Tool] {} 요청 수신.", "%s");
|
||||||
try {
|
try {
|
||||||
|
// MapStruct를 이용한 자동 매핑 (AI DTO -> MCI DTO)
|
||||||
|
%sLegacyReq legacyReq = converter.toLegacyReq(req);
|
||||||
|
|
||||||
Transfer<Object> resTransfer = mci.callTo(
|
Transfer<Object> resTransfer = mci.callTo(
|
||||||
"%s",
|
"%s",
|
||||||
null,
|
null,
|
||||||
req,
|
legacyReq,
|
||||||
Object.class
|
Object.class
|
||||||
);
|
);
|
||||||
return resTransfer.getBody() != null ? resTransfer.getBody() : "{\"status\":\"SUCCESS\"}";
|
return resTransfer.getBody() != null ? resTransfer.getBody() : Map.of("status", "SUCCESS");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("[MCI Tool] 연동 중 오류 발생: {}", e.getMessage(), e);
|
log.error("[MCI Tool] 연동 중 오류 발생: {}", e.getMessage(), e);
|
||||||
return "{\"status\":\"ERROR\", \"message\":\"" + e.getMessage() + "\"}";
|
return Map.of("status", "ERROR", "message", e.getMessage() != null ? e.getMessage() : "Unknown error");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -235,14 +248,19 @@ public class ToolScaffolder {
|
|||||||
BASE_PACKAGE, baseName,
|
BASE_PACKAGE, baseName,
|
||||||
BASE_PACKAGE, baseName,
|
BASE_PACKAGE, baseName,
|
||||||
BASE_PACKAGE, baseName,
|
BASE_PACKAGE, baseName,
|
||||||
|
BASE_PACKAGE, baseName,
|
||||||
|
BASE_PACKAGE, baseName,
|
||||||
author,
|
author,
|
||||||
createDate,
|
createDate,
|
||||||
createDate, author,
|
createDate, author,
|
||||||
routingType, group.toLowerCase(),
|
routingType, group.toLowerCase(),
|
||||||
baseName,
|
baseName,
|
||||||
|
baseName, baseName,
|
||||||
baseName, toolName, description, description + " 해줘.", interfaceId, register,
|
baseName, toolName, description, description + " 해줘.", interfaceId, register,
|
||||||
baseName,
|
baseName,
|
||||||
baseName, interfaceId
|
baseName,
|
||||||
|
baseName,
|
||||||
|
interfaceId
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
serviceContent = """
|
serviceContent = """
|
||||||
@@ -306,6 +324,7 @@ public class ToolScaffolder {
|
|||||||
createDate, author,
|
createDate, author,
|
||||||
routingType, group.toLowerCase(),
|
routingType, group.toLowerCase(),
|
||||||
baseName,
|
baseName,
|
||||||
|
baseName, baseName,
|
||||||
baseName, toolName, description, description + " 해줘.", interfaceId, register,
|
baseName, toolName, description, description + " 해줘.", interfaceId, register,
|
||||||
baseName,
|
baseName,
|
||||||
baseName,
|
baseName,
|
||||||
@@ -336,7 +355,15 @@ public class ToolScaffolder {
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class %sLegacyReq {
|
public class %sLegacyReq {
|
||||||
// TODO: Add legacy request fields here
|
/**
|
||||||
|
* EAI 시스템이 요구하는 수신자 번호 파라미터명
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EAI 시스템이 요구하는 메시지 내용 파라미터명
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
}
|
}
|
||||||
""".formatted(BASE_PACKAGE, BASE_PACKAGE, baseName, author, createDate, createDate, author, baseName);
|
""".formatted(BASE_PACKAGE, BASE_PACKAGE, baseName, author, createDate, createDate, author, baseName);
|
||||||
Files.writeString(legacyDtoDir.resolve(baseName + "LegacyReq.java"), legacyReqContent);
|
Files.writeString(legacyDtoDir.resolve(baseName + "LegacyReq.java"), legacyReqContent);
|
||||||
@@ -395,9 +422,15 @@ public class ToolScaffolder {
|
|||||||
@Mapper(componentModel = "spring")
|
@Mapper(componentModel = "spring")
|
||||||
public interface %sLegacyConverter {
|
public interface %sLegacyConverter {
|
||||||
|
|
||||||
|
@Mapping(source = "phoneNumber", target = "phone")
|
||||||
|
@Mapping(source = "message", target = "content")
|
||||||
%sLegacyReq toLegacyReq(%sReq req);
|
%sLegacyReq toLegacyReq(%sReq req);
|
||||||
|
|
||||||
%sRes toRes(%sLegacyRes legacyRes);
|
@Mapping(source = "phone", target = "phoneNumber")
|
||||||
|
@Mapping(source = "content", target = "message")
|
||||||
|
%sReq toReq(%sLegacyReq legacyReq);
|
||||||
|
|
||||||
|
// %sRes toRes(%sLegacyRes legacyRes);
|
||||||
}
|
}
|
||||||
""".formatted(
|
""".formatted(
|
||||||
BASE_PACKAGE,
|
BASE_PACKAGE,
|
||||||
@@ -406,7 +439,7 @@ public class ToolScaffolder {
|
|||||||
BASE_PACKAGE, baseName,
|
BASE_PACKAGE, baseName,
|
||||||
BASE_PACKAGE, baseName,
|
BASE_PACKAGE, baseName,
|
||||||
BASE_PACKAGE, baseName, author, createDate, createDate, author,
|
BASE_PACKAGE, baseName, author, createDate, createDate, author,
|
||||||
baseName, baseName, baseName, baseName, baseName, baseName
|
baseName, baseName, baseName, baseName, baseName, baseName, baseName
|
||||||
);
|
);
|
||||||
Files.writeString(converterDir.resolve(baseName + "LegacyConverter.java"), converterContent);
|
Files.writeString(converterDir.resolve(baseName + "LegacyConverter.java"), converterContent);
|
||||||
|
|
||||||
|
|||||||
@@ -12,11 +12,14 @@
|
|||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<!-- 3. 파일(File) 출력 설정 (서버 운영용) -->
|
<!-- 3. 파일(File) 출력 설정 (서버 운영용) -->
|
||||||
|
<!-- Logback에서 시스템 Hostname을 가져오기 위한 설정 -->
|
||||||
|
<property name="HOSTNAME" value="${HOSTNAME}" />
|
||||||
|
|
||||||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<file>logs/axhub-tool-email.log</file> <!-- 현재 로그가 쌓이는 파일 -->
|
<file>/swlog/dap-tool-email/A01/${HOSTNAME}_A01.log</file> <!-- 현재 로그가 쌓이는 파일 -->
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<!-- 매일 자정에 날짜를 붙여서 지난 로그를 분리 저장 -->
|
<!-- 매일 자정에 날짜를 붙여서 지난 로그를 분리 저장 -->
|
||||||
<fileNamePattern>logs/axhub-tool-email-%d{yyyy-MM-dd}.log</fileNamePattern>
|
<fileNamePattern>/swlog/dap-tool-email/A01/${HOSTNAME}_A01_%d{yyyyMMdd}.log</fileNamePattern>
|
||||||
<!-- 최대 30일치 로그만 보관하고 오래된 것은 자동 삭제 -->
|
<!-- 최대 30일치 로그만 보관하고 오래된 것은 자동 삭제 -->
|
||||||
<maxHistory>30</maxHistory>
|
<maxHistory>30</maxHistory>
|
||||||
</rollingPolicy>
|
</rollingPolicy>
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class OnnbaMciToolService {
|
|||||||
* @McpFunction 어노테이션 하나로 AI 도구로 자동 노출 및 라우팅됩니다.
|
* @McpFunction 어노테이션 하나로 AI 도구로 자동 노출 및 라우팅됩니다.
|
||||||
*/
|
*/
|
||||||
@McpFunction(
|
@McpFunction(
|
||||||
register = true,
|
register = false,
|
||||||
name = "calculate_subscription_limit",
|
name = "calculate_subscription_limit",
|
||||||
displayName = "보종By가입설계한도계산조회",
|
displayName = "보종By가입설계한도계산조회",
|
||||||
description = "MCI 연동을 통해 보종By가입설계한도계산조회를 수행합니다.",
|
description = "MCI 연동을 통해 보종By가입설계한도계산조회를 수행합니다.",
|
||||||
|
|||||||
@@ -12,11 +12,14 @@
|
|||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<!-- 3. 파일(File) 출력 설정 (서버 운영용) -->
|
<!-- 3. 파일(File) 출력 설정 (서버 운영용) -->
|
||||||
|
<!-- Logback에서 시스템 Hostname을 가져오기 위한 설정 -->
|
||||||
|
<property name="HOSTNAME" value="${HOSTNAME}" />
|
||||||
|
|
||||||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<file>logs/dap-tool-other.log</file> <!-- 현재 로그가 쌓이는 파일 -->
|
<file>/swlog/dap-tool-other/A01/${HOSTNAME}_A01.log</file> <!-- 현재 로그가 쌓이는 파일 -->
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<!-- 매일 자정에 날짜를 붙여서 지난 로그를 분리 저장 -->
|
<!-- 매일 자정에 날짜를 붙여서 지난 로그를 분리 저장 -->
|
||||||
<fileNamePattern>logs/dap-tool-other-%d{yyyy-MM-dd}.log</fileNamePattern>
|
<fileNamePattern>/swlog/dap-tool-other/A01/${HOSTNAME}_A01_%d{yyyyMMdd}.log</fileNamePattern>
|
||||||
<!-- 최대 30일치 로그만 보관하고 오래된 것은 자동 삭제 -->
|
<!-- 최대 30일치 로그만 보관하고 오래된 것은 자동 삭제 -->
|
||||||
<maxHistory>30</maxHistory>
|
<maxHistory>30</maxHistory>
|
||||||
</rollingPolicy>
|
</rollingPolicy>
|
||||||
|
|||||||
@@ -12,11 +12,14 @@
|
|||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<!-- 3. 파일(File) 출력 설정 (서버 운영용) -->
|
<!-- 3. 파일(File) 출력 설정 (서버 운영용) -->
|
||||||
|
<!-- Logback에서 시스템 Hostname을 가져오기 위한 설정 -->
|
||||||
|
<property name="HOSTNAME" value="${HOSTNAME}" />
|
||||||
|
|
||||||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<file>logs/dap-tool-payment.log</file> <!-- 현재 로그가 쌓이는 파일 -->
|
<file>/swlog/dap-tool-payment/A01/${HOSTNAME}_A01.log</file> <!-- 현재 로그가 쌓이는 파일 -->
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<!-- 매일 자정에 날짜를 붙여서 지난 로그를 분리 저장 -->
|
<!-- 매일 자정에 날짜를 붙여서 지난 로그를 분리 저장 -->
|
||||||
<fileNamePattern>logs/dap-tool-payment-%d{yyyy-MM-dd}.log</fileNamePattern>
|
<fileNamePattern>/swlog/dap-tool-payment/A01/${HOSTNAME}_A01_%d{yyyyMMdd}.log</fileNamePattern>
|
||||||
<!-- 최대 30일치 로그만 보관하고 오래된 것은 자동 삭제 -->
|
<!-- 최대 30일치 로그만 보관하고 오래된 것은 자동 삭제 -->
|
||||||
<maxHistory>30</maxHistory>
|
<maxHistory>30</maxHistory>
|
||||||
</rollingPolicy>
|
</rollingPolicy>
|
||||||
|
|||||||
@@ -12,11 +12,14 @@
|
|||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<!-- 3. 파일(File) 출력 설정 (서버 운영용) -->
|
<!-- 3. 파일(File) 출력 설정 (서버 운영용) -->
|
||||||
|
<!-- Logback에서 시스템 Hostname을 가져오기 위한 설정 -->
|
||||||
|
<property name="HOSTNAME" value="${HOSTNAME}" />
|
||||||
|
|
||||||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<file>logs/dap-tool-sms.log</file> <!-- 현재 로그가 쌓이는 파일 -->
|
<file>/swlog/dap-tool-sms/A01/${HOSTNAME}_A01.log</file> <!-- 현재 로그가 쌓이는 파일 -->
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<!-- 매일 자정에 날짜를 붙여서 지난 로그를 분리 저장 -->
|
<!-- 매일 자정에 날짜를 붙여서 지난 로그를 분리 저장 -->
|
||||||
<fileNamePattern>logs/dap-tool-sms-%d{yyyy-MM-dd}.log</fileNamePattern>
|
<fileNamePattern>/swlog/dap-tool-sms/A01/${HOSTNAME}_A01_%d{yyyyMMdd}.log</fileNamePattern>
|
||||||
<!-- 최대 30일치 로그만 보관하고 오래된 것은 자동 삭제 -->
|
<!-- 최대 30일치 로그만 보관하고 오래된 것은 자동 삭제 -->
|
||||||
<maxHistory>30</maxHistory>
|
<maxHistory>30</maxHistory>
|
||||||
</rollingPolicy>
|
</rollingPolicy>
|
||||||
|
|||||||
Reference in New Issue
Block a user