feat: Add author and date params to scaffolders with Javadoc generation

This commit is contained in:
jade
2026-07-09 22:33:24 +09:00
parent e3e0b346bb
commit 6e59da645d
4 changed files with 53 additions and 40 deletions

View File

@@ -21,7 +21,12 @@ public class PodScaffolder {
String portStr = getOrAsk(args, 1, scanner, "2. 사용할 포트 번호 (예: 8085): "); String portStr = getOrAsk(args, 1, scanner, "2. 사용할 포트 번호 (예: 8085): ");
String shortName = moduleName.replace("axhub-tool-", "").replace("-", ""); String shortName = moduleName.replace("axhub-tool-", "").replace("-", "");
scaffoldPod(moduleName, portStr, shortName); String author = getOrAsk(args, 2, scanner, "3. 작성자 (예: 김형식): ");
if (author.trim().isEmpty()) author = "김형식";
String createDate = getOrAsk(args, 3, scanner, "4. 작성일 (예: 2026.09.01): ");
if (createDate.trim().isEmpty()) createDate = "2026.09.01";
scaffoldPod(moduleName, portStr, shortName, author, createDate);
} }
private static String getOrAsk(String[] args, int index, Scanner scanner, String prompt) { private static String getOrAsk(String[] args, int index, Scanner scanner, String prompt) {
@@ -32,7 +37,7 @@ public class PodScaffolder {
return scanner.nextLine().trim(); return scanner.nextLine().trim();
} }
private static void scaffoldPod(String moduleName, String portStr, String shortName) throws IOException { private static void scaffoldPod(String moduleName, String portStr, String shortName, String author, String createDate) throws IOException {
Path modulePath = Paths.get(moduleName); Path modulePath = Paths.get(moduleName);
if (Files.exists(modulePath)) { if (Files.exists(modulePath)) {
System.out.println("[오류] 이미 존재하는 모듈입니다: " + moduleName); System.out.println("[오류] 이미 존재하는 모듈입니다: " + moduleName);
@@ -77,6 +82,20 @@ public class PodScaffolder {
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.annotation.EnableCaching;
/**
* @package io.shinhanlife.axhub.biz.mcp.tool.%s
* @className %sToolApplication
* @description AX HUB 시스템 처리 클래스
* @author %s
* @create %s
* <pre>
* ---------- 개정이력 ----------
* 수정일 수정자 수정내용
* ---------- -------- ---------------------------
* %s %s 최초생성
*
* </pre>
*/
@SpringBootApplication(scanBasePackages = {"io.shinhanlife.axhub.biz.mcp.tool", "io.shinhanlife.axhub.biz.mcp.adapter", "io.shinhanlife.axhub.common.mcp", "io.shinhanlife.axhub.common.config"}) @SpringBootApplication(scanBasePackages = {"io.shinhanlife.axhub.biz.mcp.tool", "io.shinhanlife.axhub.biz.mcp.adapter", "io.shinhanlife.axhub.common.mcp", "io.shinhanlife.axhub.common.config"})
@org.springframework.boot.context.properties.ConfigurationPropertiesScan(basePackages = {"io.shinhanlife.axhub.biz.mcp.tool", "io.shinhanlife.axhub.biz.mcp.adapter", "io.shinhanlife.axhub.common.mcp", "io.shinhanlife.axhub.common.config"}) @org.springframework.boot.context.properties.ConfigurationPropertiesScan(basePackages = {"io.shinhanlife.axhub.biz.mcp.tool", "io.shinhanlife.axhub.biz.mcp.adapter", "io.shinhanlife.axhub.common.mcp", "io.shinhanlife.axhub.common.config"})
@EnableCaching @EnableCaching
@@ -85,7 +104,7 @@ public class PodScaffolder {
SpringApplication.run(%sToolApplication.class, args); SpringApplication.run(%sToolApplication.class, args);
} }
} }
""".formatted(shortName, capitalize(shortName), capitalize(shortName)); """.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(capitalize(shortName) + "ToolApplication.java"), appClass);
Path resPath = modulePath.resolve("src/main/resources"); Path resPath = modulePath.resolve("src/main/resources");
@@ -108,7 +127,8 @@ public class PodScaffolder {
String applicationProperties = """ String applicationProperties = """
spring.profiles.active=local spring.profiles.active=local
"""; mcp.namespace=%s
""".formatted(shortName);
Files.writeString(resPath.resolve("application.properties"), applicationProperties); Files.writeString(resPath.resolve("application.properties"), applicationProperties);
String applicationLocalProperties = """ String applicationLocalProperties = """

View File

@@ -57,8 +57,12 @@ public class ToolScaffolder {
if (moduleName.trim().isEmpty()) { if (moduleName.trim().isEmpty()) {
moduleName = "axhub-tool-other"; moduleName = "axhub-tool-other";
} }
String author = getOrAsk(args, 6, scanner, "7. 작성자 (예: 김형식): ");
if (author.trim().isEmpty()) author = "김형식";
String createDate = getOrAsk(args, 7, scanner, "8. 작성일 (예: 2026.09.01): ");
if (createDate.trim().isEmpty()) createDate = "2026.09.01";
scaffold(baseName, interfaceId, description, group, routingType, moduleName); scaffold(baseName, interfaceId, description, group, routingType, moduleName, author, createDate);
} }
private static String getOrAsk(String[] args, int index, Scanner scanner, String prompt) { private static String getOrAsk(String[] args, int index, Scanner scanner, String prompt) {
@@ -69,7 +73,7 @@ public class ToolScaffolder {
return scanner.nextLine().trim(); return scanner.nextLine().trim();
} }
private static void scaffold(String baseName, String interfaceId, String description, String group, String routingType, String moduleName) throws IOException { private static void scaffold(String baseName, String interfaceId, String description, String group, String routingType, String moduleName, String author, String createDate) throws IOException {
Path serviceDir = Paths.get(moduleName, BASE_PACKAGE_PATH, "service"); Path serviceDir = Paths.get(moduleName, BASE_PACKAGE_PATH, "service");
Path dtoDir = Paths.get(moduleName, BASE_PACKAGE_PATH, "dto"); Path dtoDir = Paths.get(moduleName, BASE_PACKAGE_PATH, "dto");
@@ -87,13 +91,13 @@ public class ToolScaffolder {
* @package %s.dto * @package %s.dto
* @className %sReq * @className %sReq
* @description AX HUB 시스템 처리 클래스 * @description AX HUB 시스템 처리 클래스
* @author 김형식 * @author %s
* @create 2026.09.01 * @create %s
* <pre> * <pre>
* ---------- 개정이력 ---------- * ---------- 개정이력 ----------
* 수정일 수정자 수정내용 * 수정일 수정자 수정내용
* ---------- -------- --------------------------- * ---------- -------- ---------------------------
* 2026.09.01 김형식 최초생성 * %s %s 최초생성
* *
* </pre> * </pre>
*/ */
@@ -102,7 +106,7 @@ public class ToolScaffolder {
public class %sReq { public class %sReq {
// TODO: Add request fields here // TODO: Add request fields here
} }
""".formatted(BASE_PACKAGE, BASE_PACKAGE, baseName, baseName); """.formatted(BASE_PACKAGE, baseName, author, createDate, createDate, author, baseName);
Files.writeString(dtoDir.resolve(baseName + "Req.java"), reqContent); Files.writeString(dtoDir.resolve(baseName + "Req.java"), reqContent);
// Generate Res DTO // Generate Res DTO
@@ -116,13 +120,13 @@ public class ToolScaffolder {
* @package %s.dto * @package %s.dto
* @className %sRes * @className %sRes
* @description AX HUB 시스템 처리 클래스 * @description AX HUB 시스템 처리 클래스
* @author 김형식 * @author %s
* @create 2026.09.01 * @create %s
* <pre> * <pre>
* ---------- 개정이력 ---------- * ---------- 개정이력 ----------
* 수정일 수정자 수정내용 * 수정일 수정자 수정내용
* ---------- -------- --------------------------- * ---------- -------- ---------------------------
* 2026.09.01 김형식 최초생성 * %s %s 최초생성
* *
* </pre> * </pre>
*/ */
@@ -133,7 +137,7 @@ public class ToolScaffolder {
private String message; private String message;
// TODO: Add response fields here // TODO: Add response fields here
} }
""".formatted(BASE_PACKAGE, BASE_PACKAGE, baseName, baseName); """.formatted(BASE_PACKAGE, baseName, author, createDate, createDate, author, baseName);
Files.writeString(dtoDir.resolve(baseName + "Res.java"), resContent); Files.writeString(dtoDir.resolve(baseName + "Res.java"), resContent);
String toolName = baseName.toLowerCase(); String toolName = baseName.toLowerCase();
@@ -152,13 +156,13 @@ public class ToolScaffolder {
* @package %s.service * @package %s.service
* @className %sService * @className %sService
* @description AX HUB 시스템 처리 클래스 * @description AX HUB 시스템 처리 클래스
* @author 김형식 * @author %s
* @create 2026.09.01 * @create %s
* <pre> * <pre>
* ---------- 개정이력 ---------- * ---------- 개정이력 ----------
* 수정일 수정자 수정내용 * 수정일 수정자 수정내용
* ---------- -------- --------------------------- * ---------- -------- ---------------------------
* 2026.09.01 김형식 최초생성 * %s %s 최초생성
* *
* </pre> * </pre>
*/ */
@@ -180,22 +184,10 @@ public class ToolScaffolder {
} }
} }
""".formatted( """.formatted(
BASE_PACKAGE, BASE_PACKAGE, baseName, author, createDate, createDate, author,
BASE_PACKAGE, routingType, group, baseName,
BASE_PACKAGE, toolName, description, description + " 해줘.", interfaceId,
BASE_PACKAGE, baseName, baseName, routingType, interfaceId
BASE_PACKAGE, baseName,
BASE_PACKAGE, baseName,
routingType,
group,
baseName,
toolName,
description,
description + " 해줘.",
interfaceId,
baseName,
routingType,
interfaceId
); );
Files.writeString(serviceDir.resolve(baseName + "Service.java"), serviceContent); Files.writeString(serviceDir.resolve(baseName + "Service.java"), serviceContent);

View File

@@ -95,5 +95,12 @@
"address": "서울특별시 중구 세종대로 9", "address": "서울특별시 중구 세종대로 9",
"phoneNumber": "010-XXXX-XXXX" "phoneNumber": "010-XXXX-XXXX"
} }
},
"PAY_001": {
"status": "SUCCESS",
"message": "결제가 성공적으로 승인되었습니다.",
"data": {
"processStatus": "COMPLETED"
}
} }
} }

View File

@@ -1,10 +1,4 @@
server.port=8084
spring.application.name=axhub-tool-other
spring.profiles.active=local spring.profiles.active=local
# Suppress Kafka Connection Logs
logging.level.org.apache.kafka=ERROR
# Auto Prefix Namespace # Auto Prefix Namespace
mcp.namespace=other mcp.namespace=payment