feat: 메타 테이블 조회
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package io.shinhanlife.dap.mcc.biz.cmm.converter;
|
||||
|
||||
import io.shinhanlife.dap.mcc.biz.cmm.dto.MetaTableRequest;
|
||||
import io.shinhanlife.dap.mcc.biz.cmm.dto.MetaTableResponse;
|
||||
import io.shinhanlife.dap.mcc.infra.itrf.mci.cfp.a.io.CLCNNB00001_I;
|
||||
import io.shinhanlife.dap.mcc.infra.itrf.mci.cfp.a.io.CLCNNB00001_O;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.mcc.biz.cmm.converter
|
||||
* @className MetaTableConverter
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 09863409
|
||||
* @create 2026.07.29
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.07.29 09863409 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface MetaTableConverter {
|
||||
@Mapping(target = "csNo", source = "tableName", defaultValue = "TB_META_BAS")
|
||||
CLCNNB00001_I toLegacyRequest(MetaTableRequest req);
|
||||
|
||||
@Mapping(target = "tableList", ignore = true)
|
||||
MetaTableResponse toResponse(CLCNNB00001_O mciRes);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package io.shinhanlife.dap.mcc.biz.cmm.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.shinhanlife.dap.lib.annotation.McpParameter;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.mcc.biz.cmm.dto
|
||||
* @className MetaTableRequest
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 09863409
|
||||
* @create 2026.07.29
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.07.29 09863409 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class MetaTableRequest {
|
||||
@McpParameter(description = "테이블 물리명 키워드 (예: TB_CUST_BAS, TB_CONT)", required = false)
|
||||
private String tableName;
|
||||
|
||||
@McpParameter(description = "테이블 논리명(한글) 키워드 (예: 고객기본, 계약)", required = false)
|
||||
private String tableLogicalName;
|
||||
|
||||
@McpParameter(description = "스키마/소유자명 (예: DAPADM, SHLOWN)", required = false)
|
||||
private String owner;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package io.shinhanlife.dap.mcc.biz.cmm.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.mcc.biz.cmm.dto
|
||||
* @className MetaTableResponse
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 09863409
|
||||
* @create 2026.07.29
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.07.29 09863409 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class MetaTableResponse {
|
||||
private List<MetaTableItem> tableList;
|
||||
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public static class MetaTableItem {
|
||||
private String owner;
|
||||
private String tableName;
|
||||
private String tableLogicalName;
|
||||
private String tableDesc;
|
||||
private Integer columnCount;
|
||||
private Long rowCount;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package io.shinhanlife.dap.mcc.biz.cmm.usecase;
|
||||
|
||||
import io.shinhanlife.dap.lib.annotation.McpFunction;
|
||||
import io.shinhanlife.dap.lib.annotation.McpTool;
|
||||
import io.shinhanlife.dap.mcc.biz.cmm.dto.MetaTableRequest;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.mcc.biz.cmm.usecase
|
||||
* @className MetaTableUseCase
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 09863409
|
||||
* @create 2026.07.29
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.07.29 09863409 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@McpTool(
|
||||
routingType = "MCI",
|
||||
categoryKey = "cmm"
|
||||
)
|
||||
public interface MetaTableUseCase {
|
||||
@McpFunction(
|
||||
displayName = "메타 테이블 조회 툴",
|
||||
name = "metaTable",
|
||||
description = "메타 테이블 정보 목록을 조회해줘",
|
||||
prompt = "메타 테이블 정보 목록을 조회해줘",
|
||||
mappingId = "CLCNNB00001",
|
||||
register = false,
|
||||
requiresApproval = false,
|
||||
openWorldHint = true
|
||||
)
|
||||
Object execute(MetaTableRequest req);
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package io.shinhanlife.dap.mcc.biz.cmm.usecase.impl;
|
||||
|
||||
import io.shinhanlife.dap.mcc.biz.cmm.converter.MetaTableConverter;
|
||||
import io.shinhanlife.dap.mcc.biz.cmm.dto.MetaTableRequest;
|
||||
import io.shinhanlife.dap.mcc.biz.cmm.dto.MetaTableResponse;
|
||||
import io.shinhanlife.dap.mcc.biz.cmm.dto.MetaTableResponse.MetaTableItem;
|
||||
import io.shinhanlife.dap.mcc.biz.cmm.usecase.MetaTableUseCase;
|
||||
import io.shinhanlife.dap.mcc.infra.itrf.mci.cfp.a.MciCfpaClient;
|
||||
import io.shinhanlife.dap.mcc.infra.itrf.mci.cfp.a.io.CLCNNB00001_I;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @package io.shinhanlife.dap.mcc.biz.cmm.usecase.impl
|
||||
* @className MetaTableUseCaseImpl
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author 09863409
|
||||
* @create 2026.07.29
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2026.07.29 09863409 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class MetaTableUseCaseImpl implements MetaTableUseCase {
|
||||
|
||||
private final MciCfpaClient mci;
|
||||
private final MetaTableConverter converter;
|
||||
|
||||
@Override
|
||||
public Object execute(MetaTableRequest req) {
|
||||
log.info("[MCI Tool] {} 요청 수신. 파라미터: {}", "metaTable", req);
|
||||
try {
|
||||
CLCNNB00001_I mciRequest = converter.toLegacyRequest(req);
|
||||
|
||||
Object mciResponse = mci.callCfpa0001(mciRequest);
|
||||
log.info("[MCI Tool] CLCNNB00001 MCI call completed. Returning response status: {}",
|
||||
mciResponse != null);
|
||||
|
||||
// 현업 테스트용으로 MCI 통신을 바이패스하고 하드코딩된 메타 테이블 샘플 결과를 반환합니다.
|
||||
MetaTableResponse res = new MetaTableResponse();
|
||||
List<MetaTableItem> list = new ArrayList<>();
|
||||
|
||||
MetaTableItem item1 = new MetaTableItem();
|
||||
item1.setOwner(req.getOwner() != null ? req.getOwner() : "DAPADM");
|
||||
item1.setTableName(req.getTableName() != null ? req.getTableName() : "TB_CUST_BAS");
|
||||
item1.setTableLogicalName("고객기본정보");
|
||||
item1.setTableDesc("고객 기본 프로필 및 인적사항 관리 테이블");
|
||||
item1.setColumnCount(35);
|
||||
item1.setRowCount(1250000L);
|
||||
list.add(item1);
|
||||
|
||||
MetaTableItem item2 = new MetaTableItem();
|
||||
item2.setOwner(req.getOwner() != null ? req.getOwner() : "DAPADM");
|
||||
item2.setTableName("TB_CONT_MCD");
|
||||
item2.setTableLogicalName("계약주계약정보");
|
||||
item2.setTableDesc("보험 계약 주계약 상세 원장 테이블");
|
||||
item2.setColumnCount(58);
|
||||
item2.setRowCount(3400000L);
|
||||
list.add(item2);
|
||||
|
||||
MetaTableItem item3 = new MetaTableItem();
|
||||
item3.setOwner(req.getOwner() != null ? req.getOwner() : "DAPADM");
|
||||
item3.setTableName("TB_CLAIM_DTL");
|
||||
item3.setTableLogicalName("청구접수상세");
|
||||
item3.setTableDesc("보험금 청구 접수 건별 내역 테이블");
|
||||
item3.setColumnCount(42);
|
||||
item3.setRowCount(890000L);
|
||||
list.add(item3);
|
||||
|
||||
res.setTableList(list);
|
||||
|
||||
return res;
|
||||
} catch (Exception e) {
|
||||
log.error("[MCI Tool] 연동 중 오류 발생: {}", e.getMessage(), e);
|
||||
return Map.of("status", "ERROR", "message", e.getMessage() != null ? e.getMessage() : "Unknown error");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user