git 변경 테스트

This commit is contained in:
jade
2026-07-16 20:22:27 +09:00
parent 5a0e6951e2
commit 746879e804
3 changed files with 23 additions and 22 deletions

View File

@@ -18,10 +18,10 @@ public class PodScaffolder {
System.out.println(" MCP Tool Pod Scaffolder (Java CLI) ");
System.out.println("=========================================\n");
String rawModuleName = getOrAsk(args, 0, scanner, "1. 생성할 모듈(Pod) 이름 (예: payment 또는 axhub-tool-payment): ");
String moduleName = rawModuleName.startsWith("axhub-tool-") ? rawModuleName : "axhub-tool-" + rawModuleName;
String rawModuleName = getOrAsk(args, 0, scanner, "1. 생성할 모듈(Pod) 이름 (예: payment 또는 dap-tool-payment): ");
String moduleName = rawModuleName.startsWith("dap-tool-") ? rawModuleName : "dap-tool-" + rawModuleName;
String portStr = getOrAsk(args, 1, scanner, "2. 사용할 포트 번호 (예: 8085): ");
String shortName = moduleName.replace("axhub-tool-", "").replace("-", "");
String shortName = moduleName.replace("dap-tool-", "").replace("-", "");
String defaultAuthor = System.getProperty("user.name");
String defaultDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy.MM.dd"));
@@ -62,7 +62,7 @@ public class PodScaffolder {
id 'org.springframework.boot'
}
dependencies {
implementation project(':axhub-tool-core')
implementation project(':dap-tool-core')
}
dependencies {
compileOnly 'org.projectlombok:lombok:1.18.32'
@@ -94,7 +94,7 @@ public class PodScaffolder {
/**
* @package io.shinhanlife.dap.biz.mcp.tool.%s
* @className %sToolApplication
* @className DapTool%sApplication
* @description AX HUB 시스템 처리 클래스
* @author %s
* @create %s
@@ -109,13 +109,13 @@ public class PodScaffolder {
@SpringBootApplication(scanBasePackages = {"io.shinhanlife.dap.biz.mcp.tool", "io.shinhanlife.dap.biz.mcp.adapter", "io.shinhanlife.dap.common.mcp", "io.shinhanlife.dap.common.config"})
@ConfigurationPropertiesScan(basePackages = {"io.shinhanlife.dap.biz.mcp.tool", "io.shinhanlife.dap.biz.mcp.adapter", "io.shinhanlife.dap.common.mcp", "io.shinhanlife.dap.common.config"})
@EnableCaching
public class %sToolApplication {
public class DapTool%sApplication {
public static void main(String[] args) {
SpringApplication.run(%sToolApplication.class, args);
SpringApplication.run(DapTool%sApplication.class, args);
}
}
""".formatted(shortName, shortName, capitalize(shortName), author, createDate, createDate, author, capitalize(shortName), capitalize(shortName));
Files.writeString(srcPath.resolve(capitalize(shortName) + "ToolApplication.java"), appClass);
Files.writeString(srcPath.resolve("DapTool" + capitalize(shortName) + "Application.java"), appClass);
Path resPath = modulePath.resolve("src/main/resources");
Files.createDirectories(resPath);
@@ -236,7 +236,8 @@ public class PodScaffolder {
String newService = """
%s:
build:
context: ./%s
context: .
dockerfile: %s/Dockerfile
ports:
- "%s:%s"
depends_on:

View File

@@ -17,8 +17,8 @@ import java.util.Scanner;
* - 콘솔 창에 뜨는 질문에 차례대로 값을 입력하기만 하면 파일이 생성됩니다.
*
* 방법 2. 커맨드라인(터미널)에서 실행 (명령어 기반)
* - 컴파일: javac -encoding UTF-8 axhub-tool-core/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/util/ToolScaffolder.java
* - 실행: java -cp axhub-tool-core/src/main/java io.shinhanlife.dap.biz.mcp.tool.util.ToolScaffolder [이름] [ID] "[설명]" "[그룹]" "[통신방식]" "[모듈명]"
* - 컴파일: javac -encoding UTF-8 dap-tool-core/src/main/java/io/shinhanlife/dap/biz/mcp/tool/util/ToolScaffolder.java
* - 실행: java -cp dap-tool-core/src/main/java io.shinhanlife.dap.biz.mcp.tool.util.ToolScaffolder [이름] [ID] "[설명]" "[그룹]" "[통신방식]" "[모듈명]"
*/
/**
* @package io.shinhanlife.dap.biz.mcp.tool.util
@@ -37,7 +37,7 @@ import java.util.Scanner;
public class ToolScaffolder {
private static final String BASE_PACKAGE = "io.shinhanlife.dap.biz.mcp.tool";
private static final String BASE_PACKAGE_PATH = "src/main/java/io/shinhanlife/axhub/biz/mcp/tool";
private static final String BASE_PACKAGE_PATH = "src/main/java/io/shinhanlife/dap/biz/mcp/tool";
public static void main(String[] args) throws IOException {
Scanner scanner = new Scanner(System.in);
@@ -55,9 +55,9 @@ public class ToolScaffolder {
if (routingType.trim().isEmpty()) {
routingType = "HTTP";
}
String moduleName = getOrAsk(args, 5, scanner, "6. 코드를 생성할 모듈 (기본: axhub-tool-other): ");
String moduleName = getOrAsk(args, 5, scanner, "6. 코드를 생성할 모듈 (기본: dap-tool-other): ");
if (moduleName.trim().isEmpty()) {
moduleName = "axhub-tool-other";
moduleName = "dap-tool-other";
}
String defaultAuthor = System.getProperty("user.name");
@@ -88,7 +88,7 @@ public class ToolScaffolder {
Path serviceDir = rootDir.resolve(Paths.get(moduleName, BASE_PACKAGE_PATH, "service"));
Path dtoDir = rootDir.resolve(Paths.get(moduleName, BASE_PACKAGE_PATH, "dto"));
String shortName = moduleName.replace("axhub-tool-", "").replace("-", "");
String shortName = moduleName.replace("dap-tool-", "").replace("-", "");
Path legacyDtoDir = rootDir.resolve(Paths.get(moduleName, BASE_PACKAGE_PATH, shortName, "dto"));
Path converterDir = rootDir.resolve(Paths.get(moduleName, BASE_PACKAGE_PATH, shortName, "converter"));

View File

@@ -19,10 +19,10 @@ public class ScaffoldingController {
@PostMapping("/pod")
public String scaffoldPod(@RequestBody Map<String, String> req) {
try {
String moduleName = req.getOrDefault("moduleName", "axhub-tool-other");
if (!moduleName.startsWith("axhub-tool-")) moduleName = "axhub-tool-" + moduleName;
String moduleName = req.getOrDefault("moduleName", "dap-tool-other");
if (!moduleName.startsWith("dap-tool-")) moduleName = "dap-tool-" + moduleName;
String port = req.getOrDefault("port", "8085");
String shortName = moduleName.replace("axhub-tool-", "").replace("-", "");
String shortName = moduleName.replace("dap-tool-", "").replace("-", "");
String author = req.get("author");
if (author == null || author.trim().isEmpty()) author = System.getProperty("user.name");
String date = req.get("date");
@@ -42,7 +42,7 @@ public class ScaffoldingController {
String description = req.get("description");
String group = req.getOrDefault("categoryKey", req.getOrDefault("group", "COMMON"));
String routingType = req.getOrDefault("routingType", "HTTP");
String moduleName = req.getOrDefault("moduleName", "axhub-tool-other");
String moduleName = req.getOrDefault("moduleName", "dap-tool-other");
String author = req.get("author");
if (author == null || author.trim().isEmpty()) author = System.getProperty("user.name");
String date = req.get("date");
@@ -78,13 +78,13 @@ public class ScaffoldingController {
if (sourceDir == null) sourceDir = System.getProperty("user.dir");
File dir = new File(sourceDir);
File[] files = dir.listFiles(f -> f.isDirectory() && f.getName().startsWith("axhub-tool-") && !f.getName().equals("axhub-tool-core"));
File[] files = dir.listFiles(f -> f.isDirectory() && f.getName().startsWith("dap-tool-") && !f.getName().equals("dap-tool-core"));
if (files == null) return List.of("axhub-tool-other");
if (files == null) return List.of("dap-tool-other");
return Arrays.stream(files).map(File::getName).sorted().collect(Collectors.toList());
} catch (Exception e) {
return List.of("axhub-tool-other");
return List.of("dap-tool-other");
}
}
}