관련 소스 업데이트
Some checks failed
Deploy to OCIWP / deploy (push) Failing after 18s

This commit is contained in:
jade
2026-08-20 09:43:22 +09:00
parent 64c422378f
commit 8744387b29
4 changed files with 43 additions and 75 deletions

View File

@@ -1,5 +0,0 @@
package io.shinhanlife.dap.mcc.biz.gat.converter;
/** Per-Tool converters are generated beside this compatibility marker. */
public interface SystemNoticeConverter {
}

View File

@@ -1,14 +0,0 @@
package io.shinhanlife.dap.mcc.biz.gat.usecase;
import org.springaicommunity.mcp.annotation.McpTool;
import io.shinhanlife.dap.lib.annotation.GrowToolHint;
import io.shinhanlife.dap.mcc.biz.gat.dto.GaActivityStatusRequest;
import io.shinhanlife.dap.mcc.biz.gat.dto.GaActivityStatusResponse;
public interface SystemNoticeUseCase {
@McpTool(name = "gat_ga_status", title = "GA 현황 조회", description = "GA 활동 현황을 조회하는 도구입니다.")
@GrowToolHint(register = true, categoryKey = "gat", mappingId = "CLHTTP00001")
GaActivityStatusResponse gaActivityStatus(GaActivityStatusRequest req);
}

View File

@@ -1,30 +0,0 @@
package io.shinhanlife.dap.mcc.biz.gat.usecase.impl;
import io.shinhanlife.dap.mcc.biz.gat.usecase.SystemNoticeUseCase;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import io.shinhanlife.dap.mcc.biz.gat.dto.GaActivityStatusRequest;
import io.shinhanlife.dap.mcc.biz.gat.dto.GaActivityStatusResponse;
import io.shinhanlife.dap.mcc.biz.gat.converter.GaActivityStatusConverter;
import io.shinhanlife.dap.mcc.infra.itrf.http.ga_activity_status.GaActivityStatusClient;
import io.shinhanlife.dap.mcc.infra.itrf.http.ga_activity_status.io.GaActivityStatusHttpRequest;
import io.shinhanlife.dap.mcc.infra.itrf.http.ga_activity_status.io.GaActivityStatusHttpResponse;
@Service
@RequiredArgsConstructor
public class SystemNoticeUseCaseImpl implements SystemNoticeUseCase {
private final GaActivityStatusClient gaActivityStatusClient;
private final GaActivityStatusConverter gaActivityStatusConverter;
@Override
public GaActivityStatusResponse gaActivityStatus(GaActivityStatusRequest req) {
GaActivityStatusHttpRequest request = gaActivityStatusConverter.toRequest(req);
GaActivityStatusHttpResponse response = gaActivityStatusClient.call(request, GaActivityStatusHttpResponse.class);
GaActivityStatusResponse toolResponse = gaActivityStatusConverter.toResponse(response);
if (toolResponse == null) toolResponse = new GaActivityStatusResponse();
toolResponse.setResultCode("SUCCESS");
return toolResponse;
}
}

View File

