diff --git a/dap-tool-other/src/main/java/io/shinhanlife/dap/mcc/service/SampleMciToolService.java b/dap-tool-other/src/main/java/io/shinhanlife/dap/mcc/service/SampleMciToolService.java new file mode 100644 index 0000000..cc9bd25 --- /dev/null +++ b/dap-tool-other/src/main/java/io/shinhanlife/dap/mcc/service/SampleMciToolService.java @@ -0,0 +1,85 @@ +package io.shinhanlife.dap.mcc.service; + +import io.shinhanlife.dap.common.adapter.sender.ShinhanMciSender; +import io.shinhanlife.dap.common.integration.mci.dto.MciRequestWrapper; +import io.shinhanlife.dap.common.integration.mci.dto.ShinhanCommonHeaderDto; +import io.shinhanlife.dap.mcc.annotation.McpFunction; +import io.shinhanlife.dap.mcc.annotation.McpTool; +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 김형식 + * @create 2026.09.01 + *
+ * ---------- 개정이력 ---------- + * 수정일 수정자 수정내용 + * ---------- -------- --------------------------- + * 2026.09.01 김형식 최초생성 + * + *+ */ +@Slf4j +@RequiredArgsConstructor +@McpTool(routingType = "MCI", categoryKey = "other") // MCP Tool 등록 어노테이션 +public class SampleMciToolService { + + // 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 SampleMciReqDto { + private String customerId; + private String inquiryType; + } + + /** + * AI Agent가 호출하게 될 메서드입니다. + */ + @McpFunction( + name = "inquiry_customer_mci", + displayName = "고객 정보 조회 (MCI)", + description = "MCI 연동을 통해 고객의 상세 정보를 조회합니다.", + prompt = "고객 정보를 조회해줘.", + mappingId = "CUST_INQ_001" + ) + public Object inquiryCustomerInfo(SampleMciReqDto req) { + log.info("[MCI Tool] 고객 정보 조회 요청 수신. 고객ID: {}", req.getCustomerId()); + + try { + // 1. MCI 전문 통신을 위한 Wrapper 객체 생성 + MciRequestWrapper