- API_FULL_PATH(유니크 값) 중복체크

This commit is contained in:
daekuk
2026-01-08 11:29:42 +09:00
parent 6f43415d5b
commit 5f71641715
3 changed files with 14 additions and 1 deletions
@@ -619,11 +619,13 @@ public class ApiInterfaceService extends OnlBaseService {
String fullPath = inboundHttpMethod + "|" + prop.getPrpty2val() + "/" + vo.getInboundRestPath(); String fullPath = inboundHttpMethod + "|" + prop.getPrpty2val() + "/" + vo.getInboundRestPath();
vo.setApiFullPath(fullPath); vo.setApiFullPath(fullPath);
// HS04 AndEaiSvcNameNot : 업데이트일 때 자신의 fullpath 는 제외함
standardMessageInfoQueryService.existsByApiFullPathAndEaiSvcNameNot(vo.getApiFullPath(), eaiServiceName);
break; break;
} }
} }
} }
} }
// HTTP 어댑터도 등록 가능하도록 수정. // HTTP 어댑터도 등록 가능하도록 수정.
@@ -21,6 +21,15 @@ public class StandardMessageInfoQueryServiceForApi extends AbstractDataService<S
public void deleteByEaiSvcName(String eaiSvcName){ public void deleteByEaiSvcName(String eaiSvcName){
repository.deleteByEaisvcname(eaiSvcName); repository.deleteByEaisvcname(eaiSvcName);
} }
public void existsByApiFullPathAndEaiSvcNameNot(String apiFullPath, String eaiServiceName) {
boolean isExist = repository.existsByApifullpathAndEaisvcnameNot(apiFullPath, eaiServiceName);
if(isExist) {
throw new RuntimeException("API FUll PATH 가 중복되었습니다 : " + apiFullPath);
}
}
} }
@@ -10,4 +10,6 @@ public interface StandardMessageInfoRepositoryForApi extends BaseRepository<Stan
Optional<StandardMessageInfo> findByEaisvcname(String eaiSvcName); Optional<StandardMessageInfo> findByEaisvcname(String eaiSvcName);
void deleteByEaisvcname(String eaiSvcName); void deleteByEaisvcname(String eaiSvcName);
boolean existsByApifullpathAndEaisvcnameNot(String fullPath, String eaiServiceName);
} }