From da314fbe65c9cd63848fae203745fa958f9bf85b Mon Sep 17 00:00:00 2001 From: jade Date: Mon, 13 Jul 2026 11:45:05 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20SearchHr=20=ED=88=B4=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EB=B0=8F=20categoryKey=20=EB=B2=84=EA=B7=B8=20?= =?UTF-8?q?=ED=95=AB=ED=94=BD=EC=8A=A4=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/ScaffoldingController.java | 4 +- axhub-tool-hr/Dockerfile | 4 ++ axhub-tool-hr/build.gradle | 10 +++++ .../axhub/biz/mcp/tool/dto/SearchHrReq.java | 24 +++++++++++ .../axhub/biz/mcp/tool/dto/SearchHrRes.java | 26 ++++++++++++ .../biz/mcp/tool/hr/HrToolApplication.java | 28 +++++++++++++ .../biz/mcp/tool/service/SearchHrService.java | 42 +++++++++++++++++++ .../resources/application-local.properties | 30 +++++++++++++ .../src/main/resources/application-local.yml | 12 ++++++ .../src/main/resources/application.properties | 2 + .../src/main/resources/logback-spring.xml | 24 +++++++++++ docker-compose.yml | 21 ++++++++++ 12 files changed, 225 insertions(+), 2 deletions(-) create mode 100644 axhub-tool-hr/Dockerfile create mode 100644 axhub-tool-hr/build.gradle create mode 100644 axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/dto/SearchHrReq.java create mode 100644 axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/dto/SearchHrRes.java create mode 100644 axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/hr/HrToolApplication.java create mode 100644 axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/service/SearchHrService.java create mode 100644 axhub-tool-hr/src/main/resources/application-local.properties create mode 100644 axhub-tool-hr/src/main/resources/application-local.yml create mode 100644 axhub-tool-hr/src/main/resources/application.properties create mode 100644 axhub-tool-hr/src/main/resources/logback-spring.xml diff --git a/axhub-gateway/src/main/java/io/shinhanlife/axhub/biz/mcp/gateway/presentation/ScaffoldingController.java b/axhub-gateway/src/main/java/io/shinhanlife/axhub/biz/mcp/gateway/presentation/ScaffoldingController.java index d781ea0..65094d4 100644 --- a/axhub-gateway/src/main/java/io/shinhanlife/axhub/biz/mcp/gateway/presentation/ScaffoldingController.java +++ b/axhub-gateway/src/main/java/io/shinhanlife/axhub/biz/mcp/gateway/presentation/ScaffoldingController.java @@ -37,7 +37,7 @@ public class ScaffoldingController { String baseName = req.get("baseName"); String interfaceId = req.get("interfaceId"); String description = req.get("description"); - String group = req.getOrDefault("group", "COMMON"); + String group = req.getOrDefault("categoryKey", req.getOrDefault("group", "COMMON")); String routingType = req.getOrDefault("routingType", "HTTP"); String moduleName = req.getOrDefault("moduleName", "axhub-tool-other"); String author = req.get("author"); @@ -56,7 +56,7 @@ public class ScaffoldingController { public String updateTool(@RequestBody Map req) { try { String toolName = req.get("toolName"); - String domainGroup = req.get("domainGroup"); + String domainGroup = req.getOrDefault("categoryKey", req.get("domainGroup")); String description = req.get("description"); boolean register = Boolean.parseBoolean(req.getOrDefault("register", "true")); Boolean requiresApproval = req.containsKey("requiresApproval") ? Boolean.parseBoolean(req.get("requiresApproval")) : null; diff --git a/axhub-tool-hr/Dockerfile b/axhub-tool-hr/Dockerfile new file mode 100644 index 0000000..3343e67 --- /dev/null +++ b/axhub-tool-hr/Dockerfile @@ -0,0 +1,4 @@ +FROM eclipse-temurin:21-jdk-alpine +WORKDIR /app +COPY build/libs/axhub-tool-hr-0.0.1-SNAPSHOT.jar app.jar +ENTRYPOINT ["java", "-jar", "app.jar"] diff --git a/axhub-tool-hr/build.gradle b/axhub-tool-hr/build.gradle new file mode 100644 index 0000000..997adcb --- /dev/null +++ b/axhub-tool-hr/build.gradle @@ -0,0 +1,10 @@ +plugins { + id 'org.springframework.boot' +} +dependencies { + implementation project(':axhub-tool-core') +} +dependencies { + compileOnly 'org.projectlombok:lombok:1.18.32' + annotationProcessor 'org.projectlombok:lombok:1.18.32' +} diff --git a/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/dto/SearchHrReq.java b/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/dto/SearchHrReq.java new file mode 100644 index 0000000..4ee67d6 --- /dev/null +++ b/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/dto/SearchHrReq.java @@ -0,0 +1,24 @@ +package io.shinhanlife.axhub.biz.mcp.tool.dto; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +/** + * @package io.shinhanlife.axhub.biz.mcp.tool.dto + * @className SearchHrReq + * @description AX HUB 시스템 처리 클래스 + * @author root + * @create 2026.07.13 + *
+ * ---------- 개정이력 ----------
+ * 수정일      수정자    수정내용
+ * ---------- -------- ---------------------------
+ * 2026.07.13  root    최초생성
+ *
+ * 
+ */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +public class SearchHrReq { + // TODO: Add request fields here +} diff --git a/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/dto/SearchHrRes.java b/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/dto/SearchHrRes.java new file mode 100644 index 0000000..0f663cd --- /dev/null +++ b/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/dto/SearchHrRes.java @@ -0,0 +1,26 @@ +package io.shinhanlife.axhub.biz.mcp.tool.dto; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +/** + * @package io.shinhanlife.axhub.biz.mcp.tool.dto + * @className SearchHrRes + * @description AX HUB 시스템 처리 클래스 + * @author root + * @create 2026.07.13 + *
+ * ---------- 개정이력 ----------
+ * 수정일      수정자    수정내용
+ * ---------- -------- ---------------------------
+ * 2026.07.13  root    최초생성
+ *
+ * 
+ */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +public class SearchHrRes { + 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/HrToolApplication.java b/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/hr/HrToolApplication.java new file mode 100644 index 0000000..d3da00b --- /dev/null +++ b/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/hr/HrToolApplication.java @@ -0,0 +1,28 @@ +package io.shinhanlife.axhub.biz.mcp.tool.hr; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cache.annotation.EnableCaching; + +/** + * @package io.shinhanlife.axhub.biz.mcp.tool.hr + * @className HrToolApplication + * @description AX HUB 시스템 처리 클래스 + * @author root + * @create 2026.07.13 + *
+ * ---------- 개정이력 ----------
+ * 수정일      수정자    수정내용
+ * ---------- -------- ---------------------------
+ * 2026.07.13  root    최초생성
+ *
+ * 
+ */ +@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"}) +@EnableCaching +public class HrToolApplication { + public static void main(String[] args) { + SpringApplication.run(HrToolApplication.class, args); + } +} diff --git a/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/service/SearchHrService.java b/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/service/SearchHrService.java new file mode 100644 index 0000000..e0bbb23 --- /dev/null +++ b/axhub-tool-hr/src/main/java/io/shinhanlife/axhub/biz/mcp/tool/service/SearchHrService.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.SearchHrReq; +import io.shinhanlife.axhub.biz.mcp.tool.dto.SearchHrRes; +import org.springframework.stereotype.Service; + +/** + * @package io.shinhanlife.axhub.biz.mcp.tool.service + * @className SearchHrService + * @description AX HUB 시스템 처리 클래스 + * @author root + * @create 2026.07.13 + *
+ * ---------- 개정이력 ----------
+ * 수정일      수정자    수정내용
+ * ---------- -------- ---------------------------
+ * 2026.07.13  root    최초생성
+ *
+ * 
+ */ +@Service +@McpTool( + routingType = "MCI", + categoryKey = "hr" +) +public class SearchHrService extends AbstractMcpToolService { + + @McpFunction( + displayName = "SearchHr 툴", + name = "SearchHr", + description = "HR 을 조회 합니다.", + prompt = "HR 을 조회 합니다. 해줘.", + mappingId = "SEARCH_HR_001", + register = false, + requiresApproval = false + ) + public Object execute(SearchHrReq req) { + return executeLegacy("MCI", "SEARCH_HR_001", req); + } +} diff --git a/axhub-tool-hr/src/main/resources/application-local.properties b/axhub-tool-hr/src/main/resources/application-local.properties new file mode 100644 index 0000000..16a2930 --- /dev/null +++ b/axhub-tool-hr/src/main/resources/application-local.properties @@ -0,0 +1,30 @@ +# Local 환경 전용 설정 (H2 메모리 DB 등) +spring.datasource.url=jdbc:p6spy:h2:mem:testdb;DB_CLOSE_DELAY=-1; +spring.datasource.driverClassName=com.p6spy.engine.spy.P6SpyDriver +spring.datasource.username=sa +spring.datasource.password=password + +spring.h2.console.enabled=true +# EIMS 동적 라우팅 접속 정보 +eims.http.url=http://localhost:${server.port}/api/gateway +eims.tcp.host=127.0.0.1 +eims.tcp.port=8090 +eims.tcp.timeout=5000 +eims.jsp.form.url=http://localhost:${server.port}/mock/jsp-form +eims.jsp.json.url=http://localhost:${server.port}/mock/jsp-json +eims.mci.url=http://localhost:${server.port}/api/mock/esb/api +eims.mcistring.url=http://localhost:${server.port}/api/mock/esb/string + +# API 보안 키 설정 + mcp.security.tenant-domains.mcp-client-1=CUSTOMER,COMMON +mcp.security.tenant-domains.mcp-client-2=ALL + +# Gateway/Tool URLs +axhub.gateway.url=http://localhost:8081 +axhub.tool.url=http://localhost:${server.port} + +# Disable Kafka +spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration + +# Suppress Kafka Connection Logs +logging.level.org.apache.kafka=ERROR diff --git a/axhub-tool-hr/src/main/resources/application-local.yml b/axhub-tool-hr/src/main/resources/application-local.yml new file mode 100644 index 0000000..2c12d7c --- /dev/null +++ b/axhub-tool-hr/src/main/resources/application-local.yml @@ -0,0 +1,12 @@ +spring: + application: + name: axhub-tool-hr + config: + import: "classpath:config/application-glow-local.yml" + +server: + port: 8086 + +axhub: + tool: + url: "http://tool-hr:8086" diff --git a/axhub-tool-hr/src/main/resources/application.properties b/axhub-tool-hr/src/main/resources/application.properties new file mode 100644 index 0000000..1a4d891 --- /dev/null +++ b/axhub-tool-hr/src/main/resources/application.properties @@ -0,0 +1,2 @@ +spring.profiles.active=local +mcp.namespace=hr diff --git a/axhub-tool-hr/src/main/resources/logback-spring.xml b/axhub-tool-hr/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..43481e9 --- /dev/null +++ b/axhub-tool-hr/src/main/resources/logback-spring.xml @@ -0,0 +1,24 @@ + + + + + + ${LOG_PATTERN} + + + + logs/axhub-tool-hr.log + + logs/axhub-tool-hr-%d{yyyy-MM-dd}.log + 30 + + + ${LOG_PATTERN} + + + + + + + + diff --git a/docker-compose.yml b/docker-compose.yml index 2e09083..2895e2e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -110,3 +110,24 @@ services: - GLOW_COMMUNICATION_EAI_HOST=tcp://gateway - GLOW_COMMUNICATION_EAI_PORT=8081 + + tool-hr: + build: + context: ./axhub-tool-hr + ports: + - "8086:8086" + depends_on: + - redis + environment: + - TZ=Asia/Seoul + - SPRING_REDIS_HOST=redis + - SPRING_REDIS_PORT=6379 + - SPRING_DATA_REDIS_PORT=6379 + - AXHUB_GATEWAY_URL=http://gateway:8081 + - AXHUB_TOOL_URL=http://tool-hr:8086 + - GLOW_COMMUNICATION_MCI_HOST=http://gateway + - GLOW_COMMUNICATION_MCI_PORT=8081 + - GLOW_COMMUNICATION_EXTMCI_HOST=http://gateway + - GLOW_COMMUNICATION_EXTMCI_PORT=8081 + - GLOW_COMMUNICATION_EAI_HOST=tcp://gateway + - GLOW_COMMUNICATION_EAI_PORT=8081