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:
@@ -477,7 +477,6 @@
|
|||||||
<option value="HTTP">HTTP (REST)</option>
|
<option value="HTTP">HTTP (REST)</option>
|
||||||
<option value="TCP">TCP (Socket)</option>
|
<option value="TCP">TCP (Socket)</option>
|
||||||
<option value="MCI">MCI (Legacy)</option>
|
<option value="MCI">MCI (Legacy)</option>
|
||||||
<option value="EAI">EAI (Internal)</option>
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -497,8 +496,7 @@
|
|||||||
<div class="col-md-6 mt-3 mt-md-0">
|
<div class="col-md-6 mt-3 mt-md-0">
|
||||||
<label class="form-label">Gateway Registration</label>
|
<label class="form-label">Gateway Registration</label>
|
||||||
<select class="form-select" name="register">
|
<select class="form-select" name="register">
|
||||||
<option value="true">True (Public)</option>
|
<option value="false" selected>False (Private)</option>
|
||||||
<option value="false">False (Private)</option>
|
|
||||||
</select>
|
</select>
|
||||||
<div class="input-hint">Controls dynamic routing exposure.</div>
|
<div class="input-hint">Controls dynamic routing exposure.</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -86,12 +86,14 @@ public class ToolScaffolder {
|
|||||||
Path rootDir = envSourceDir != null ? Paths.get(envSourceDir) : Paths.get(".");
|
Path rootDir = envSourceDir != null ? Paths.get(envSourceDir) : Paths.get(".");
|
||||||
|
|
||||||
Path serviceDir = rootDir.resolve(Paths.get(moduleName, BASE_PACKAGE_PATH, "service"));
|
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 dtoDir = rootDir.resolve(Paths.get(moduleName, BASE_PACKAGE_PATH, "dto"));
|
||||||
|
|
||||||
Path legacyDtoDir = rootDir.resolve(Paths.get(moduleName, BASE_PACKAGE_PATH, "legacy"));
|
Path legacyDtoDir = rootDir.resolve(Paths.get(moduleName, BASE_PACKAGE_PATH, "legacy"));
|
||||||
Path converterDir = rootDir.resolve(Paths.get(moduleName, BASE_PACKAGE_PATH, "converter"));
|
Path converterDir = rootDir.resolve(Paths.get(moduleName, BASE_PACKAGE_PATH, "converter"));
|
||||||
|
|
||||||
Files.createDirectories(serviceDir);
|
Files.createDirectories(serviceDir);
|
||||||
|
Files.createDirectories(serviceImplDir);
|
||||||
Files.createDirectories(dtoDir);
|
Files.createDirectories(dtoDir);
|
||||||
Files.createDirectories(legacyDtoDir);
|
Files.createDirectories(legacyDtoDir);
|
||||||
Files.createDirectories(converterDir);
|
Files.createDirectories(converterDir);
|
||||||
@@ -165,17 +167,30 @@ public class ToolScaffolder {
|
|||||||
|
|
||||||
String toolName = baseName.isEmpty() ? baseName : Character.toLowerCase(baseName.charAt(0)) + baseName.substring(1);
|
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);
|
boolean isMci = "MCI".equalsIgnoreCase(routingType);
|
||||||
String serviceContent;
|
String serviceImplContent;
|
||||||
|
|
||||||
if (isMci) {
|
if (isMci) {
|
||||||
serviceContent = """
|
serviceImplContent = """
|
||||||
package %s.service;
|
package %s.service.impl;
|
||||||
|
|
||||||
import %s.annotation.McpFunction;
|
import %s.annotation.McpFunction;
|
||||||
import %s.annotation.McpTool;
|
import %s.annotation.McpTool;
|
||||||
import %s.dto.%sReq;
|
import %s.dto.%sReq;
|
||||||
import %s.dto.%sRes;
|
import %s.dto.%sRes;
|
||||||
|
import %s.service.%sService;
|
||||||
import io.shinhanlife.dap.common.integration.mci.component.AxhubMciComponent;
|
import io.shinhanlife.dap.common.integration.mci.component.AxhubMciComponent;
|
||||||
import io.shinhanlife.glow.communication.dto.Transfer;
|
import io.shinhanlife.glow.communication.dto.Transfer;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -186,8 +201,8 @@ public class ToolScaffolder {
|
|||||||
import %s.legacy.%sLegacyReq;
|
import %s.legacy.%sLegacyReq;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @package %s.service
|
* @package %s.service.impl
|
||||||
* @className %sService
|
* @className %sServiceImpl
|
||||||
* @description AX HUB 시스템 처리 클래스
|
* @description AX HUB 시스템 처리 클래스
|
||||||
* @author %s
|
* @author %s
|
||||||
* @create %s
|
* @create %s
|
||||||
@@ -206,11 +221,12 @@ public class ToolScaffolder {
|
|||||||
routingType = "%s",
|
routingType = "%s",
|
||||||
categoryKey = "%s"
|
categoryKey = "%s"
|
||||||
)
|
)
|
||||||
public class %sService {
|
public class %sServiceImpl implements %sService {
|
||||||
|
|
||||||
private final AxhubMciComponent mci;
|
private final AxhubMciComponent mci;
|
||||||
private final %sLegacyConverter converter;
|
private final %sLegacyConverter converter;
|
||||||
|
|
||||||
|
@Override
|
||||||
@McpFunction(
|
@McpFunction(
|
||||||
displayName = "%s 툴",
|
displayName = "%s 툴",
|
||||||
name = "%s",
|
name = "%s",
|
||||||
@@ -249,11 +265,12 @@ public class ToolScaffolder {
|
|||||||
BASE_PACKAGE, baseName,
|
BASE_PACKAGE, baseName,
|
||||||
BASE_PACKAGE, baseName,
|
BASE_PACKAGE, baseName,
|
||||||
BASE_PACKAGE, baseName,
|
BASE_PACKAGE, baseName,
|
||||||
|
BASE_PACKAGE, baseName,
|
||||||
author,
|
author,
|
||||||
createDate,
|
createDate,
|
||||||
createDate, author,
|
createDate, author,
|
||||||
routingType, group.toLowerCase(),
|
routingType, group.toLowerCase(),
|
||||||
baseName,
|
baseName, baseName,
|
||||||
baseName,
|
baseName,
|
||||||
baseName, toolName, description, description + " 해줘.", interfaceId, register,
|
baseName, toolName, description, description + " 해줘.", interfaceId, register,
|
||||||
baseName,
|
baseName,
|
||||||
@@ -262,19 +279,23 @@ public class ToolScaffolder {
|
|||||||
interfaceId
|
interfaceId
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
serviceContent = """
|
serviceImplContent = """
|
||||||
package %s.service;
|
package %s.service.impl;
|
||||||
|
|
||||||
import %s.annotation.McpFunction;
|
import %s.annotation.McpFunction;
|
||||||
import %s.annotation.McpTool;
|
import %s.annotation.McpTool;
|
||||||
import %s.dto.%sReq;
|
import %s.dto.%sReq;
|
||||||
import %s.dto.%sRes;
|
import %s.dto.%sRes;
|
||||||
|
import %s.service.%sService;
|
||||||
|
import %s.service.AbstractMcpToolService;
|
||||||
import %s.converter.%sLegacyConverter;
|
import %s.converter.%sLegacyConverter;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @package %s.service
|
* @package %s.service.impl
|
||||||
* @className %sService
|
* @className %sServiceImpl
|
||||||
* @description AX HUB 시스템 처리 클래스
|
* @description AX HUB 시스템 처리 클래스
|
||||||
* @author %s
|
* @author %s
|
||||||
* @create %s
|
* @create %s
|
||||||
@@ -286,16 +307,18 @@ public class ToolScaffolder {
|
|||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
@McpTool(
|
@McpTool(
|
||||||
routingType = "%s",
|
routingType = "%s",
|
||||||
categoryKey = "%s"
|
categoryKey = "%s"
|
||||||
)
|
)
|
||||||
@RequiredArgsConstructor
|
public class %sServiceImpl extends AbstractMcpToolService implements %sService {
|
||||||
public class %sService extends AbstractMcpToolService {
|
|
||||||
|
|
||||||
private final %sLegacyConverter converter;
|
private final %sLegacyConverter converter;
|
||||||
|
|
||||||
|
@Override
|
||||||
@McpFunction(
|
@McpFunction(
|
||||||
displayName = "%s 툴",
|
displayName = "%s 툴",
|
||||||
name = "%s",
|
name = "%s",
|
||||||
@@ -317,12 +340,13 @@ public class ToolScaffolder {
|
|||||||
BASE_PACKAGE, baseName,
|
BASE_PACKAGE, baseName,
|
||||||
BASE_PACKAGE, baseName,
|
BASE_PACKAGE, baseName,
|
||||||
BASE_PACKAGE, baseName,
|
BASE_PACKAGE, baseName,
|
||||||
|
BASE_PACKAGE,
|
||||||
BASE_PACKAGE, baseName,
|
BASE_PACKAGE, baseName,
|
||||||
author,
|
author,
|
||||||
createDate,
|
createDate,
|
||||||
createDate, author,
|
createDate, author,
|
||||||
routingType, group.toLowerCase(),
|
routingType, group.toLowerCase(),
|
||||||
baseName,
|
baseName, baseName,
|
||||||
baseName,
|
baseName,
|
||||||
baseName, toolName, description, description + " 해줘.", interfaceId, register,
|
baseName, toolName, description, description + " 해줘.", interfaceId, register,
|
||||||
baseName,
|
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 = """
|
String legacyReqContent = """
|
||||||
package %s.legacy;
|
package %s.legacy;
|
||||||
@@ -445,7 +469,8 @@ public class ToolScaffolder {
|
|||||||
log.append("\n=========================================\n");
|
log.append("\n=========================================\n");
|
||||||
log.append(" Scaffolding Complete! (Routing: " + routingType + ")\n");
|
log.append(" Scaffolding Complete! (Routing: " + routingType + ")\n");
|
||||||
log.append("=========================================\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("[Req DTO] ").append(dtoDir.resolve(baseName + "Req.java")).append("\n");
|
||||||
log.append("[Res DTO] ").append(dtoDir.resolve(baseName + "Res.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");
|
log.append("[Legacy Req DTO] ").append(legacyDtoDir.resolve(baseName + "LegacyReq.java")).append("\n");
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ services:
|
|||||||
mci-mock:
|
mci-mock:
|
||||||
image: wiremock/wiremock:latest
|
image: wiremock/wiremock:latest
|
||||||
ports:
|
ports:
|
||||||
- "8089:8080"
|
- "18089:8080"
|
||||||
volumes:
|
volumes:
|
||||||
- ./mci-mock:/home/wiremock
|
- ./mci-mock:/home/wiremock
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user