forked from kimhyungsik/ax_hub_mcp_tool
refactor: apply Legacy naming convention to Sms and Sample converters and DTOs
This commit is contained in:
@@ -7,11 +7,11 @@ import org.mapstruct.Mapping;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface SmsMciConverter {
|
||||
public interface SmsLegacyConverter {
|
||||
|
||||
SmsMciConverter INSTANCE = Mappers.getMapper(SmsMciConverter.class);
|
||||
SmsLegacyConverter INSTANCE = Mappers.getMapper(SmsLegacyConverter.class);
|
||||
|
||||
@Mapping(source = "phoneNumber", target = "phone")
|
||||
@Mapping(source = "message", target = "content")
|
||||
SmsLegacyReqDto toMciReq(SmsSendReq req);
|
||||
SmsLegacyReqDto toLegacyReq(SmsSendReq req);
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import io.shinhanlife.axhub.biz.mcp.tool.annotation.McpFunction;
|
||||
import io.shinhanlife.axhub.biz.mcp.tool.annotation.McpTool;
|
||||
import io.shinhanlife.axhub.biz.mcp.tool.dto.SmsSendReq;
|
||||
import io.shinhanlife.axhub.biz.mcp.tool.service.AbstractMcpToolService;
|
||||
import io.shinhanlife.axhub.biz.mcp.tool.sms.converter.SmsMciConverter;
|
||||
import io.shinhanlife.axhub.biz.mcp.tool.sms.converter.SmsLegacyConverter;
|
||||
import io.shinhanlife.axhub.biz.mcp.tool.sms.dto.SmsLegacyReqDto;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -33,10 +33,10 @@ public class SmsToolService extends AbstractMcpToolService {
|
||||
log.info("[SMS] SMS 발송 요청 수신. 수신자: {}", req.getPhoneNumber());
|
||||
|
||||
// MapStruct를 이용한 자동 매핑 (AI DTO -> MCI DTO)
|
||||
SmsLegacyReqDto mciReq = SmsMciConverter.INSTANCE.toMciReq(req);
|
||||
SmsLegacyReqDto legacyReq = SmsLegacyConverter.INSTANCE.toLegacyReq(req);
|
||||
|
||||
// 레거시 시스템 연동 (EAI) - DTO 객체를 그대로 넘김
|
||||
Map<String, Object> result = executeLegacy("EAI", "SMS_SEND_001", mciReq);
|
||||
Map<String, Object> result = executeLegacy("EAI", "SMS_SEND_001", legacyReq);
|
||||
|
||||
// 결과 가공
|
||||
if ("SUCCESS".equals(result.get("status"))) {
|
||||
|
||||
Reference in New Issue
Block a user