feat(common, other): add GlowMciFieldInfo and List parsing support
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package io.shinhanlife.axhub.biz.mcp.tool.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.shinhanlife.glow.GlowMciFieldInfo;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.axhub.biz.mcp.tool.dto
|
||||
* @className MciSampleStringRes
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.09.01
|
||||
*/
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class MciSampleStringRes {
|
||||
@GlowMciFieldInfo(order = 1, length = 10, description = "이름")
|
||||
private String name;
|
||||
|
||||
@GlowMciFieldInfo(order = 2, length = 3, description = "나이")
|
||||
private int age;
|
||||
|
||||
@GlowMciFieldInfo(order = 3, length = 8, description = "가입일자(YYYYMMDD)")
|
||||
private String joinDate;
|
||||
|
||||
@GlowMciFieldInfo(order = 4, length = 2, description = "상태코드")
|
||||
private String statusCode;
|
||||
|
||||
@GlowMciFieldInfo(order = 5, length = 30, description = "타겟 리스트", target = MciSampleTargetDto.class)
|
||||
private List<MciSampleTargetDto> targetList;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package io.shinhanlife.axhub.biz.mcp.tool.dto;
|
||||
|
||||
import io.shinhanlife.glow.GlowMciFieldInfo;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.axhub.biz.mcp.tool.dto
|
||||
* @className MciSampleTargetDto
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 김형식
|
||||
* @create 2026.09.01
|
||||
*/
|
||||
@Data
|
||||
public class MciSampleTargetDto {
|
||||
@GlowMciFieldInfo(order = 1, length = 5, description = "항목 코드")
|
||||
private String itemCode;
|
||||
|
||||
@GlowMciFieldInfo(order = 2, length = 5, description = "항목 값")
|
||||
private String itemValue;
|
||||
}
|
||||
@@ -2,9 +2,8 @@ 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.MciSampleStringRes;
|
||||
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;
|
||||
|
||||
/**
|
||||
@@ -44,7 +43,7 @@ public class SampleStringToolService extends AbstractMcpToolService {
|
||||
|
||||
String rawStringResponse = (String) result.get("legacy_response");
|
||||
|
||||
// 2. 받아온 고정 길이 전문(String)을 GlowTrgmParser를 이용해 DTO로 파싱합니다.
|
||||
return GlowTrgmParser.parse(rawStringResponse, SampleStringRes.class);
|
||||
// 2. 받아온 고정 길이 전문(String)을 GlowMciParser를 이용해 DTO로 파싱합니다.
|
||||
return io.shinhanlife.glow.util.GlowMciParser.parse(rawStringResponse, MciSampleStringRes.class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user