feat: SearchHr 툴 추가 및 categoryKey 버그 핫픽스 적용

This commit is contained in:
jade
2026-07-13 11:45:05 +09:00
parent e140b3d4d4
commit da314fbe65
12 changed files with 225 additions and 2 deletions

View File

@@ -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<String, String> 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;

4
axhub-tool-hr/Dockerfile Normal file
View File

@@ -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"]

View File

@@ -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'
}

View File

@@ -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
* <pre>
* ---------- 개정이력 ----------
* 수정일 수정자 수정내용
* ---------- -------- ---------------------------
* 2026.07.13 root 최초생성
*
* </pre>
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SearchHrReq {
// TODO: Add request fields here
}

View File

@@ -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
* <pre>
* ---------- 개정이력 ----------
* 수정일 수정자 수정내용
* ---------- -------- ---------------------------
* 2026.07.13 root 최초생성
*
* </pre>
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SearchHrRes {
private String status;
private String message;
// TODO: Add response fields here
}

View File

@@ -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
* <pre>
* ---------- 개정이력 ----------
* 수정일 수정자 수정내용
* ---------- -------- ---------------------------
* 2026.07.13 root 최초생성
*
* </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"})
@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);
}
}

View File

@@ -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
* <pre>
* ---------- 개정이력 ----------
* 수정일 수정자 수정내용
* ---------- -------- ---------------------------
* 2026.07.13 root 최초생성
*
* </pre>
*/
@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);
}
}

View File

@@ -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

View File

@@ -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"

View File

@@ -0,0 +1,2 @@
spring.profiles.active=local
mcp.namespace=hr

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property name="LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId}] %-5level %logger{36} - %msg%n" />
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>logs/axhub-tool-hr.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>logs/axhub-tool-hr-%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="CONSOLE" />
<appender-ref ref="FILE" />
</root>
<logger name="io.shinhanlife" level="DEBUG" />
</configuration>

View File

@@ -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