forked from kimhyungsik/ax_hub_mcp_tool
refactor: Move balance tool classes to standard package structure (Package-by-Layer)
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
package io.shinhanlife.axhub.biz.mcp.tool.balance.dto;
|
package io.shinhanlife.axhub.biz.mcp.tool.dto;
|
||||||
|
|
||||||
import io.shinhanlife.axhub.biz.mcp.tool.annotation.McpParameter;
|
import io.shinhanlife.axhub.biz.mcp.tool.annotation.McpParameter;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package io.shinhanlife.axhub.biz.mcp.tool.balance.dto;
|
package io.shinhanlife.axhub.biz.mcp.tool.dto;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package io.shinhanlife.axhub.biz.mcp.tool.balance.service;
|
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.McpFunction;
|
||||||
import io.shinhanlife.axhub.biz.mcp.tool.annotation.McpTool;
|
import io.shinhanlife.axhub.biz.mcp.tool.annotation.McpTool;
|
||||||
import io.shinhanlife.axhub.biz.mcp.tool.balance.dto.BalanceReq;
|
import io.shinhanlife.axhub.biz.mcp.tool.dto.BalanceReq;
|
||||||
import io.shinhanlife.axhub.biz.mcp.tool.service.AbstractMcpToolService;
|
import io.shinhanlife.axhub.biz.mcp.tool.service.AbstractMcpToolService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
17
disable_kafka.py
Normal file
17
disable_kafka.py
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
for root, _, files in os.walk('.'):
|
||||||
|
for f in files:
|
||||||
|
if f == 'application-local.properties':
|
||||||
|
p = os.path.join(root, f)
|
||||||
|
try:
|
||||||
|
content = open(p, encoding='utf-8').read()
|
||||||
|
except Exception:
|
||||||
|
content = open(p, encoding='cp949').read()
|
||||||
|
|
||||||
|
# Disable Kafka AutoConfiguration if not present
|
||||||
|
if 'KafkaAutoConfiguration' not in content:
|
||||||
|
content += '\n# Disable Kafka\nspring.autoconfigure.exclude=org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration\n'
|
||||||
|
|
||||||
|
with open(p, 'w', encoding='utf-8') as out:
|
||||||
|
out.write(content)
|
||||||
24
fix_mcptool.py
Normal file
24
fix_mcptool.py
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import os
|
||||||
|
import re
|
||||||
|
|
||||||
|
pattern = re.compile(r'name\s*=\s*"[^"]*",\s*description\s*=\s*"[^"]*",\s*group\s*=\s*"[^"]*",?\s*')
|
||||||
|
|
||||||
|
for root, _, files in os.walk('.'):
|
||||||
|
for f in files:
|
||||||
|
if f.endswith('.java'):
|
||||||
|
p = os.path.join(root, f)
|
||||||
|
try:
|
||||||
|
content = open(p, encoding='utf-8').read()
|
||||||
|
except Exception:
|
||||||
|
content = open(p, encoding='cp949').read()
|
||||||
|
|
||||||
|
new_content = pattern.sub('', content)
|
||||||
|
|
||||||
|
# Clean up empty parens like @McpTool()
|
||||||
|
new_content = new_content.replace('@McpTool(\n \n)', '@McpTool')
|
||||||
|
new_content = new_content.replace('@McpTool()', '@McpTool')
|
||||||
|
|
||||||
|
if content != new_content:
|
||||||
|
with open(p, 'w', encoding='utf-8') as out:
|
||||||
|
out.write(new_content)
|
||||||
|
print(f"Updated {p}")
|
||||||
16
fix_props.py
Normal file
16
fix_props.py
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
for root, _, files in os.walk('.'):
|
||||||
|
for f in files:
|
||||||
|
if f == 'application-local.properties':
|
||||||
|
p = os.path.join(root, f)
|
||||||
|
try:
|
||||||
|
content = open(p, encoding='utf-8').read()
|
||||||
|
except Exception:
|
||||||
|
content = open(p, encoding='cp949').read()
|
||||||
|
|
||||||
|
content = content.replace('localhost:/', 'localhost:${server.port}/')
|
||||||
|
content = content.replace('localhost:\n', 'localhost:${server.port}\n')
|
||||||
|
|
||||||
|
with open(p, 'w', encoding='utf-8') as out:
|
||||||
|
out.write(content)
|
||||||
17
suppress_kafka_logs.py
Normal file
17
suppress_kafka_logs.py
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
for root, _, files in os.walk('.'):
|
||||||
|
for f in files:
|
||||||
|
if f == 'application-local.properties' or f == 'application.properties':
|
||||||
|
p = os.path.join(root, f)
|
||||||
|
try:
|
||||||
|
content = open(p, encoding='utf-8').read()
|
||||||
|
except Exception:
|
||||||
|
content = open(p, encoding='cp949').read()
|
||||||
|
|
||||||
|
# Add logging level to suppress kafka warnings
|
||||||
|
if 'logging.level.org.apache.kafka' not in content:
|
||||||
|
content += '\n# Suppress Kafka Connection Logs\nlogging.level.org.apache.kafka=ERROR\n'
|
||||||
|
|
||||||
|
with open(p, 'w', encoding='utf-8') as out:
|
||||||
|
out.write(content)
|
||||||
Reference in New Issue
Block a user