From 400fa3b6c1943c84249a0372fe2998c63b52290d Mon Sep 17 00:00:00 2001 From: jade Date: Thu, 20 Aug 2026 13:30:32 +0900 Subject: [PATCH] fix: resolve remaining baseName placeholders for MCI IO files in grouped append and converter generators --- .../dat/lib/util/ToolScaffolder.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dat-was-lib/src/main/java/io/shinhanlife/dat/lib/util/ToolScaffolder.java b/dat-was-lib/src/main/java/io/shinhanlife/dat/lib/util/ToolScaffolder.java index 8ef175ea..fa786a00 100644 --- a/dat-was-lib/src/main/java/io/shinhanlife/dat/lib/util/ToolScaffolder.java +++ b/dat-was-lib/src/main/java/io/shinhanlife/dat/lib/util/ToolScaffolder.java @@ -194,7 +194,7 @@ public class ToolScaffolder { writeUtf8(clientDir.resolve(baseName + "Client.java"), groupedMciClientContent(ioPackage, baseName, tool.interfaceId())); } writeUtf8(sourceRoot.resolve(Paths.get("biz", tool.group().toLowerCase(Locale.ROOT), "converter", baseName + "Converter.java")), - groupedMciConverterContent(bizPackage, baseName, ioPackage)); + groupedMciConverterContent(bizPackage, baseName, ioPackage, tool.interfaceId())); } else { writeUtf8(ioDir.resolve(baseName + "HttpRequest.java"), dtoContent(ioPackage + ".io", baseName + "HttpRequest", tool.inputFields(), "", "", true)); @@ -321,17 +321,17 @@ public class ToolScaffolder { + "public interface " + useCaseBaseName + "Converter {\n}\n"; } - private static String groupedMciConverterContent(String bizPackage, String baseName, String ioPackage) { + private static String groupedMciConverterContent(String bizPackage, String baseName, String ioPackage, String interfaceId) { return "package " + bizPackage + ".converter;\n\n" + "import " + bizPackage + ".dto." + baseName + "Request;\n" + "import " + bizPackage + ".dto." + baseName + "Response;\n" - + "import " + ioPackage + ".io." + baseName + "_I;\n" - + "import " + ioPackage + ".io." + baseName + "_O;\n" + + "import " + ioPackage + ".io." + interfaceId + "_I;\n" + + "import " + ioPackage + ".io." + interfaceId + "_O;\n" + "import org.mapstruct.Mapper;\nimport org.mapstruct.ReportingPolicy;\n\n" + "@Mapper(componentModel = \"spring\", unmappedTargetPolicy = ReportingPolicy.IGNORE)\n" + "public interface " + baseName + "Converter {\n" - + " " + baseName + "_I toRequest(" + baseName + "Request request);\n" - + " " + baseName + "Response toResponse(" + baseName + "_O response);\n}\n"; + + " " + interfaceId + "_I toRequest(" + baseName + "Request request);\n" + + " " + baseName + "Response toResponse(" + interfaceId + "_O response);\n}\n"; } private static String groupedHttpConverterContent(String bizPackage, String baseName, String ioPackage) { @@ -368,8 +368,8 @@ public class ToolScaffolder { : ".infra.itrf.http." + toPackageSegment(tool.httpApiName())); String requestType = baseName + "Request"; String responseType = baseName + "Response"; - String requestIo = baseName + (mci ? "_I" : "HttpRequest"); - String responseIo = baseName + (mci ? "_O" : "HttpResponse"); + String requestIo = mci ? tool.interfaceId() + "_I" : baseName + "HttpRequest"; + String responseIo = mci ? tool.interfaceId() + "_O" : baseName + "HttpResponse"; useCase = addImport(useCase, "import " + bizPackage + ".dto." + requestType + ";") ; useCase = addImport(useCase, "import " + bizPackage + ".dto." + responseType + ";") ; @@ -443,7 +443,7 @@ public class ToolScaffolder { } implementation = insertConstructorField(implementation, " private final " + baseName + "Converter " + converterVariable + ";"); String call = mci - ? clientVariable + ".call(\"" + tool.interfaceId() + "\", request, " + responseIo + ".class)" + ? clientVariable + ".callTo(\"" + tool.interfaceId() + "\", null, request, " + responseIo + ".class).getBody()" : clientVariable + ".call(request, " + responseIo + ".class)"; String method = "\n @Override\n public " + responseType + " " + methodName + "(" + requestType + " req) {\n" + " " + requestIo + " request = " + converterVariable + ".toRequest(req);\n"