From 9411cca2ca4d1d4cfdd5a7ea0fa5b1c9db31361e Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Thu, 15 May 2025 17:04:55 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=90=8E=E7=AB=AF-DB?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=B0=E5=A2=9E=E5=BF=AB=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E6=8D=B7=E5=BD=95=E5=85=A5=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1421105015783424]后端-DB配置新增快发布捷录入入口 http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1421105015783424 --- .../env/SaveDeployAppConfigEnvCiEntityApi.java | 2 ++ .../system/ListDeployAppInstanceCiAttrApi.java | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) 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 b9da21ac..28d5d1fe 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 b8233808..0997f9b4 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")); } -- Gitee