This commit is contained in:
@@ -1,16 +0,0 @@
|
|||||||
package io.shinhanlife.dap.mcc.biz.cmm.io;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @package io.shinhanlife.dap.mcc.infra.itrf.mci.sample.io
|
|
||||||
* @className CUST_INQ_001_I
|
|
||||||
* @description 고객 정보 조회 샘플 MCI 요청 전문
|
|
||||||
* @author 0986406
|
|
||||||
* @create 2026.09.01
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class CUST_INQ_001_I {
|
|
||||||
private String customerId;
|
|
||||||
private String inquiryType;
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
package io.shinhanlife.dap.mcc.biz.cmm.io;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @package io.shinhanlife.dap.mcc.infra.itrf.mci.sample.io
|
|
||||||
* @className CUST_INQ_001_O
|
|
||||||
* @description 고객 정보 조회 샘플 MCI 응답 전문
|
|
||||||
* @author 0986406
|
|
||||||
* @create 2026.09.01
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class CUST_INQ_001_O {
|
|
||||||
private Object resultData;
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package io.shinhanlife.dap.mcc.biz.cmm.usecase;
|
|
||||||
|
|
||||||
import io.shinhanlife.dap.mcc.biz.cmm.dto.*;
|
|
||||||
|
|
||||||
public interface SampleMciToolUseCase {
|
|
||||||
Object inquiryCustomerInfo(io.shinhanlife.dap.mcc.biz.cmm.usecase.impl.SampleMciToolUseCaseImpl.SampleMciRequest req);
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package io.shinhanlife.dap.mcc.biz.cmm.usecase;
|
|
||||||
|
|
||||||
import io.shinhanlife.dap.mcc.biz.cmm.dto.*;
|
|
||||||
|
|
||||||
public interface SampleStringToolUseCase {
|
|
||||||
Object execute(SampleStringRequest req);
|
|
||||||
}
|
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
package io.shinhanlife.dap.mcc.biz.cmm.usecase.impl;
|
|
||||||
|
|
||||||
import io.shinhanlife.dap.mcc.biz.cmm.io.CUST_INQ_001_I;
|
|
||||||
import io.shinhanlife.dap.lib.adapter.sender.ShinhanMciSender;
|
|
||||||
import io.shinhanlife.dap.lib.integration.mci.dto.MciRequestWrapper;
|
|
||||||
import io.shinhanlife.dap.lib.integration.mci.dto.ShinhanCommonHeaderDto;
|
|
||||||
import io.shinhanlife.dap.lib.annotation.McpFunction;
|
|
||||||
import io.shinhanlife.dap.lib.annotation.McpTool;
|
|
||||||
import io.shinhanlife.dap.mcc.biz.cmm.usecase.SampleMciToolUseCase;
|
|
||||||
import io.shinhanlife.dap.mcc.usecase.AbstractMcpToolUseCase;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @package io.shinhanlife.dap.mcc.service
|
|
||||||
* @className SampleMciToolService
|
|
||||||
* @description AX HUB 시스템 처리 클래스
|
|
||||||
* @author 0986406
|
|
||||||
* @create 2026.09.01
|
|
||||||
* <pre>
|
|
||||||
* ---------- 개정이력 ----------
|
|
||||||
* 수정일 수정자 수정내용
|
|
||||||
* ---------- -------- ---------------------------
|
|
||||||
* 2026.09.01 0986406 최초생성
|
|
||||||
*
|
|
||||||
* </pre>
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@McpTool(routingType = "MCI", categoryKey = "oth") // MCP Tool 등록 어노테이션
|
|
||||||
public class SampleMciToolUseCaseImpl implements SampleMciToolUseCase {
|
|
||||||
|
|
||||||
// EIMS/MCI 발송을 담당하는 Sender 주입
|
|
||||||
private final ShinhanMciSender shinhanMciSender;
|
|
||||||
|
|
||||||
@Value("${shinhan.integration.mci.default-url:http://localhost:8081/api/mock/esb/api}")
|
|
||||||
private String mciTargetUrl;
|
|
||||||
|
|
||||||
// AI가 인식할 파라미터 DTO
|
|
||||||
@Data
|
|
||||||
public static class SampleMciRequest {
|
|
||||||
private String customerId;
|
|
||||||
private String inquiryType;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* AI Agent가 호출하게 될 메서드입니다.
|
|
||||||
*/
|
|
||||||
@McpFunction(register = false, name = "inquiry_customer_mci",
|
|
||||||
displayName = "고객 정보 조회 (MCI)",
|
|
||||||
description = "MCI 연동을 통해 고객의 상세 정보를 조회합니다.",
|
|
||||||
prompt = "고객 정보를 조회해줘.",
|
|
||||||
mappingId = "CUST_INQ_001"
|
|
||||||
)
|
|
||||||
public Object inquiryCustomerInfo(SampleMciRequest req) {
|
|
||||||
log.info("[MCI Tool] 고객 정보 조회 요청 수신. 고객ID: {}", req.getCustomerId());
|
|
||||||
|
|
||||||
try {
|
|
||||||
// 1. MCI 전문 통신을 위한 Wrapper 객체 생성
|
|
||||||
MciRequestWrapper<CUST_INQ_001_I> wrapper = new MciRequestWrapper<>();
|
|
||||||
|
|
||||||
// 2. 공통 헤더 세팅 (인터페이스 ID, 서비스 ID 등 업무에 맞게 설정)
|
|
||||||
ShinhanCommonHeaderDto header = new ShinhanCommonHeaderDto();
|
|
||||||
header.setItrIfId("CUST_INQ_001");
|
|
||||||
header.setRcvSvcId("INQ9040");
|
|
||||||
wrapper.setTgrmCmnnhddValu(header);
|
|
||||||
|
|
||||||
// 3. 비즈니스 데이터(Body) 세팅 (인터페이스 IO 매핑)
|
|
||||||
CUST_INQ_001_I mciReq = new CUST_INQ_001_I();
|
|
||||||
mciReq.setCustomerId(req.getCustomerId());
|
|
||||||
mciReq.setInquiryType(req.getInquiryType());
|
|
||||||
wrapper.setBody(mciReq);
|
|
||||||
|
|
||||||
// 4. ShinhanMciSender를 통해 실제 연동 수행 및 응답 수신
|
|
||||||
log.info("[MCI Tool] ShinhanMciSender 연동 시작... (URL: {})", mciTargetUrl);
|
|
||||||
String responseJson = shinhanMciSender.send(mciTargetUrl, wrapper);
|
|
||||||
|
|
||||||
log.info("[MCI Tool] MCI 연동 성공. 응답 수신 완료");
|
|
||||||
|
|
||||||
// 결과 반환 (이 문자열은 JSON 파싱되거나 그대로 AI에게 전달됩니다)
|
|
||||||
return responseJson;
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("[MCI Tool] MCI 연동 중 오류 발생: {}", e.getMessage(), e);
|
|
||||||
return "{\"status\":\"ERROR\", \"message\":\"MCI 통신 실패: " + e.getMessage() + "\"}";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
package io.shinhanlife.dap.mcc.biz.cmm.usecase.impl;
|
|
||||||
|
|
||||||
import io.shinhanlife.dap.lib.annotation.McpFunction;
|
|
||||||
import io.shinhanlife.dap.lib.annotation.McpTool;
|
|
||||||
import io.shinhanlife.dap.mcc.biz.cmm.usecase.SampleStringToolUseCase;
|
|
||||||
import io.shinhanlife.dap.mcc.usecase.AbstractMcpToolUseCase;
|
|
||||||
import io.shinhanlife.dap.mcc.biz.cmm.dto.MciSampleStringResponse;
|
|
||||||
import io.shinhanlife.dap.mcc.biz.cmm.dto.SampleStringRequest;
|
|
||||||
import io.shinhanlife.glow.util.GlowMciParser;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @package io.shinhanlife.dap.mcc.service
|
|
||||||
* @className SampleStringToolService
|
|
||||||
* @description AX HUB 시스템 처리 클래스
|
|
||||||
* @author 0986406
|
|
||||||
* @create 2026.09.01
|
|
||||||
* <pre>
|
|
||||||
* ---------- 개정이력 ----------
|
|
||||||
* 수정일 수정자 수정내용
|
|
||||||
* ---------- -------- ---------------------------
|
|
||||||
* 2026.09.01 0986406 최초생성
|
|
||||||
*
|
|
||||||
* </pre>
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
@McpTool(
|
|
||||||
routingType = "MCI",
|
|
||||||
categoryKey = "cmm"
|
|
||||||
)
|
|
||||||
public class SampleStringToolUseCaseImpl extends AbstractMcpToolUseCase implements SampleStringToolUseCase {
|
|
||||||
|
|
||||||
@McpFunction(register = false, displayName = "get_sample_string 툴", name = "get_sample_string",
|
|
||||||
description = "MCI String 버전과 GlowTrgmField 파싱을 테스트하는 샘플 툴입니다.",
|
|
||||||
prompt = "MCI 전문(String) 연계 및 고정 길이 파싱 테스트 해줘.",
|
|
||||||
mappingId = "TRGM_001"
|
|
||||||
)
|
|
||||||
@Override
|
|
||||||
public Object execute(SampleStringRequest req) {
|
|
||||||
// 1. EIMS(Legacy)를 통해 원본 고정 길이 문자열을 받아옵니다.
|
|
||||||
// 스펙에 mciFormat = STRING 힌트를 주어 전문 통신으로 자동 분기되게 합니다.
|
|
||||||
List<Map<String, Object>> spec = List.of(
|
|
||||||
Map.of("mciFormat", "STRING")
|
|
||||||
);
|
|
||||||
Map<String, Object> result = executeLegacy("MCI", "TRGM_001", req, spec);
|
|
||||||
|
|
||||||
if (!"SUCCESS".equals(result.get("status"))) {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
String rawStringResponse = (String) result.get("legacy_response");
|
|
||||||
|
|
||||||
// 2. 받아온 고정 길이 전문(String)을 GlowMciParser를 이용해 DTO로 파싱합니다.
|
|
||||||
return GlowMciParser.parse(rawStringResponse, MciSampleStringResponse.class);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +1,10 @@
|
|||||||
package io.shinhanlife.dap.mcc.biz.oth.usecase.impl;
|
package io.shinhanlife.dap.mcc.biz.oth.usecase.impl;
|
||||||
|
|
||||||
import io.shinhanlife.dap.mcc.biz.oth.io.MciCfpaClient;
|
import io.shinhanlife.dap.mcc.infra.itrf.mci.cfp.a.MciCfpaClient;
|
||||||
import io.shinhanlife.dap.lib.annotation.McpFunction;
|
import io.shinhanlife.dap.lib.annotation.McpFunction;
|
||||||
import io.shinhanlife.dap.lib.annotation.McpTool;
|
import io.shinhanlife.dap.lib.annotation.McpTool;
|
||||||
import io.shinhanlife.dap.mcc.biz.oth.usecase.OnnbaMciToolUseCase;
|
import io.shinhanlife.dap.mcc.biz.oth.usecase.OnnbaMciToolUseCase;
|
||||||
import io.shinhanlife.dap.mcc.usecase.AbstractMcpToolUseCase;
|
|
||||||
import io.shinhanlife.dap.mcc.biz.oth.dto.Onnba3011Request;
|
import io.shinhanlife.dap.mcc.biz.oth.dto.Onnba3011Request;
|
||||||
import io.shinhanlife.glow.communication.dto.Transfer;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -34,7 +32,7 @@ public class OnnbaMciToolUseCaseImpl implements OnnbaMciToolUseCase {
|
|||||||
private static final String INTERFACE_CODE_3011 = "CLCNNB00001";
|
private static final String INTERFACE_CODE_3011 = "CLCNNB00001";
|
||||||
|
|
||||||
// 공통 MCI Client 주입
|
// 공통 MCI Client 주입
|
||||||
private final MciCfpaClient mciCfpClient;
|
private final MciCfpaClient mciCfpaClient;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AI Agent가 호출하게 될 메서드입니다.
|
* AI Agent가 호출하게 될 메서드입니다.
|
||||||
@@ -54,7 +52,7 @@ public class OnnbaMciToolUseCaseImpl implements OnnbaMciToolUseCase {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// MciCfpaClient를 통한 호출
|
// MciCfpaClient를 통한 호출
|
||||||
Object response = mciCfpClient.callCfpa0001(req);
|
Object response = mciCfpaClient.callCfpa0001(req);
|
||||||
|
|
||||||
log.info("[MCI Tool] Glow 기반 MCI 연동 성공.");
|
log.info("[MCI Tool] Glow 기반 MCI 연동 성공.");
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package io.shinhanlife.dap.mcc.biz.oth.io;
|
package io.shinhanlife.dap.mcc.infra.itrf.mci.cfp.a;
|
||||||
|
|
||||||
import io.shinhanlife.dap.mcc.biz.oth.io.CLCNNB00001_I;
|
import io.shinhanlife.dap.mcc.infra.itrf.mci.cfp.a.io.CLCNNB00001_I;
|
||||||
import io.shinhanlife.dap.mcc.biz.oth.io.CLCNNB00001_O;
|
import io.shinhanlife.dap.mcc.infra.itrf.mci.cfp.a.io.CLCNNB00001_O;
|
||||||
import io.shinhanlife.dap.lib.integration.mci.component.AxhubMciComponent;
|
import io.shinhanlife.dap.lib.integration.mci.component.AxhubMciComponent;
|
||||||
import io.shinhanlife.dap.mcc.biz.oth.dto.Onnba3011Request;
|
import io.shinhanlife.dap.mcc.biz.oth.dto.Onnba3011Request;
|
||||||
import io.shinhanlife.glow.communication.dto.Transfer;
|
import io.shinhanlife.glow.communication.dto.Transfer;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package io.shinhanlife.dap.mcc.biz.oth.io;
|
package io.shinhanlife.dap.mcc.infra.itrf.mci.cfp.a.io;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package io.shinhanlife.dap.mcc.biz.oth.io;
|
package io.shinhanlife.dap.mcc.infra.itrf.mci.cfp.a.io;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
Reference in New Issue
Block a user