diff --git a/src/main/java/neatlogic/module/deploy/api/appconfig/env/SaveDeployAppConfigEnvCiEntityApi.java b/src/main/java/neatlogic/module/deploy/api/appconfig/env/SaveDeployAppConfigEnvCiEntityApi.java index b9da21ac9a54e19e765b849aa3ed1a092d728063..28d5d1fe6efd005c4e4ae9df2264dcd5d3ca74ce 100644 --- a/src/main/java/neatlogic/module/deploy/api/appconfig/env/SaveDeployAppConfigEnvCiEntityApi.java +++ b/src/main/java/neatlogic/module/deploy/api/appconfig/env/SaveDeployAppConfigEnvCiEntityApi.java @@ -175,6 +175,8 @@ public class SaveDeployAppConfigEnvCiEntityApi extends PrivateApiComponentBase { ciEntityTransactionList.add(ciEntityTransactionVo); Long transactionGroupId = ciEntityService.saveCiEntity(ciEntityTransactionList); JSONObject resultObj = new JSONObject(); + Long ciEntityId = ciEntityTransactionVo.getCiEntityId(); + resultObj.put("id", ciEntityId); resultObj.put("transactionGroupId", transactionGroupId); return resultObj; } diff --git a/src/main/java/neatlogic/module/deploy/api/appconfig/system/ListDeployAppInstanceCiAttrApi.java b/src/main/java/neatlogic/module/deploy/api/appconfig/system/ListDeployAppInstanceCiAttrApi.java index b8233808067726fd49cc888e1977eb61a3fc2c88..0997f9b4ae77429db221d7994f321e3f987e691c 100644 --- a/src/main/java/neatlogic/module/deploy/api/appconfig/system/ListDeployAppInstanceCiAttrApi.java +++ b/src/main/java/neatlogic/module/deploy/api/appconfig/system/ListDeployAppInstanceCiAttrApi.java @@ -60,6 +60,7 @@ public class ListDeployAppInstanceCiAttrApi extends PrivateApiComponentBase { } @Input({ + @Param(name = "ciId", type = ApiParamType.LONG, desc = "term.cmdb.ciid"), @Param(name = "isAll", type = ApiParamType.INTEGER, isRequired = true, desc = "是否返回全部属性"), @Param(name = "attrNameList", type = ApiParamType.JSONARRAY, desc = "需要返回的属性列表") }) @@ -68,9 +69,18 @@ public class ListDeployAppInstanceCiAttrApi extends PrivateApiComponentBase { @Override public Object myDoService(JSONObject paramObj) throws Exception { ICiCrossoverMapper ciCrossoverMapper = CrossoverServiceFactory.getApi(ICiCrossoverMapper.class); - CiVo appCiVo = ciCrossoverMapper.getCiByName("AppIns"); - if (appCiVo == null) { - throw new CiNotFoundException("AppIns"); + CiVo appCiVo = null; + Long ciId = paramObj.getLong("ciId"); + if (ciId != null) { + appCiVo = ciCrossoverMapper.getCiById(ciId); + if (appCiVo == null) { + throw new CiNotFoundException(ciId); + } + } else { + appCiVo = ciCrossoverMapper.getCiByName("AppIns"); + if (appCiVo == null) { + throw new CiNotFoundException("AppIns"); + } } return deployAppConfigService.getDeployCiAttrList(appCiVo.getId(), paramObj.getInteger("isAll"), paramObj.getJSONArray("attrNameList")); }