변환명령에 함수가 적용된 경우, 복제시 함수명 잘리는 버그 수정
eapim-admin CI / build (push) Has been cancelled

This commit is contained in:
eastargh
2026-08-12 17:46:10 +09:00
parent 2cdd321c39
commit ee0b882608
@@ -1160,15 +1160,19 @@ public class ApiInterfaceService extends OnlBaseService {
transformUI.setCnvsnName(updatedString);
// 치환 전 원본 레이아웃명을 먼저 보존 (CNVSNCMDNAME/CNVSNRSULTITEMPATHNAME 치환에 사용)
String oldSrcLayoutName = transformUI.getSrcLayoutName();
String oldTgtLayoutName = transformUI.getTgtLayoutName();
transformUI.setSrcLayoutName(srcLayoutName);
transformUI.setTgtLayoutName(tgtLayoutName);
for (TransformItemUI transformItemUI : transformUI.getGridData()) {
transformItemUI.setCnvsnName(updatedString);
String tgtPath = transformItemUI.getCnvsnRsultItemPathName().replaceFirst("^[^.]+", tgtLayoutName);
String tgtPath = replaceLayoutNamePrefix(transformItemUI.getCnvsnRsultItemPathName(), oldTgtLayoutName, tgtLayoutName);
transformItemUI.setCnvsnRsultItemPathName(tgtPath);
String srcPath = transformItemUI.getCnvsncmdname().replaceFirst("^[^.]+", srcLayoutName);
String srcPath = replaceLayoutNamePrefix(transformItemUI.getCnvsncmdname(), oldSrcLayoutName, srcLayoutName);
transformItemUI.setCnvsncmdname(srcPath);
}
@@ -1177,6 +1181,20 @@ public class ApiInterfaceService extends OnlBaseService {
return updatedString;
}
/*
* CNVSNCMDNAME/CNVSNRSULTITEMPATHNAME 안의 레이아웃명 부분만 정확히 치환한다.
* "^[^.]+" 로 문자열 맨 앞을 무조건 잘라내는 방식은 FUNC(LAYOUT.FIELD) 처럼 함수가 적용된 값에서
* 함수명까지 잘라먹고, 여러 항목(FUNC(LAYOUT.A, LAYOUT.B))에서는 첫 번째만 치환되는 문제가 있어
* 문자열 전체에서 "레이아웃명." 형태로 나타나는 자리만 찾아 바꾼다.
*/
private String replaceLayoutNamePrefix(String value, String oldLayoutName, String newLayoutName) {
if (value == null || oldLayoutName == null || oldLayoutName.isEmpty()) {
return value;
}
String regex = "(?<![\\w-])" + Pattern.quote(oldLayoutName) + "(?=\\.)";
return value.replaceAll(regex, Matcher.quoteReplacement(newLayoutName));
}
public ApiInterfaceUI cloneApiInterface(ApiInterfaceUI orgApiInterfaceUI, String newBizCd,
String newApiInterfaceId, String newInboundHttpMethod,
String newInboundRestPath, String newSvcDesc, boolean importDupliCheck) throws Exception {