Refactor: ToolService 인터페이스 분리 및 GlowEaiComponent 로드 에러 수정
Some checks failed
Deploy to OCIWP / deploy (push) Has been cancelled
Some checks failed
Deploy to OCIWP / deploy (push) Has been cancelled
This commit is contained in:
@@ -1,51 +1,7 @@
|
||||
package io.shinhanlife.dap.dapmt.service;
|
||||
|
||||
import io.shinhanlife.dap.dapmt.annotation.McpFunction;
|
||||
import io.shinhanlife.dap.dapmt.annotation.McpTool;
|
||||
import io.shinhanlife.dap.dapmt.converter.SmsLegacyConverter;
|
||||
import io.shinhanlife.dap.dapmt.dto.SmsSendReq;
|
||||
import io.shinhanlife.dap.dapmt.legacy.SmsLegacyReq;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import io.shinhanlife.dap.dapmt.dto.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.dapmt.sms
|
||||
* @className SmsToolService
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 0986406
|
||||
* @create 2026.09.01
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.09.01 0986406 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@McpTool(routingType = "EAI", categoryKey = "notification")
|
||||
public class SmsToolService extends AbstractMcpToolService {
|
||||
|
||||
private final SmsLegacyConverter converter;
|
||||
|
||||
@McpFunction(register = false, 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)
|
||||
SmsLegacyReq 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;
|
||||
}
|
||||
}
|
||||
public interface SmsToolService {
|
||||
Object sendSms(SmsSendReq req);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package io.shinhanlife.dap.dapmt.service.impl;
|
||||
|
||||
import io.shinhanlife.dap.dapmt.annotation.McpFunction;
|
||||
import io.shinhanlife.dap.dapmt.annotation.McpTool;
|
||||
import io.shinhanlife.dap.dapmt.service.SmsToolService;
|
||||
import io.shinhanlife.dap.dapmt.service.AbstractMcpToolService;
|
||||
import io.shinhanlife.dap.dapmt.converter.SmsLegacyConverter;
|
||||
import io.shinhanlife.dap.dapmt.dto.SmsSendReq;
|
||||
import io.shinhanlife.dap.dapmt.legacy.SmsLegacyReq;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.dapmt.sms
|
||||
* @className SmsToolService
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 0986406
|
||||
* @create 2026.09.01
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.09.01 0986406 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@McpTool(routingType = "EAI", categoryKey = "notification")
|
||||
public class SmsToolServiceImpl extends AbstractMcpToolService implements SmsToolService {
|
||||
|
||||
private final SmsLegacyConverter converter;
|
||||
|
||||
@McpFunction(register = false, displayName = "send_sms 툴", name = "send_sms", description = "SMS 발송", prompt = "고객에게 SMS 메시지를 발송해줘.", mappingId = "SMS_SEND_001")
|
||||
@Override
|
||||
public Object sendSms(SmsSendReq req) {
|
||||
log.info("[SMS] SMS 발송 요청 수신. 수신자: {}", req.getPhoneNumber());
|
||||
|
||||
// MapStruct를 이용한 자동 매핑 (AI DTO -> MCI DTO)
|
||||
SmsLegacyReq 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user