From 7e30b4e076a22a3d538450fb840df2673c324485 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Thu, 19 Jun 2025 17:50:46 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E9=85=8D=E7=BD=AE-=E7=8E=AF=E5=A2=83db?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=BE=BF=E6=8D=B7=E5=85=A5=E5=8F=A3=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1445757985456128]发布应用配置-环境db配置便捷入口优化 http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1445757985456128 --- .../IResourceAccountCrossoverMapper.java | 13 +++++++++ ...ResourceCenterAccountCrossoverService.java | 17 +++++++++++ ...ourceCenterAccountNotPrivateException.java | 28 ++++++++++++++++++ ...enterResourceNotExistAccountException.java | 29 +++++++++++++++++++ 4 files changed, 87 insertions(+) create mode 100644 src/main/java/neatlogic/framework/cmdb/exception/resourcecenter/ResourceCenterAccountNotPrivateException.java create mode 100644 src/main/java/neatlogic/framework/cmdb/exception/resourcecenter/ResourceCenterResourceNotExistAccountException.java diff --git a/src/main/java/neatlogic/framework/cmdb/crossover/IResourceAccountCrossoverMapper.java b/src/main/java/neatlogic/framework/cmdb/crossover/IResourceAccountCrossoverMapper.java index bcc5073..a70ce6d 100644 --- a/src/main/java/neatlogic/framework/cmdb/crossover/IResourceAccountCrossoverMapper.java +++ b/src/main/java/neatlogic/framework/cmdb/crossover/IResourceAccountCrossoverMapper.java @@ -18,6 +18,7 @@ package neatlogic.framework.cmdb.crossover; import neatlogic.framework.cmdb.dto.resourcecenter.AccountIpVo; import neatlogic.framework.cmdb.dto.resourcecenter.AccountProtocolVo; import neatlogic.framework.cmdb.dto.resourcecenter.AccountVo; +import neatlogic.framework.cmdb.dto.resourcecenter.ResourceAccountVo; import neatlogic.framework.crossover.ICrossoverService; import org.apache.ibatis.annotations.Param; @@ -29,6 +30,10 @@ public interface IResourceAccountCrossoverMapper extends ICrossoverService { AccountVo getPublicAccountByName(String name); + List getAccountListByIdList(List accountIdList); + + int checkAccountNameIsRepeats(AccountVo vo); + AccountVo getResourceAccountByIpAndPort(@Param("host") String host, @Param("port") Integer port); AccountVo getAccountByTagentIpAndPort(@Param("ip") String ip, @Param("port") Integer port); @@ -37,6 +42,10 @@ public interface IResourceAccountCrossoverMapper extends ICrossoverService { AccountVo getAccountByTagentId(Long id); + List getResourceAccountListByResourceIdAndType(@Param("resourceId") Long resourceId, @Param("type") String type); + + List getResourceAccountListByResourceId(Long resourceId); + List getAllAccountList(); List getAccountListByIpAndProtocolNameAndAccountAndProtocolPort(@Param("ip") String ip, @Param("protocolName") String protocolName, @Param("account") String account, @Param("protocolPort") Integer protocolPort); @@ -65,6 +74,8 @@ public interface IResourceAccountCrossoverMapper extends ICrossoverService { void insertAccount(AccountVo vo); + int insertIgnoreResourceAccount(List resourceAccountVoList); + int insertAccountProtocol(AccountProtocolVo searchVo); int insertAccountIp(AccountIpVo ipVo); @@ -77,4 +88,6 @@ public interface IResourceAccountCrossoverMapper extends ICrossoverService { int deleteResourceAccountByAccountId(Long accountId); + int deleteResourceAccountByResourceIdListAndAccountIdList(@Param("resourceIdList") List resourceIdList, @Param("accountIdList") List accountIdList); + } diff --git a/src/main/java/neatlogic/framework/cmdb/crossover/IResourceCenterAccountCrossoverService.java b/src/main/java/neatlogic/framework/cmdb/crossover/IResourceCenterAccountCrossoverService.java index b49299b..0f9829c 100644 --- a/src/main/java/neatlogic/framework/cmdb/crossover/IResourceCenterAccountCrossoverService.java +++ b/src/main/java/neatlogic/framework/cmdb/crossover/IResourceCenterAccountCrossoverService.java @@ -15,6 +15,7 @@ along with this program. If not, see .*/ package neatlogic.framework.cmdb.crossover; +import com.alibaba.fastjson.JSONObject; import neatlogic.framework.cmdb.dto.resourcecenter.AccountBaseVo; import neatlogic.framework.cmdb.dto.resourcecenter.AccountProtocolVo; import neatlogic.framework.cmdb.dto.resourcecenter.AccountVo; @@ -53,4 +54,20 @@ public interface IResourceCenterAccountCrossoverService extends ICrossoverServic * @param accountIdList 账号idList */ void deleteAccount(List accountIdList); + + /** + * 保存账号 + * @param id + * @param paramAccountVo + * @return + */ + JSONObject saveAccount(Long id, AccountVo paramAccountVo); + + /** + * 绑定账号与资源关系 + * @param resourceId + * @param accountIdList + * @return + */ + JSONObject saveResourceAccount(Long resourceId, List accountIdList); } diff --git a/src/main/java/neatlogic/framework/cmdb/exception/resourcecenter/ResourceCenterAccountNotPrivateException.java b/src/main/java/neatlogic/framework/cmdb/exception/resourcecenter/ResourceCenterAccountNotPrivateException.java new file mode 100644 index 0000000..0577f8f --- /dev/null +++ b/src/main/java/neatlogic/framework/cmdb/exception/resourcecenter/ResourceCenterAccountNotPrivateException.java @@ -0,0 +1,28 @@ +/*Copyright (C) 2023 深圳极向量科技有限公司 All Rights Reserved. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see .*/ + +package neatlogic.framework.cmdb.exception.resourcecenter; + +import neatlogic.framework.exception.core.ApiRuntimeException; + +public class ResourceCenterAccountNotPrivateException extends ApiRuntimeException { + + private static final long serialVersionUID = 560397839803209201L; + + public ResourceCenterAccountNotPrivateException(String name) { + super("nfcer.resourcecenteraccountnotprivateexception.resourcecenteraccountnotprivateexception", name); + } + +} diff --git a/src/main/java/neatlogic/framework/cmdb/exception/resourcecenter/ResourceCenterResourceNotExistAccountException.java b/src/main/java/neatlogic/framework/cmdb/exception/resourcecenter/ResourceCenterResourceNotExistAccountException.java new file mode 100644 index 0000000..0930dba --- /dev/null +++ b/src/main/java/neatlogic/framework/cmdb/exception/resourcecenter/ResourceCenterResourceNotExistAccountException.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2025 深圳极向量科技有限公司 All Rights Reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package neatlogic.framework.cmdb.exception.resourcecenter; + +import neatlogic.framework.exception.core.ApiRuntimeException; + +public class ResourceCenterResourceNotExistAccountException extends ApiRuntimeException { + + private static final long serialVersionUID = 560397839803209203L; + + public ResourceCenterResourceNotExistAccountException(String resourceName, String accountName) { + super("nfcer.resourcecenterresourcenotexistaccountexception.resourcecenterresourcenotexistaccountexception", resourceName, accountName); + } +} -- Gitee