feat: Scaffolder 생성 시 MCI UseCaseImpl 템플릿을 실제 요청(image) 구조(BizException, resTransfer null 체크, IO DTO)와 완전히 일치하도록 수정
Some checks failed
Deploy to OCIWP / deploy (push) Failing after 25s
Some checks failed
Deploy to OCIWP / deploy (push) Failing after 25s
This commit is contained in:
@@ -868,11 +868,13 @@ public class ToolScaffolder {
|
||||
import %s.usecase.%sUseCase;
|
||||
import io.shinhanlife.dat.lib.integration.mci.component.AxhubMciComponent;
|
||||
import io.shinhanlife.glow.communication.dto.Transfer;
|
||||
import io.shinhanlife.glow.BizException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import %s.converter.%sConverter;
|
||||
import %s.%s.io.%s_I;
|
||||
import %s.%s.io.%s_O;
|
||||
%s
|
||||
|
||||
/**
|
||||
@@ -883,10 +885,10 @@ public class ToolScaffolder {
|
||||
* @create %s
|
||||
* <pre>
|
||||
* ---------- 개정이력 ----------
|
||||
* 수정일 수정자 수정내용
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* %s %s 최초생성
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Slf4j
|
||||
@@ -903,19 +905,33 @@ public class ToolScaffolder {
|
||||
try {
|
||||
// MapStruct를 이용한 자동 매핑 (AI DTO -> MCI DTO)
|
||||
%s_I mciReq = converter.toLegacyRequest(req);
|
||||
Transfer<%s_O> resTransfer = null;
|
||||
|
||||
if (mciReq != null) {
|
||||
resTransfer = mci.callTo(
|
||||
"%s",
|
||||
null,
|
||||
mciReq,
|
||||
%s_O.class
|
||||
);
|
||||
}
|
||||
|
||||
Transfer<Object> resTransfer = mci.callTo(
|
||||
"%s",
|
||||
null,
|
||||
mciReq,
|
||||
Object.class
|
||||
);
|
||||
%sResponse response = new %sResponse();
|
||||
if (resTransfer != null && resTransfer.getBody() != null) {
|
||||
response = converter.toResponse(resTransfer.getBody());
|
||||
}
|
||||
|
||||
response.setResultCode("SUCCESS");
|
||||
response.setResultMessage(resTransfer.getBody() != null
|
||||
response.setResultMessage(resTransfer != null && resTransfer.getBody() != null
|
||||
? "MCI call completed."
|
||||
: "MCI call completed without a response body.");
|
||||
return response;
|
||||
} catch (BizException e) {
|
||||
log.error("[MCI Tool] 연동 중 오류 발생: {}", e.getMessage(), e);
|
||||
%sResponse response = new %sResponse();
|
||||
response.setResultCode("ERROR");
|
||||
response.setResultMessage(e.getMessage() != null ? e.getMessage() : "Unknown error");
|
||||
return response;
|
||||
} catch (Exception e) {
|
||||
log.error("[MCI Tool] 연동 중 오류 발생: {}", e.getMessage(), e);
|
||||
%sResponse response = new %sResponse();
|
||||
@@ -932,6 +948,7 @@ public class ToolScaffolder {
|
||||
bizPackage, baseName,
|
||||
bizPackage, baseName,
|
||||
BASE_PACKAGE, mciGroupPath.replace("/", "."), ioPrefix,
|
||||
BASE_PACKAGE, mciGroupPath.replace("/", "."), ioPrefix,
|
||||
(clientPrefixCap.isEmpty() ? "" : "import " + BASE_PACKAGE + "." + mciGroupPath.replace("/", ".") + ".Mci" + clientPrefixCap + "Client;\n"),
|
||||
bizPackage,
|
||||
baseName,
|
||||
@@ -946,20 +963,16 @@ public class ToolScaffolder {
|
||||
baseName,
|
||||
toolName,
|
||||
ioPrefix,
|
||||
ioPrefix,
|
||||
interfaceId,
|
||||
ioPrefix,
|
||||
baseName,
|
||||
baseName,
|
||||
baseName,
|
||||
baseName,
|
||||
baseName,
|
||||
baseName
|
||||
);
|
||||
String mciIoPackage = BASE_PACKAGE + "." + mciGroupPath.replace("/", ".");
|
||||
serviceImplContent = serviceImplContent
|
||||
.replace("import " + mciIoPackage + ".io." + ioPrefix + "_I;",
|
||||
"import " + mciIoPackage + ".io." + ioPrefix + "_I;\nimport " + mciIoPackage + ".io." + ioPrefix + "_O;")
|
||||
.replace("Transfer<Object> resTransfer", "Transfer<" + ioPrefix + "_O> resTransfer")
|
||||
.replace("Object.class", ioPrefix + "_O.class")
|
||||
.replace("response.setResultCode(\"SUCCESS\");",
|
||||
"if (resTransfer.getBody() != null) {\n response = converter.toResponse(resTransfer.getBody());\n }\n response.setResultCode(\"SUCCESS\");");
|
||||
} else {
|
||||
serviceImplContent = isHttp
|
||||
? httpUseCaseImplContent(bizPackage, baseName, httpGroupPath.replace("/", "."), httpApiClass, author, createDate)
|
||||
|
||||
Reference in New Issue
Block a user