feat(core, other): add MCI_STRING support and GlowTrgmField parser with sample tool

This commit is contained in:
jade
2026-07-09 13:20:43 +09:00
parent 4181a79cd8
commit bad6932f35
7 changed files with 268 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
package io.shinhanlife.axhub.biz.mcp.tool.dto;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
/**
* @package io.shinhanlife.axhub.biz.mcp.tool.dto
* @className SampleStringReq
* @description AX HUB 시스템 처리 클래스
* @author 김형식
* @create 2026.09.01
* <pre>
* ---------- 개정이력 ----------
* 수정일 수정자 수정내용
* ---------- -------- ---------------------------
* 2026.09.01 김형식 최초생성
*
* </pre>
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SampleStringReq {
private String query;
}

View File

@@ -0,0 +1,35 @@
package io.shinhanlife.axhub.biz.mcp.tool.dto;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.shinhanlife.glow.GlowTrgmField;
import lombok.Data;
/**
* @package io.shinhanlife.axhub.biz.mcp.tool.dto
* @className SampleStringRes
* @description AX HUB 시스템 처리 클래스
* @author 김형식
* @create 2026.09.01
* <pre>
* ---------- 개정이력 ----------
* 수정일 수정자 수정내용
* ---------- -------- ---------------------------
* 2026.09.01 김형식 최초생성
*
* </pre>
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SampleStringRes {
@GlowTrgmField(order = 1, length = 10, description = "이름")
private String name;
@GlowTrgmField(order = 2, length = 3, description = "나이")
private int age;
@GlowTrgmField(order = 3, length = 8, description = "가입일자(YYYYMMDD)")
private String joinDate;
@GlowTrgmField(order = 4, length = 2, description = "상태코드")
private String statusCode;
}

View File

@@ -0,0 +1,50 @@
package io.shinhanlife.axhub.biz.mcp.tool.service;
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.SampleStringReq;
import io.shinhanlife.axhub.biz.mcp.tool.dto.SampleStringRes;
import io.shinhanlife.glow.util.GlowTrgmParser;
import org.springframework.stereotype.Service;
/**
* @package io.shinhanlife.axhub.biz.mcp.tool.service
* @className SampleStringToolService
* @description AX HUB 시스템 처리 클래스
* @author 김형식
* @create 2026.09.01
* <pre>
* ---------- 개정이력 ----------
* 수정일 수정자 수정내용
* ---------- -------- ---------------------------
* 2026.09.01 김형식 최초생성
*
* </pre>
*/
@Service
@McpTool(
routingType = "MCI_STRING",
group = "COMMON"
)
public class SampleStringToolService extends AbstractMcpToolService {
@McpFunction(
name = "get_sample_string",
description = "MCI String 버전과 GlowTrgmField 파싱을 테스트하는 샘플 툴입니다.",
prompt = "MCI 전문(String) 연계 및 고정 길이 파싱 테스트 해줘.",
mappingId = "TRGM_001"
)
public Object execute(SampleStringReq req) {
// 1. EIMS(Legacy)를 통해 원본 고정 길이 문자열을 받아옵니다.
java.util.Map<String, Object> result = executeLegacy("MCI_STRING", "TRGM_001", req);
if ("ERROR".equals(result.get("status"))) {
return result;
}
String rawStringResponse = (String) result.get("legacy_response");
// 2. 받아온 고정 길이 전문(String)을 GlowTrgmParser를 이용해 DTO로 파싱합니다.
return GlowTrgmParser.parse(rawStringResponse, SampleStringRes.class);
}
}

View File

@@ -44,3 +44,7 @@ mcp:
description: "고객상세 정보 조회"
prompt: "이 고객의 상세 기본정보(주소, 연락처 등)를 알려줘."
mappingId: "CRM_002"
get_sample_string:
description: "MCI String 버전과 GlowTrgmField 파싱을 테스트하는 샘플 툴입니다."
prompt: "MCI 전문(String) 연계 및 고정 길이 파싱 테스트 해줘."
mappingId: "TRGM_001"