style(core): enforce AGENTS.md import rules in ToolRegistryHeartbeatSender

This commit is contained in:
jade
2026-07-09 11:36:32 +09:00
parent afb2f0c2e3
commit a9b750611b

View File

@@ -24,6 +24,8 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.springframework.util.ClassUtils; import org.springframework.util.ClassUtils;
import org.springframework.aop.support.AopUtils;
import org.springframework.core.annotation.AnnotationUtils;
/** /**
* @package io.shinhanlife.axhub.biz.mcp.tool.service * @package io.shinhanlife.axhub.biz.mcp.tool.service
@@ -68,11 +70,11 @@ public class ToolRegistryHeartbeatSender {
private void scanAndBuildMetadata() { private void scanAndBuildMetadata() {
Map<String, Object> toolBeans = applicationContext.getBeansWithAnnotation(McpTool.class); Map<String, Object> toolBeans = applicationContext.getBeansWithAnnotation(McpTool.class);
for (Object bean : toolBeans.values()) { for (Object bean : toolBeans.values()) {
Class<?> targetClass = org.springframework.aop.support.AopUtils.getTargetClass(bean); Class<?> targetClass = AopUtils.getTargetClass(bean);
McpTool toolAnnotation = org.springframework.core.annotation.AnnotationUtils.findAnnotation(targetClass, McpTool.class); McpTool toolAnnotation = AnnotationUtils.findAnnotation(targetClass, McpTool.class);
for (Method method : targetClass.getDeclaredMethods()) { for (Method method : targetClass.getDeclaredMethods()) {
McpFunction functionAnnotation = org.springframework.core.annotation.AnnotationUtils.findAnnotation(method, McpFunction.class); McpFunction functionAnnotation = AnnotationUtils.findAnnotation(method, McpFunction.class);
if (functionAnnotation != null) { if (functionAnnotation != null) {
String baseName = functionAnnotation.name(); String baseName = functionAnnotation.name();
String finalName = mcpProperties.getNamespace() != null && !mcpProperties.getNamespace().isEmpty() String finalName = mcpProperties.getNamespace() != null && !mcpProperties.getNamespace().isEmpty()