feat/fix: update ToolScaffolder interface, update scaffold.html, fix mci-mock port
Some checks failed
Deploy to OCIWP / deploy (push) Failing after 14m20s
Some checks failed
Deploy to OCIWP / deploy (push) Failing after 14m20s
This commit is contained in:
@@ -86,12 +86,14 @@ public class ToolScaffolder {
|
||||
Path rootDir = envSourceDir != null ? Paths.get(envSourceDir) : Paths.get(".");
|
||||
|
||||
Path serviceDir = rootDir.resolve(Paths.get(moduleName, BASE_PACKAGE_PATH, "service"));
|
||||
Path serviceImplDir = serviceDir.resolve("impl");
|
||||
Path dtoDir = rootDir.resolve(Paths.get(moduleName, BASE_PACKAGE_PATH, "dto"));
|
||||
|
||||
Path legacyDtoDir = rootDir.resolve(Paths.get(moduleName, BASE_PACKAGE_PATH, "legacy"));
|
||||
Path converterDir = rootDir.resolve(Paths.get(moduleName, BASE_PACKAGE_PATH, "converter"));
|
||||
|
||||
Files.createDirectories(serviceDir);
|
||||
Files.createDirectories(serviceImplDir);
|
||||
Files.createDirectories(dtoDir);
|
||||
Files.createDirectories(legacyDtoDir);
|
||||
Files.createDirectories(converterDir);
|
||||
@@ -165,17 +167,30 @@ public class ToolScaffolder {
|
||||
|
||||
String toolName = baseName.isEmpty() ? baseName : Character.toLowerCase(baseName.charAt(0)) + baseName.substring(1);
|
||||
|
||||
String serviceInterfaceContent = """
|
||||
package %s.service;
|
||||
|
||||
import %s.dto.%sReq;
|
||||
|
||||
public interface %sService {
|
||||
Object execute(%sReq req);
|
||||
}
|
||||
""".formatted(BASE_PACKAGE, BASE_PACKAGE, baseName, baseName, baseName);
|
||||
|
||||
Files.writeString(serviceDir.resolve(baseName + "Service.java"), serviceInterfaceContent);
|
||||
|
||||
boolean isMci = "MCI".equalsIgnoreCase(routingType);
|
||||
String serviceContent;
|
||||
String serviceImplContent;
|
||||
|
||||
if (isMci) {
|
||||
serviceContent = """
|
||||
package %s.service;
|
||||
serviceImplContent = """
|
||||
package %s.service.impl;
|
||||
|
||||
import %s.annotation.McpFunction;
|
||||
import %s.annotation.McpTool;
|
||||
import %s.dto.%sReq;
|
||||
import %s.dto.%sRes;
|
||||
import %s.service.%sService;
|
||||
import io.shinhanlife.dap.common.integration.mci.component.AxhubMciComponent;
|
||||
import io.shinhanlife.glow.communication.dto.Transfer;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -186,8 +201,8 @@ public class ToolScaffolder {
|
||||
import %s.legacy.%sLegacyReq;
|
||||
|
||||
/**
|
||||
* @package %s.service
|
||||
* @className %sService
|
||||
* @package %s.service.impl
|
||||
* @className %sServiceImpl
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author %s
|
||||
* @create %s
|
||||
@@ -206,11 +221,12 @@ public class ToolScaffolder {
|
||||
routingType = "%s",
|
||||
categoryKey = "%s"
|
||||
)
|
||||
public class %sService {
|
||||
public class %sServiceImpl implements %sService {
|
||||
|
||||
private final AxhubMciComponent mci;
|
||||
private final %sLegacyConverter converter;
|
||||
|
||||
@Override
|
||||
@McpFunction(
|
||||
displayName = "%s 툴",
|
||||
name = "%s",
|
||||
@@ -249,11 +265,12 @@ public class ToolScaffolder {
|
||||
BASE_PACKAGE, baseName,
|
||||
BASE_PACKAGE, baseName,
|
||||
BASE_PACKAGE, baseName,
|
||||
BASE_PACKAGE, baseName,
|
||||
author,
|
||||
createDate,
|
||||
createDate, author,
|
||||
routingType, group.toLowerCase(),
|
||||
baseName,
|
||||
baseName, baseName,
|
||||
baseName,
|
||||
baseName, toolName, description, description + " 해줘.", interfaceId, register,
|
||||
baseName,
|
||||
@@ -262,19 +279,23 @@ public class ToolScaffolder {
|
||||
interfaceId
|
||||
);
|
||||
} else {
|
||||
serviceContent = """
|
||||
package %s.service;
|
||||
serviceImplContent = """
|
||||
package %s.service.impl;
|
||||
|
||||
import %s.annotation.McpFunction;
|
||||
import %s.annotation.McpTool;
|
||||
import %s.dto.%sReq;
|
||||
import %s.dto.%sRes;
|
||||
import %s.service.%sService;
|
||||
import %s.service.AbstractMcpToolService;
|
||||
import %s.converter.%sLegacyConverter;
|
||||
import org.springframework.stereotype.Service;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* @package %s.service
|
||||
* @className %sService
|
||||
* @package %s.service.impl
|
||||
* @className %sServiceImpl
|
||||
* @description AX HUB 시스템 처리 클래스
|
||||
* @author %s
|
||||
* @create %s
|
||||
@@ -286,16 +307,18 @@ public class ToolScaffolder {
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@McpTool(
|
||||
routingType = "%s",
|
||||
categoryKey = "%s"
|
||||
)
|
||||
@RequiredArgsConstructor
|
||||
public class %sService extends AbstractMcpToolService {
|
||||
public class %sServiceImpl extends AbstractMcpToolService implements %sService {
|
||||
|
||||
private final %sLegacyConverter converter;
|
||||
|
||||
@Override
|
||||
@McpFunction(
|
||||
displayName = "%s 툴",
|
||||
name = "%s",
|
||||
@@ -317,12 +340,13 @@ public class ToolScaffolder {
|
||||
BASE_PACKAGE, baseName,
|
||||
BASE_PACKAGE, baseName,
|
||||
BASE_PACKAGE, baseName,
|
||||
BASE_PACKAGE,
|
||||
BASE_PACKAGE, baseName,
|
||||
author,
|
||||
createDate,
|
||||
createDate, author,
|
||||
routingType, group.toLowerCase(),
|
||||
baseName,
|
||||
baseName, baseName,
|
||||
baseName,
|
||||
baseName, toolName, description, description + " 해줘.", interfaceId, register,
|
||||
baseName,
|
||||
@@ -331,7 +355,7 @@ public class ToolScaffolder {
|
||||
);
|
||||
}
|
||||
|
||||
Files.writeString(serviceDir.resolve(baseName + "Service.java"), serviceContent);
|
||||
Files.writeString(serviceImplDir.resolve(baseName + "ServiceImpl.java"), serviceImplContent);
|
||||
|
||||
String legacyReqContent = """
|
||||
package %s.legacy;
|
||||
@@ -445,7 +469,8 @@ public class ToolScaffolder {
|
||||
log.append("\n=========================================\n");
|
||||
log.append(" Scaffolding Complete! (Routing: " + routingType + ")\n");
|
||||
log.append("=========================================\n");
|
||||
log.append("[Service] ").append(serviceDir.resolve(baseName + "Service.java")).append("\n");
|
||||
log.append("[Service Interface] ").append(serviceDir.resolve(baseName + "Service.java")).append("\n");
|
||||
log.append("[Service Impl] ").append(serviceImplDir.resolve(baseName + "ServiceImpl.java")).append("\n");
|
||||
log.append("[Req DTO] ").append(dtoDir.resolve(baseName + "Req.java")).append("\n");
|
||||
log.append("[Res DTO] ").append(dtoDir.resolve(baseName + "Res.java")).append("\n");
|
||||
log.append("[Legacy Req DTO] ").append(legacyDtoDir.resolve(baseName + "LegacyReq.java")).append("\n");
|
||||
|
||||
Reference in New Issue
Block a user