fix: restore Nginx 8080 port mapping for Apache and refactor MciCfpaClient
All checks were successful
Deploy to OCIWP / deploy (push) Successful in 13m42s
All checks were successful
Deploy to OCIWP / deploy (push) Successful in 13m42s
This commit is contained in:
@@ -92,10 +92,18 @@ public class ToolScaffolder {
|
|||||||
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"));
|
||||||
|
|
||||||
|
boolean isMci = "MCI".equalsIgnoreCase(routingType);
|
||||||
|
String mciGroupPath = "infra/itrf/mci/" + group.toLowerCase();
|
||||||
|
Path mciIoDir = rootDir.resolve(Paths.get(moduleName, BASE_PACKAGE_PATH, mciGroupPath, "io"));
|
||||||
|
|
||||||
Files.createDirectories(serviceDir);
|
Files.createDirectories(serviceDir);
|
||||||
Files.createDirectories(serviceImplDir);
|
Files.createDirectories(serviceImplDir);
|
||||||
Files.createDirectories(dtoDir);
|
Files.createDirectories(dtoDir);
|
||||||
|
if (isMci) {
|
||||||
|
Files.createDirectories(mciIoDir);
|
||||||
|
} else {
|
||||||
Files.createDirectories(legacyDtoDir);
|
Files.createDirectories(legacyDtoDir);
|
||||||
|
}
|
||||||
Files.createDirectories(converterDir);
|
Files.createDirectories(converterDir);
|
||||||
|
|
||||||
StringBuilder log = new StringBuilder();
|
StringBuilder log = new StringBuilder();
|
||||||
@@ -179,7 +187,6 @@ public class ToolScaffolder {
|
|||||||
|
|
||||||
Files.writeString(serviceDir.resolve(baseName + "Service.java"), serviceInterfaceContent);
|
Files.writeString(serviceDir.resolve(baseName + "Service.java"), serviceInterfaceContent);
|
||||||
|
|
||||||
boolean isMci = "MCI".equalsIgnoreCase(routingType);
|
|
||||||
String serviceImplContent;
|
String serviceImplContent;
|
||||||
|
|
||||||
if (isMci) {
|
if (isMci) {
|
||||||
@@ -198,7 +205,7 @@ public class ToolScaffolder {
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import %s.converter.%sLegacyConverter;
|
import %s.converter.%sLegacyConverter;
|
||||||
import %s.legacy.%sLegacyRequest;
|
import %s.infra.itrf.mci.%s.io.%s_I;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @package %s.service.impl
|
* @package %s.service.impl
|
||||||
@@ -241,12 +248,12 @@ public class ToolScaffolder {
|
|||||||
log.info("[MCI Tool] {} 요청 수신.", "%s");
|
log.info("[MCI Tool] {} 요청 수신.", "%s");
|
||||||
try {
|
try {
|
||||||
// MapStruct를 이용한 자동 매핑 (AI DTO -> MCI DTO)
|
// MapStruct를 이용한 자동 매핑 (AI DTO -> MCI DTO)
|
||||||
%sLegacyRequest legacyRequest = converter.toLegacyRequest(req);
|
%s_I mciReq = converter.toLegacyRequest(req);
|
||||||
|
|
||||||
Transfer<Object> resTransfer = mci.callTo(
|
Transfer<Object> resTransfer = mci.callTo(
|
||||||
"%s",
|
"%s",
|
||||||
null,
|
null,
|
||||||
legacyRequest,
|
mciReq,
|
||||||
Object.class
|
Object.class
|
||||||
);
|
);
|
||||||
return resTransfer.getBody() != null ? resTransfer.getBody() : Map.of("status", "SUCCESS");
|
return resTransfer.getBody() != null ? resTransfer.getBody() : Map.of("status", "SUCCESS");
|
||||||
@@ -264,7 +271,7 @@ public class ToolScaffolder {
|
|||||||
BASE_PACKAGE, baseName,
|
BASE_PACKAGE, baseName,
|
||||||
BASE_PACKAGE, baseName,
|
BASE_PACKAGE, baseName,
|
||||||
BASE_PACKAGE, baseName,
|
BASE_PACKAGE, baseName,
|
||||||
BASE_PACKAGE, baseName,
|
BASE_PACKAGE, group.toLowerCase(), interfaceId,
|
||||||
BASE_PACKAGE, baseName,
|
BASE_PACKAGE, baseName,
|
||||||
author,
|
author,
|
||||||
createDate,
|
createDate,
|
||||||
@@ -274,8 +281,7 @@ public class ToolScaffolder {
|
|||||||
baseName,
|
baseName,
|
||||||
baseName, toolName, description, description + " 해줘.", interfaceId, register,
|
baseName, toolName, description, description + " 해줘.", interfaceId, register,
|
||||||
baseName,
|
baseName,
|
||||||
baseName,
|
interfaceId,
|
||||||
baseName,
|
|
||||||
interfaceId
|
interfaceId
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@@ -357,6 +363,130 @@ public class ToolScaffolder {
|
|||||||
|
|
||||||
Files.writeString(serviceImplDir.resolve(baseName + "ServiceImpl.java"), serviceImplContent);
|
Files.writeString(serviceImplDir.resolve(baseName + "ServiceImpl.java"), serviceImplContent);
|
||||||
|
|
||||||
|
if (isMci) {
|
||||||
|
String mciReqContent = """
|
||||||
|
package %s.infra.itrf.mci.%s.io;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @package %s.infra.itrf.mci.%s.io
|
||||||
|
* @className %s_I
|
||||||
|
* @description AX HUB 시스템 처리 클래스
|
||||||
|
* @author %s
|
||||||
|
* @create %s
|
||||||
|
* <pre>
|
||||||
|
* ---------- 개정이력 ----------
|
||||||
|
* 수정일 수정자 수정내용
|
||||||
|
* ---------- -------- ---------------------------
|
||||||
|
* %s %s 최초생성
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class %s_I {
|
||||||
|
/**
|
||||||
|
* EAI 시스템이 요구하는 수신자 번호 파라미터명
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EAI 시스템이 요구하는 메시지 내용 파라미터명
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
}
|
||||||
|
""".formatted(BASE_PACKAGE, group.toLowerCase(), BASE_PACKAGE, group.toLowerCase(), interfaceId, author, createDate, createDate, author, interfaceId);
|
||||||
|
Files.writeString(mciIoDir.resolve(interfaceId + "_I.java"), mciReqContent);
|
||||||
|
|
||||||
|
String mciResContent = """
|
||||||
|
package %s.infra.itrf.mci.%s.io;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @package %s.infra.itrf.mci.%s.io
|
||||||
|
* @className %s_O
|
||||||
|
* @description AX HUB 시스템 처리 클래스
|
||||||
|
* @author %s
|
||||||
|
* @create %s
|
||||||
|
* <pre>
|
||||||
|
* ---------- 개정이력 ----------
|
||||||
|
* 수정일 수정자 수정내용
|
||||||
|
* ---------- -------- ---------------------------
|
||||||
|
* %s %s 최초생성
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class %s_O {
|
||||||
|
// TODO: Add response fields here
|
||||||
|
}
|
||||||
|
""".formatted(BASE_PACKAGE, group.toLowerCase(), BASE_PACKAGE, group.toLowerCase(), interfaceId, author, createDate, createDate, author, interfaceId);
|
||||||
|
Files.writeString(mciIoDir.resolve(interfaceId + "_O.java"), mciResContent);
|
||||||
|
|
||||||
|
String converterContent = """
|
||||||
|
package %s.converter;
|
||||||
|
|
||||||
|
import %s.dto.%sRequest;
|
||||||
|
import %s.dto.%sResponse;
|
||||||
|
import %s.infra.itrf.mci.%s.io.%s_I;
|
||||||
|
import %s.infra.itrf.mci.%s.io.%s_O;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.Mapping;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @package %s.converter
|
||||||
|
* @className %sLegacyConverter
|
||||||
|
* @description AX HUB 시스템 처리 클래스
|
||||||
|
* @author %s
|
||||||
|
* @create %s
|
||||||
|
* <pre>
|
||||||
|
* ---------- 개정이력 ----------
|
||||||
|
* 수정일 수정자 수정내용
|
||||||
|
* ---------- -------- ---------------------------
|
||||||
|
* %s %s 최초생성
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
@Mapper(componentModel = "spring")
|
||||||
|
public interface %sLegacyConverter {
|
||||||
|
|
||||||
|
@Mapping(source = "phoneNumber", target = "phone")
|
||||||
|
@Mapping(source = "message", target = "content")
|
||||||
|
%s_I toLegacyRequest(%sRequest req);
|
||||||
|
|
||||||
|
@Mapping(source = "phone", target = "phoneNumber")
|
||||||
|
@Mapping(source = "content", target = "message")
|
||||||
|
%sRequest toRequest(%s_I mciReq);
|
||||||
|
|
||||||
|
// %sResponse toResponse(%s_O mciRes);
|
||||||
|
}
|
||||||
|
""".formatted(
|
||||||
|
BASE_PACKAGE,
|
||||||
|
BASE_PACKAGE, baseName,
|
||||||
|
BASE_PACKAGE, baseName,
|
||||||
|
BASE_PACKAGE, group.toLowerCase(), interfaceId,
|
||||||
|
BASE_PACKAGE, group.toLowerCase(), interfaceId,
|
||||||
|
BASE_PACKAGE, baseName, author, createDate, createDate, author,
|
||||||
|
baseName, interfaceId, baseName,
|
||||||
|
baseName, interfaceId,
|
||||||
|
baseName, interfaceId
|
||||||
|
);
|
||||||
|
Files.writeString(converterDir.resolve(baseName + "LegacyConverter.java"), converterContent);
|
||||||
|
|
||||||
|
log.append("\n=========================================\n");
|
||||||
|
log.append(" Scaffolding Complete! (Routing: " + routingType + ")\n");
|
||||||
|
log.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("[Request DTO] ").append(dtoDir.resolve(baseName + "Request.java")).append("\n");
|
||||||
|
log.append("[Response DTO] ").append(dtoDir.resolve(baseName + "Response.java")).append("\n");
|
||||||
|
log.append("[MCI Request IO] ").append(mciIoDir.resolve(interfaceId + "_I.java")).append("\n");
|
||||||
|
log.append("[MCI Response IO] ").append(mciIoDir.resolve(interfaceId + "_O.java")).append("\n");
|
||||||
|
log.append("[MCI Converter] ").append(converterDir.resolve(baseName + "LegacyConverter.java")).append("\n");
|
||||||
|
|
||||||
|
} else {
|
||||||
String legacyReqContent = """
|
String legacyReqContent = """
|
||||||
package %s.legacy;
|
package %s.legacy;
|
||||||
|
|
||||||
@@ -476,6 +606,7 @@ public class ToolScaffolder {
|
|||||||
log.append("[Legacy Request DTO] ").append(legacyDtoDir.resolve(baseName + "LegacyRequest.java")).append("\n");
|
log.append("[Legacy Request DTO] ").append(legacyDtoDir.resolve(baseName + "LegacyRequest.java")).append("\n");
|
||||||
log.append("[Legacy Response DTO] ").append(legacyDtoDir.resolve(baseName + "LegacyResponse.java")).append("\n");
|
log.append("[Legacy Response DTO] ").append(legacyDtoDir.resolve(baseName + "LegacyResponse.java")).append("\n");
|
||||||
log.append("[Legacy Converter] ").append(converterDir.resolve(baseName + "LegacyConverter.java")).append("\n");
|
log.append("[Legacy Converter] ").append(converterDir.resolve(baseName + "LegacyConverter.java")).append("\n");
|
||||||
|
}
|
||||||
log.append("\n Tip: ").append(interfaceId).append(" 목업 데이터를 mock-responses.json에 추가하세요.\n");
|
log.append("\n Tip: ").append(interfaceId).append(" 목업 데이터를 mock-responses.json에 추가하세요.\n");
|
||||||
|
|
||||||
return log.toString();
|
return log.toString();
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package io.shinhanlife.dap.mcc.infra.itrf.mci.cfp.a.io;
|
package io.shinhanlife.dap.mcc.infra.itrf.mci.cfp.a;
|
||||||
|
|
||||||
|
import io.shinhanlife.dap.mcc.infra.itrf.mci.cfp.a.io.CLCNNB00001_I;
|
||||||
|
import io.shinhanlife.dap.mcc.infra.itrf.mci.cfp.a.io.CLCNNB00001_O;
|
||||||
import io.shinhanlife.dap.common.integration.mci.component.AxhubMciComponent;
|
import io.shinhanlife.dap.common.integration.mci.component.AxhubMciComponent;
|
||||||
import io.shinhanlife.dap.mcc.dto.Onnba3011Request;
|
import io.shinhanlife.dap.mcc.dto.Onnba3011Request;
|
||||||
import io.shinhanlife.glow.communication.dto.Transfer;
|
import io.shinhanlife.glow.communication.dto.Transfer;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package io.shinhanlife.dap.mcc.service.impl;
|
package io.shinhanlife.dap.mcc.service.impl;
|
||||||
|
|
||||||
import io.shinhanlife.dap.mcc.infra.itrf.mci.cfp.a.io.MciCfpaClient;
|
import io.shinhanlife.dap.mcc.infra.itrf.mci.cfp.a.MciCfpaClient;
|
||||||
import io.shinhanlife.dap.mcc.annotation.McpFunction;
|
import io.shinhanlife.dap.mcc.annotation.McpFunction;
|
||||||
import io.shinhanlife.dap.mcc.annotation.McpTool;
|
import io.shinhanlife.dap.mcc.annotation.McpTool;
|
||||||
import io.shinhanlife.dap.mcc.service.OnnbaMciToolService;
|
import io.shinhanlife.dap.mcc.service.OnnbaMciToolService;
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ services:
|
|||||||
nginx:
|
nginx:
|
||||||
image: nginx:latest
|
image: nginx:latest
|
||||||
ports:
|
ports:
|
||||||
- "8281:8281"
|
- "8080:8281"
|
||||||
- "8282:8282"
|
- "8282:8282"
|
||||||
- "8283:8283"
|
- "8283:8283"
|
||||||
- "8284:8284"
|
- "8284:8284"
|
||||||
|
|||||||
Reference in New Issue
Block a user