@@ -167,9 +167,9 @@ public class ToolScaffolder {
String moduleName, StringBuilder log) throws IOException { String moduleName, StringBuilder log) throws IOException {
String baseName = toPascalCase(tool.baseName()); String baseName = toPascalCase(tool.baseName());
boolean mci = "MCI".equalsIgnoreCase(tool.routingType()); boolean mci = "MCI".equalsIgnoreCase(tool.routingType());
String code = mci ? tool.clientSystemCode().toLowerCase(Locale.ROOT) : toPackageSegment(tool.httpApiName()); String codePath = mci ? (tool.clientSystemCode().length() == 4 ? tool.clientSystemCode().substring(0, 3).toLowerCase(Locale.ROOT) + "/" + tool.clientSystemCode().substring(3).toLowerCase(Locale.ROOT) : tool.clientSystemCode().toLowerCase(Locale.ROOT)) : toPackageSegment(tool.httpApiName());
String ioPackage = BASE_PACKAGE + (mci ? ".infra.itrf.mci." : ".infra.itrf.http.") + code; String ioPackage = BASE_PACKAGE + (mci ? ".infra.itrf.mci." : ".infra.itrf.http.") + codePath.replace("/", ".");
Path clientDir = sourceRoot.resolve(Paths.get("infra", "itrf", mci ? "mci" : "http", code)); Path clientDir = sourceRoot.resolve(Paths.get("infra", "itrf", mci ? "mci" : "http", codePath.replace("/", "\\\\")));
Path ioDir = clientDir.resolve("io"); Path ioDir = clientDir.resolve("io");
Files.createDirectories(ioDir); Files.createDirectories(ioDir);
writeUtf8(dtoDir.resolve(baseName + "Request.java"), writeUtf8(dtoDir.resolve(baseName + "Request.java"),
@@ -180,13 +180,26 @@ public class ToolScaffolder {
writeStructuredFieldTypes(dtoDir, bizPackage + ".dto", baseName + "Response", tool.outputFields()); writeStructuredFieldTypes(dtoDir, bizPackage + ".dto", baseName + "Response", tool.outputFields());
if (mci) { if (mci) {
writeUtf8(ioDir.resolve(baseName + "_I.java"), writeUtf8(ioDir.resolve(baseName + "_I.java"),
mciIoContent("infra.itrf.mci." + code, baseName + "_I", tool.inputFields(), "", "")); mciIoContent("infra.itrf.mci." + codePath.replace("/", "."), baseName + "_I", tool.inputFields(), "", ""));
writeUtf8(ioDir.resolve(baseName + "_O.java"), writeUtf8(ioDir.resolve(baseName + "_O.java"),
mciIoContent("infra.itrf.mci." + code, baseName + "_O", tool.outputFields(), "", "")); mciIoContent("infra.itrf.mci." + codePath.replace("/", "."), baseName + "_O", tool.outputFields(), "", ""));
writeStructuredFieldTypes(ioDir, ioPackage + ".io", baseName + "_I", tool.inputFields()); writeStructuredFieldTypes(ioDir, ioPackage + ".io", baseName + "_I", tool.inputFields());
writeStructuredFieldTypes(ioDir, ioPackage + ".io", baseName + "_O", tool.outputFields()); writeStructuredFieldTypes(ioDir, ioPackage + ".io", baseName + "_O", tool.outputFields());
writeUtf8(clientDir.resolve(baseName + "Client.java"), String clientPrefixCap = toPascalCase(tool.clientSystemCode());
groupedMciClientContent(ioPackage, baseName, tool.interfaceId())); Path mciClientFile = clientDir.resolve("Mci" + clientPrefixCap + "Client.java");
if (!java.nio.file.Files.exists(mciClientFile)) {
String mciClientContent = "package " + ioPackage + ";\n\n"
+ "import org.springframework.stereotype.Component;\n"
+ "import lombok.RequiredArgsConstructor;\n"
+ "import io.shinhanlife.dap.lib.integration.mci.component.AxhubMciComponent;\n"
+ "import io.shinhanlife.glow.communication.dto.Transfer;\n\n"
+ "@Component\n@RequiredArgsConstructor\npublic class Mci" + clientPrefixCap + "Client {\n"
+ " private final AxhubMciComponent mci;\n"
+ " public <O> Transfer<O> callTo(String interfaceId, String dummy, Object mciReq, Class<O> resType) throws Exception {\n"
+ " return mci.callTo(interfaceId, dummy, mciReq, resType);\n"
+ " }\n}\n";
writeUtf8(mciClientFile, mciClientContent);
}
writeUtf8(sourceRoot.resolve(Paths.get("biz", tool.group().toLowerCase(Locale.ROOT), "converter", baseName + "Converter.java")), writeUtf8(sourceRoot.resolve(Paths.get("biz", tool.group().toLowerCase(Locale.ROOT), "converter", baseName + "Converter.java")),
groupedMciConverterContent(bizPackage, baseName, ioPackage)); groupedMciConverterContent(bizPackage, baseName, ioPackage));
} else { } else {
@@ -280,7 +293,9 @@ public class ToolScaffolder {
clientVariable = Character.toLowerCase(baseName.charAt(0)) + baseName.substring(1) + "Client"; clientVariable = Character.toLowerCase(baseName.charAt(0)) + baseName.substring(1) + "Client";
} }
String converterVariable = Character.toLowerCase(baseName.charAt(0)) + baseName.substring(1) + "Converter"; String converterVariable = Character.toLowerCase(baseName.charAt(0)) + baseName.substring(1) + "Converter";
String integrationPackage = BASE_PACKAGE + (mci ? ".infra.itrf.mci." + tool.clientSystemCode().toLowerCase(Locale.ROOT) String integrationSysCode = tool.clientSystemCode().toLowerCase(Locale.ROOT);
String sysCodePath = integrationSysCode.length() == 4 ? integrationSysCode.substring(0, 3) + "." + integrationSysCode.substring(3) : integrationSysCode;
String integrationPackage = BASE_PACKAGE + (mci ? ".infra.itrf.mci." + sysCodePath
: ".infra.itrf.http." + toPackageSegment(tool.httpApiName())); : ".infra.itrf.http." + toPackageSegment(tool.httpApiName()));
imports.append("import ").append(bizPackage).append(".dto.").append(baseName).append("Request;\n") imports.append("import ").append(bizPackage).append(".dto.").append(baseName).append("Request;\n")
.append("import ").append(bizPackage).append(".dto.").append(baseName).append("Response;\n") .append("import ").append(bizPackage).append(".dto.").append(baseName).append("Response;\n")
@@ -298,7 +313,7 @@ public class ToolScaffolder {
.append("(").append(baseName).append("Request req) {\n") .append("(").append(baseName).append("Request req) {\n")
.append(" ").append(baseName).append(mci ? "_I" : "HttpRequest").append(" request = ").append(converterVariable).append(".toRequest(req);\n") .append(" ").append(baseName).append(mci ? "_I" : "HttpRequest").append(" request = ").append(converterVariable).append(".toRequest(req);\n")
.append(" ").append(baseName).append(mci ? "_O" : "HttpResponse").append(" response = ").append(clientVariable) .append(" ").append(baseName).append(mci ? "_O" : "HttpResponse").append(" response = ").append(clientVariable)
.append(mci ? ".call(\"" + tool.interfaceId() + "\", request, " + baseName + "_O.class);\n" : ".call(request, " + baseName + "HttpResponse.class);\n") .append(mci ? ".callTo(\"" + tool.interfaceId() + "\", null, request, " + baseName + "_O.class).getBody();\n" : ".call(request, " + baseName + "HttpResponse.class);\n")
.append(" ").append(baseName).append("Response toolResponse = ").append(converterVariable).append(".toResponse(response);\n") .append(" ").append(baseName).append("Response toolResponse = ").append(converterVariable).append(".toResponse(response);\n")
.append(" if (toolResponse == null) toolResponse = new ").append(baseName).append("Response();\n") .append(" if (toolResponse == null) toolResponse = new ").append(baseName).append("Response();\n")
.append(" toolResponse.setResultCode(\"SUCCESS\");\n") .append(" toolResponse.setResultCode(\"SUCCESS\");\n")
@@ -360,7 +375,9 @@ public class ToolScaffolder {
throw new IllegalArgumentException("Tool method or MCP Tool name already exists: " + methodName); throw new IllegalArgumentException("Tool method or MCP Tool name already exists: " + methodName);
} }
boolean mci = "MCI".equalsIgnoreCase(tool.routingType()); boolean mci = "MCI".equalsIgnoreCase(tool.routingType());
String integrationPackage = BASE_PACKAGE + (mci ? ".infra.itrf.mci." + tool.clientSystemCode().toLowerCase(Locale.ROOT) String integrationSysCode = tool.clientSystemCode().toLowerCase(Locale.ROOT);
String sysCodePath = integrationSysCode.length() == 4 ? integrationSysCode.substring(0, 3) + "." + integrationSysCode.substring(3) : integrationSysCode;
String integrationPackage = BASE_PACKAGE + (mci ? ".infra.itrf.mci." + sysCodePath
: ".infra.itrf.http." + toPackageSegment(tool.httpApiName())); : ".infra.itrf.http." + toPackageSegment(tool.httpApiName()));
String requestType = baseName + "Request"; String requestType = baseName + "Request";
String responseType = baseName + "Response"; String responseType = baseName + "Response";
@@ -645,7 +662,7 @@ public class ToolScaffolder {
Path mciClientDir = null; Path mciClientDir = null;
if (isMci && clientSystemCode != null && clientSystemCode.length() == 4) { if (isMci && clientSystemCode != null && clientSystemCode.length() == 4) {
String clientPrefix = clientSystemCode.toLowerCase(); String clientPrefix = clientSystemCode.length() == 4 ? clientSystemCode.substring(0,3).toLowerCase() + "/" + clientSystemCode.substring(3).toLowerCase() : clientSystemCode.toLowerCase();
clientPrefixCap = toPascalCase(clientSystemCode); clientPrefixCap = toPascalCase(clientSystemCode);
mciGroupPath = "infra/itrf/mci/" + clientPrefix; mciGroupPath = "infra/itrf/mci/" + clientPrefix;
mciClientDir = rootDir.resolve(Paths.get(moduleName, BASE_PACKAGE_PATH, mciGroupPath)); mciClientDir = rootDir.resolve(Paths.get(moduleName, BASE_PACKAGE_PATH, mciGroupPath));