From d1b4fa6275f17dd13c6468846c8b34f5e7e39d81 Mon Sep 17 00:00:00 2001 From: jade Date: Mon, 13 Jul 2026 11:33:05 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20ToolScaffolder=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=9E=85=EB=A0=A5=EB=B0=9B=EC=9D=80=20baseName=EC=9D=84=20Pasc?= =?UTF-8?q?alCase=EB=A1=9C=20=EA=B0=95=EC=A0=9C=20=EB=B3=80=ED=99=98?= =?UTF-8?q?=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95=20=EB=B0=8F=20?= =?UTF-8?q?HrTest=20=ED=8C=8C=EC=9D=BC=20=EC=9E=AC=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../axhub/common/util/ToolScaffolder.java | 23 ++++++++++ .../dto/{hr_testReq.java => HrTestReq.java} | 8 ++-- .../dto/{hr_testRes.java => HrTestRes.java} | 8 ++-- .../biz/mcp/tool/hr/mapper/HrMciMapper.java | 17 ++++++++ .../biz/mcp/tool/service/HrTestService.java | 42 +++++++++++++++++++ .../biz/mcp/tool/service/hr_testService.java | 42 ------------------- 6 files changed, 90 insertions(+), 50 deletions(-) rename axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/dto/{hr_testReq.java => HrTestReq.java} (82%) rename axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/dto/{hr_testRes.java => HrTestRes.java} (83%) create mode 100644 axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/hr/mapper/HrMciMapper.java create mode 100644 axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/service/HrTestService.java delete mode 100644 axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/service/hr_testService.java diff --git a/axhub-common/src/main/java/io/shinhanlife/axhub/common/util/ToolScaffolder.java b/axhub-common/src/main/java/io/shinhanlife/axhub/common/util/ToolScaffolder.java index 847552d..a5ccd14 100644 --- a/axhub-common/src/main/java/io/shinhanlife/axhub/common/util/ToolScaffolder.java +++ b/axhub-common/src/main/java/io/shinhanlife/axhub/common/util/ToolScaffolder.java @@ -81,6 +81,7 @@ public class ToolScaffolder { } public static String scaffold(String baseName, String interfaceId, String description, String group, String routingType, String moduleName, String author, String createDate, boolean register) throws IOException { + baseName = toPascalCase(baseName); String envSourceDir = System.getenv("AXHUB_SOURCE_DIR"); Path rootDir = envSourceDir != null ? Paths.get(envSourceDir) : Paths.get("."); @@ -224,4 +225,26 @@ public class ToolScaffolder { return log.toString(); } + + private static String toPascalCase(String str) { + if (str == null || str.isEmpty()) { + return str; + } + StringBuilder result = new StringBuilder(); + boolean capitalizeNext = true; + for (char c : str.toCharArray()) { + if (c == '_' || c == '-' || c == ' ') { + capitalizeNext = true; + } else if (capitalizeNext) { + result.append(Character.toUpperCase(c)); + capitalizeNext = false; + } else { + result.append(c); + } + } + if (result.length() > 0) { + result.setCharAt(0, Character.toUpperCase(result.charAt(0))); + } + return result.toString(); + } } \ No newline at end of file diff --git a/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/dto/hr_testReq.java b/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/dto/HrTestReq.java similarity index 82% rename from axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/dto/hr_testReq.java rename to axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/dto/HrTestReq.java index ac1730f..8770b0b 100644 --- a/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/dto/hr_testReq.java +++ b/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/dto/HrTestReq.java @@ -5,20 +5,20 @@ import lombok.Data; /** * @package io.shinhanlife.axhub.biz.mcp.tool.dto - * @className hr_testReq + * @className HrTestReq * @description AX HUB 시스템 처리 클래스 - * @author root + * @author system * @create 2026.07.13 *
  * ---------- 개정이력 ----------
  * 수정일      수정자    수정내용
  * ---------- -------- ---------------------------
- * 2026.07.13  root    최초생성
+ * 2026.07.13  system    최초생성
  *
  * 
*/ @Data @JsonInclude(JsonInclude.Include.NON_NULL) -public class hr_testReq { +public class HrTestReq { // TODO: Add request fields here } diff --git a/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/dto/hr_testRes.java b/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/dto/HrTestRes.java similarity index 83% rename from axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/dto/hr_testRes.java rename to axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/dto/HrTestRes.java index 0f310d2..3ab0fa0 100644 --- a/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/dto/hr_testRes.java +++ b/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/dto/HrTestRes.java @@ -5,21 +5,21 @@ import lombok.Data; /** * @package io.shinhanlife.axhub.biz.mcp.tool.dto - * @className hr_testRes + * @className HrTestRes * @description AX HUB 시스템 처리 클래스 - * @author root + * @author system * @create 2026.07.13 *
  * ---------- 개정이력 ----------
  * 수정일      수정자    수정내용
  * ---------- -------- ---------------------------
- * 2026.07.13  root    최초생성
+ * 2026.07.13  system    최초생성
  *
  * 
*/ @Data @JsonInclude(JsonInclude.Include.NON_NULL) -public class hr_testRes { +public class HrTestRes { private String status; private String message; // TODO: Add response fields here diff --git a/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/hr/mapper/HrMciMapper.java b/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/hr/mapper/HrMciMapper.java new file mode 100644 index 0000000..1646411 --- /dev/null +++ b/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/hr/mapper/HrMciMapper.java @@ -0,0 +1,17 @@ +package io.shinhanlife.axhub.biz.mcp.tool.hr.mapper; + +import io.shinhanlife.axhub.biz.mcp.tool.dto.SmsSendReq; +import io.shinhanlife.axhub.biz.mcp.tool.sms.dto.SmsMciReqDto; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper(componentModel = "spring") +public interface HrMciMapper { + + HrMciMapper INSTANCE = Mappers.getMapper(HrMciMapper.class); + + @Mapping(source = "phoneNumber", target = "phone") + @Mapping(source = "message", target = "content") + SmsMciReqDto toMciReq(SmsSendReq req); +} diff --git a/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/service/HrTestService.java b/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/service/HrTestService.java new file mode 100644 index 0000000..707df19 --- /dev/null +++ b/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/service/HrTestService.java @@ -0,0 +1,42 @@ +package io.shinhanlife.axhub.biz.mcp.tool.service; + +import io.shinhanlife.axhub.biz.mcp.tool.annotation.McpFunction; +import io.shinhanlife.axhub.biz.mcp.tool.annotation.McpTool; +import io.shinhanlife.axhub.biz.mcp.tool.dto.HrTestReq; +import io.shinhanlife.axhub.biz.mcp.tool.dto.HrTestRes; +import org.springframework.stereotype.Service; + +/** + * @package io.shinhanlife.axhub.biz.mcp.tool.service + * @className HrTestService + * @description AX HUB 시스템 처리 클래스 + * @author system + * @create 2026.07.13 + *
+ * ---------- 개정이력 ----------
+ * 수정일      수정자    수정내용
+ * ---------- -------- ---------------------------
+ * 2026.07.13  system    최초생성
+ *
+ * 
+ */ +@Service +@McpTool( + routingType = "HTTP", + categoryKey = "hr" +) +public class HrTestService extends AbstractMcpToolService { + + @McpFunction( + displayName = "HrTest 툴", + name = "hrtest", + description = "인사 테스트", + prompt = "인사 테스트 해줘.", + mappingId = "HR_TEST", + register = true, + requiresApproval = false + ) + public Object execute(HrTestReq req) { + return executeLegacy("HTTP", "HR_TEST", req); + } +} diff --git a/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/service/hr_testService.java b/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/service/hr_testService.java deleted file mode 100644 index 1633821..0000000 --- a/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/service/hr_testService.java +++ /dev/null @@ -1,42 +0,0 @@ -package io.shinhanlife.axhub.biz.mcp.tool.service; - -import io.shinhanlife.axhub.biz.mcp.tool.annotation.McpFunction; -import io.shinhanlife.axhub.biz.mcp.tool.annotation.McpTool; -import io.shinhanlife.axhub.biz.mcp.tool.dto.hr_testReq; -import io.shinhanlife.axhub.biz.mcp.tool.dto.hr_testRes; -import org.springframework.stereotype.Service; - -/** - * @package io.shinhanlife.axhub.biz.mcp.tool.service - * @className hr_testService - * @description AX HUB 시스템 처리 클래스 - * @author root - * @create 2026.07.13 - *
- * ---------- 개정이력 ----------
- * 수정일      수정자    수정내용
- * ---------- -------- ---------------------------
- * 2026.07.13  root    최초생성
- *
- * 
- */ -@Service -@McpTool( - routingType = "MCI", - categoryKey = "common" -) -public class hr_testService extends AbstractMcpToolService { - - @McpFunction( - displayName = "hr_test 툴", - name = "hr_test", - description = "hr 조회 합니다.", - prompt = "hr 조회 합니다. 해줘.", - mappingId = "HR_001", - register = false, - requiresApproval = false - ) - public Object execute(hr_testReq req) { - return executeLegacy("MCI", "HR_001", req); - } -}