From 5584b5a554081739cf37c4f606d245478b489c70 Mon Sep 17 00:00:00 2001 From: yaoxuwan Date: Thu, 26 Sep 2024 12:18:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20NodeMetadata=E6=8F=90=E5=8F=96=E5=88=B0?= =?UTF-8?q?common-metadata=20#2576?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metadata/config}/RepoJobProperties.kt | 2 +- .../metadata}/config/RepoStorageMapping.kt | 2 +- .../metadata}/config/RepositoryProperties.kt | 3 +- .../common/metadata/dao/node}/NodeDao.kt | 9 ++-- .../common/metadata}/model/TMetadata.kt | 2 +- .../bkrepo/common/metadata}/model/TNode.kt | 38 +++++++------- .../service/metadata/MetadataService.kt | 2 +- .../impl/CenterMetadataServiceImpl.kt} | 14 ++--- .../metadata/impl}/EdgeMetadataServiceImpl.kt | 10 ++-- .../metadata/impl/MetadataServiceImpl.kt | 23 +++++---- .../common/metadata}/util/MetadataUtils.kt | 4 +- .../common/metadata}/util/NodeEventFactory.kt | 4 +- .../common/metadata}/util/NodeQueryHelper.kt | 8 +-- .../common/query/handler/impl/MatchHandler.kt | 4 +- .../query/handler/impl/MatchIHandler.kt | 4 +- .../query/handler/impl/PrefixHandler.kt | 4 +- .../query/handler/impl/SuffixHandler.kt | 4 +- .../common/query/util/MongoEscapeUtils.kt | 51 ------------------- .../file/BasedRepositoryFileExpireResolver.kt | 4 +- .../job/service/impl/ArchiveJobServiceImpl.kt | 4 +- .../cluster/ClusterMetadataController.kt | 2 +- .../controller/service/MetadataController.kt | 2 +- .../user/UserBkCiWebhookController.kt | 2 +- .../controller/user/UserMetadataController.kt | 2 +- .../repository/job/DeletedNodeCleanupJob.kt | 4 +- .../job/NodeDeletedCorrectionJob.kt | 4 +- .../job/PackageVersionCorrectionJob.kt | 2 +- .../repository/job/RootNodeCleanupJob.kt | 4 +- .../repository/job/base/SwitchableJob.kt | 2 +- .../listener/NodeModifyEventListener.kt | 10 ++-- .../NodeUpdateAccessDateEventListener.kt | 4 +- .../repository/model/TPackageVersion.kt | 1 + .../search/common/CommonQueryContext.kt | 2 +- .../common/LocalDatetimeRuleInterceptor.kt | 4 +- .../search/common/MetadataRuleInterceptor.kt | 8 +-- .../search/common/RepoNameRuleInterceptor.kt | 2 +- .../search/node/NodeModelInterceptor.kt | 2 +- .../service/blocknode/BlockNodeServiceImpl.kt | 2 +- .../service/fs/impl/FsServiceImpl.kt | 10 ++-- .../center/CommitEdgeCenterFsServiceImpl.kt | 4 +- .../service/fs/impl/edge/EdgeFsServiceImpl.kt | 4 +- .../impl/PackageMetadataServiceImpl.kt | 2 +- .../service/node/impl/NodeArchiveSupport.kt | 6 +-- .../service/node/impl/NodeBaseService.kt | 14 ++--- .../service/node/impl/NodeCompressSupport.kt | 6 +-- .../service/node/impl/NodeDeleteSupport.kt | 10 ++-- .../service/node/impl/NodeMoveCopySupport.kt | 8 +-- .../service/node/impl/NodeRenameSupport.kt | 8 +-- .../service/node/impl/NodeRestoreSupport.kt | 22 ++++---- .../node/impl/NodeSearchServiceImpl.kt | 8 +-- .../service/node/impl/NodeServiceImpl.kt | 4 +- .../service/node/impl/NodeStatsSupport.kt | 6 +-- .../CommitEdgeCenterNodeDeleteSupport.kt | 4 +- .../CommitEdgeCenterNodeMoveCopySupport.kt | 2 +- .../CommitEdgeCenterNodeRenameSupport.kt | 2 +- .../CommitEdgeCenterNodeRestoreSupport.kt | 4 +- .../center/CommitEdgeCenterNodeServiceImpl.kt | 10 ++-- .../node/impl/edge/EdgeNodeBaseService.kt | 6 +-- .../node/impl/edge/EdgeNodeServiceImpl.kt | 4 +- .../packages/impl/PackageBaseService.kt | 2 +- .../packages/impl/PackageServiceImpl.kt | 2 +- .../impl/PackageStatisticsServiceImpl.kt | 7 +-- .../impl/SoftwarePackageServiceImpl.kt | 4 +- .../repo/impl/RepositoryServiceImpl.kt | 4 +- .../CommitEdgeCenterRepositoryServiceImpl.kt | 2 +- .../impl/edge/EdgeRepositoryServiceImpl.kt | 2 +- .../service/FileReferenceServiceTest.kt | 2 +- .../repository/service/MetadataServiceTest.kt | 4 +- .../NodeQueryWithoutShardingKeyTest.kt | 2 +- .../service/NodeSearchServiceTest.kt | 2 +- .../repository/service/NodeServiceTest.kt | 2 +- .../service/RepositoryServiceTest.kt | 2 +- .../repository/service/ServiceBaseTest.kt | 4 +- .../service/StorageCredentialServiceTest.kt | 2 +- .../service/node/NodeRestoreSupportTest.kt | 4 +- 75 files changed, 201 insertions(+), 245 deletions(-) rename src/backend/{repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/job/base => common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/config}/RepoJobProperties.kt (97%) rename src/backend/{repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository => common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata}/config/RepoStorageMapping.kt (97%) rename src/backend/{repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository => common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata}/config/RepositoryProperties.kt (95%) rename src/backend/{repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/dao => common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/dao/node}/NodeDao.kt (94%) rename src/backend/{repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository => common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata}/model/TMetadata.kt (97%) rename src/backend/{repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository => common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata}/model/TNode.kt (76%) rename src/backend/{repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository => common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata}/service/metadata/MetadataService.kt (97%) rename src/backend/{repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/metadata/impl/center/CommitEdgeCenterMetadataServiceImpl.kt => common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/service/metadata/impl/CenterMetadataServiceImpl.kt} (84%) rename src/backend/{repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/metadata/impl/edge => common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/service/metadata/impl}/EdgeMetadataServiceImpl.kt (92%) rename src/backend/{repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository => common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata}/service/metadata/impl/MetadataServiceImpl.kt (91%) rename src/backend/{repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository => common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata}/util/MetadataUtils.kt (98%) rename src/backend/{repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository => common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata}/util/NodeEventFactory.kt (98%) rename src/backend/{repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository => common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata}/util/NodeQueryHelper.kt (98%) delete mode 100644 src/backend/common/common-query/query-mongo/src/main/kotlin/com/tencent/bkrepo/common/query/util/MongoEscapeUtils.kt diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/job/base/RepoJobProperties.kt b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/config/RepoJobProperties.kt similarity index 97% rename from src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/job/base/RepoJobProperties.kt rename to src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/config/RepoJobProperties.kt index 3f1a46bd17..a7d79a2fed 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/job/base/RepoJobProperties.kt +++ b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/config/RepoJobProperties.kt @@ -29,7 +29,7 @@ * SOFTWARE. */ -package com.tencent.bkrepo.repository.job.base +package com.tencent.bkrepo.common.metadata.config /** * 仓库后台任务配置 diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/config/RepoStorageMapping.kt b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/config/RepoStorageMapping.kt similarity index 97% rename from src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/config/RepoStorageMapping.kt rename to src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/config/RepoStorageMapping.kt index 76f44c6b1d..e86cc8b7fc 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/config/RepoStorageMapping.kt +++ b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/config/RepoStorageMapping.kt @@ -29,7 +29,7 @@ * SOFTWARE. */ -package com.tencent.bkrepo.repository.config +package com.tencent.bkrepo.common.metadata.config import com.tencent.bkrepo.common.artifact.pojo.RepositoryType diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/config/RepositoryProperties.kt b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/config/RepositoryProperties.kt similarity index 95% rename from src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/config/RepositoryProperties.kt rename to src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/config/RepositoryProperties.kt index 97f63ef04f..e6044f4521 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/config/RepositoryProperties.kt +++ b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/config/RepositoryProperties.kt @@ -29,9 +29,8 @@ * SOFTWARE. */ -package com.tencent.bkrepo.repository.config +package com.tencent.bkrepo.common.metadata.config -import com.tencent.bkrepo.repository.job.base.RepoJobProperties import org.springframework.boot.context.properties.ConfigurationProperties import org.springframework.boot.context.properties.NestedConfigurationProperty import org.springframework.context.annotation.Configuration diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/dao/NodeDao.kt b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/dao/node/NodeDao.kt similarity index 94% rename from src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/dao/NodeDao.kt rename to src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/dao/node/NodeDao.kt index 9f063d1ffb..cf85cf3fea 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/dao/NodeDao.kt +++ b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/dao/node/NodeDao.kt @@ -29,15 +29,17 @@ * SOFTWARE. */ -package com.tencent.bkrepo.repository.dao +package com.tencent.bkrepo.common.metadata.dao.node import com.tencent.bkrepo.common.api.constant.StringPool import com.tencent.bkrepo.common.artifact.path.PathUtils +import com.tencent.bkrepo.common.metadata.condition.SyncCondition import com.tencent.bkrepo.common.mongo.dao.sharding.HashShardingMongoDao import com.tencent.bkrepo.common.mongo.dao.util.Pages -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.repository.pojo.node.NodeListOption -import com.tencent.bkrepo.repository.util.NodeQueryHelper +import com.tencent.bkrepo.common.metadata.util.NodeQueryHelper +import org.springframework.context.annotation.Conditional import org.springframework.data.domain.Page import org.springframework.data.mongodb.core.FindAndModifyOptions import org.springframework.data.mongodb.core.query.Query @@ -53,6 +55,7 @@ import java.time.LocalDateTime * 节点 Dao */ @Repository +@Conditional(SyncCondition::class) class NodeDao : HashShardingMongoDao() { /** * 查询节点 diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/model/TMetadata.kt b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/model/TMetadata.kt similarity index 97% rename from src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/model/TMetadata.kt rename to src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/model/TMetadata.kt index 91e9337071..0897081afd 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/model/TMetadata.kt +++ b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/model/TMetadata.kt @@ -29,7 +29,7 @@ * SOFTWARE. */ -package com.tencent.bkrepo.repository.model +package com.tencent.bkrepo.common.metadata.model /** * 元数据模型 diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/model/TNode.kt b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/model/TNode.kt similarity index 76% rename from src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/model/TNode.kt rename to src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/model/TNode.kt index cf6f57bee1..838dbe7045 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/model/TNode.kt +++ b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/model/TNode.kt @@ -29,29 +29,29 @@ * SOFTWARE. */ -package com.tencent.bkrepo.repository.model +package com.tencent.bkrepo.common.metadata.model import com.tencent.bkrepo.common.api.mongo.ShardingDocument import com.tencent.bkrepo.common.api.mongo.ShardingKey import com.tencent.bkrepo.repository.constant.SHARDING_COUNT -import com.tencent.bkrepo.repository.model.TNode.Companion.ARCHIVED_IDX -import com.tencent.bkrepo.repository.model.TNode.Companion.ARCHIVED_IDX_DEF -import com.tencent.bkrepo.repository.model.TNode.Companion.CLUSTER_NAMES_IDX -import com.tencent.bkrepo.repository.model.TNode.Companion.CLUSTER_NAMES_IDX_DEF -import com.tencent.bkrepo.repository.model.TNode.Companion.COMPRESSED_IDX -import com.tencent.bkrepo.repository.model.TNode.Companion.COMPRESSED_IDX_DEF -import com.tencent.bkrepo.repository.model.TNode.Companion.COPY_FROM_IDX -import com.tencent.bkrepo.repository.model.TNode.Companion.COPY_FROM_IDX_DEF -import com.tencent.bkrepo.repository.model.TNode.Companion.FOLDER_IDX -import com.tencent.bkrepo.repository.model.TNode.Companion.FOLDER_IDX_DEF -import com.tencent.bkrepo.repository.model.TNode.Companion.FULL_PATH_IDX -import com.tencent.bkrepo.repository.model.TNode.Companion.FULL_PATH_IDX_DEF -import com.tencent.bkrepo.repository.model.TNode.Companion.METADATA_IDX -import com.tencent.bkrepo.repository.model.TNode.Companion.METADATA_IDX_DEF -import com.tencent.bkrepo.repository.model.TNode.Companion.PATH_IDX -import com.tencent.bkrepo.repository.model.TNode.Companion.PATH_IDX_DEF -import com.tencent.bkrepo.repository.model.TNode.Companion.SHA256_IDX -import com.tencent.bkrepo.repository.model.TNode.Companion.SHA256_IDX_DEF +import com.tencent.bkrepo.common.metadata.model.TNode.Companion.ARCHIVED_IDX +import com.tencent.bkrepo.common.metadata.model.TNode.Companion.ARCHIVED_IDX_DEF +import com.tencent.bkrepo.common.metadata.model.TNode.Companion.CLUSTER_NAMES_IDX +import com.tencent.bkrepo.common.metadata.model.TNode.Companion.CLUSTER_NAMES_IDX_DEF +import com.tencent.bkrepo.common.metadata.model.TNode.Companion.COMPRESSED_IDX +import com.tencent.bkrepo.common.metadata.model.TNode.Companion.COMPRESSED_IDX_DEF +import com.tencent.bkrepo.common.metadata.model.TNode.Companion.COPY_FROM_IDX +import com.tencent.bkrepo.common.metadata.model.TNode.Companion.COPY_FROM_IDX_DEF +import com.tencent.bkrepo.common.metadata.model.TNode.Companion.FOLDER_IDX +import com.tencent.bkrepo.common.metadata.model.TNode.Companion.FOLDER_IDX_DEF +import com.tencent.bkrepo.common.metadata.model.TNode.Companion.FULL_PATH_IDX +import com.tencent.bkrepo.common.metadata.model.TNode.Companion.FULL_PATH_IDX_DEF +import com.tencent.bkrepo.common.metadata.model.TNode.Companion.METADATA_IDX +import com.tencent.bkrepo.common.metadata.model.TNode.Companion.METADATA_IDX_DEF +import com.tencent.bkrepo.common.metadata.model.TNode.Companion.PATH_IDX +import com.tencent.bkrepo.common.metadata.model.TNode.Companion.PATH_IDX_DEF +import com.tencent.bkrepo.common.metadata.model.TNode.Companion.SHA256_IDX +import com.tencent.bkrepo.common.metadata.model.TNode.Companion.SHA256_IDX_DEF import org.springframework.data.mongodb.core.index.CompoundIndex import org.springframework.data.mongodb.core.index.CompoundIndexes import java.time.LocalDateTime diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/metadata/MetadataService.kt b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/service/metadata/MetadataService.kt similarity index 97% rename from src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/metadata/MetadataService.kt rename to src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/service/metadata/MetadataService.kt index 99627ccde4..b12bfdd617 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/metadata/MetadataService.kt +++ b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/service/metadata/MetadataService.kt @@ -29,7 +29,7 @@ * SOFTWARE. */ -package com.tencent.bkrepo.repository.service.metadata +package com.tencent.bkrepo.common.metadata.service.metadata import com.tencent.bkrepo.repository.pojo.metadata.MetadataDeleteRequest import com.tencent.bkrepo.repository.pojo.metadata.MetadataSaveRequest diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/metadata/impl/center/CommitEdgeCenterMetadataServiceImpl.kt b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/service/metadata/impl/CenterMetadataServiceImpl.kt similarity index 84% rename from src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/metadata/impl/center/CommitEdgeCenterMetadataServiceImpl.kt rename to src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/service/metadata/impl/CenterMetadataServiceImpl.kt index 35e94f7a8b..f2a2d399d0 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/metadata/impl/center/CommitEdgeCenterMetadataServiceImpl.kt +++ b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/service/metadata/impl/CenterMetadataServiceImpl.kt @@ -25,21 +25,21 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.tencent.bkrepo.repository.service.metadata.impl.center +package com.tencent.bkrepo.common.metadata.service.metadata.impl +import com.tencent.bkrepo.common.metadata.condition.SyncCondition import com.tencent.bkrepo.common.metadata.util.ClusterUtils import com.tencent.bkrepo.common.security.manager.ci.CIPermissionManager import com.tencent.bkrepo.common.service.cluster.condition.CommitEdgeCenterCondition -import com.tencent.bkrepo.repository.config.RepositoryProperties -import com.tencent.bkrepo.repository.dao.NodeDao -import com.tencent.bkrepo.repository.model.TNode -import com.tencent.bkrepo.repository.service.metadata.impl.MetadataServiceImpl +import com.tencent.bkrepo.common.metadata.config.RepositoryProperties +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao +import com.tencent.bkrepo.common.metadata.model.TNode import org.springframework.context.annotation.Conditional import org.springframework.stereotype.Service @Service -@Conditional(CommitEdgeCenterCondition::class) -class CommitEdgeCenterMetadataServiceImpl( +@Conditional(SyncCondition::class, CommitEdgeCenterCondition::class) +class CenterMetadataServiceImpl( nodeDao: NodeDao, repositoryProperties: RepositoryProperties, ciPermissionManager: CIPermissionManager diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/metadata/impl/edge/EdgeMetadataServiceImpl.kt b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/service/metadata/impl/EdgeMetadataServiceImpl.kt similarity index 92% rename from src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/metadata/impl/edge/EdgeMetadataServiceImpl.kt rename to src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/service/metadata/impl/EdgeMetadataServiceImpl.kt index 0c2d669ca9..d5b0be3f95 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/metadata/impl/edge/EdgeMetadataServiceImpl.kt +++ b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/service/metadata/impl/EdgeMetadataServiceImpl.kt @@ -25,8 +25,9 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.tencent.bkrepo.repository.service.metadata.impl.edge +package com.tencent.bkrepo.common.metadata.service.metadata.impl +import com.tencent.bkrepo.common.metadata.condition.SyncCondition import com.tencent.bkrepo.common.metadata.util.ClusterUtils.ignoreException import com.tencent.bkrepo.common.metadata.util.ClusterUtils.nodeLevelNotFoundError import com.tencent.bkrepo.common.security.manager.ci.CIPermissionManager @@ -34,16 +35,15 @@ import com.tencent.bkrepo.common.service.cluster.condition.CommitEdgeEdgeConditi import com.tencent.bkrepo.common.service.cluster.properties.ClusterProperties import com.tencent.bkrepo.common.service.feign.FeignClientFactory import com.tencent.bkrepo.repository.api.cluster.ClusterMetadataClient -import com.tencent.bkrepo.repository.config.RepositoryProperties -import com.tencent.bkrepo.repository.dao.NodeDao +import com.tencent.bkrepo.common.metadata.config.RepositoryProperties +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao import com.tencent.bkrepo.repository.pojo.metadata.MetadataDeleteRequest import com.tencent.bkrepo.repository.pojo.metadata.MetadataSaveRequest -import com.tencent.bkrepo.repository.service.metadata.impl.MetadataServiceImpl import org.springframework.context.annotation.Conditional import org.springframework.stereotype.Service @Service -@Conditional(CommitEdgeEdgeCondition::class) +@Conditional(SyncCondition::class, CommitEdgeEdgeCondition::class) class EdgeMetadataServiceImpl( nodeDao: NodeDao, repositoryProperties: RepositoryProperties, diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/metadata/impl/MetadataServiceImpl.kt b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/service/metadata/impl/MetadataServiceImpl.kt similarity index 91% rename from src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/metadata/impl/MetadataServiceImpl.kt rename to src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/service/metadata/impl/MetadataServiceImpl.kt index 8d89f9bd4c..e9916a1450 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/metadata/impl/MetadataServiceImpl.kt +++ b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/service/metadata/impl/MetadataServiceImpl.kt @@ -29,7 +29,7 @@ * SOFTWARE. */ -package com.tencent.bkrepo.repository.service.metadata.impl +package com.tencent.bkrepo.common.metadata.service.metadata.impl import com.tencent.bkrepo.common.api.constant.StringPool import com.tencent.bkrepo.common.api.exception.ErrorCodeException @@ -39,23 +39,24 @@ import com.tencent.bkrepo.common.artifact.constant.PIPELINE import com.tencent.bkrepo.common.artifact.exception.NodeNotFoundException import com.tencent.bkrepo.common.artifact.message.ArtifactMessageCode import com.tencent.bkrepo.common.artifact.path.PathUtils.normalizeFullPath +import com.tencent.bkrepo.common.metadata.condition.SyncCondition import com.tencent.bkrepo.common.metadata.util.ClusterUtils import com.tencent.bkrepo.common.security.exception.PermissionException import com.tencent.bkrepo.common.security.manager.ci.CIPermissionManager import com.tencent.bkrepo.common.service.cluster.condition.DefaultCondition import com.tencent.bkrepo.common.service.util.SpringContextUtils.Companion.publishEvent -import com.tencent.bkrepo.repository.config.RepositoryProperties -import com.tencent.bkrepo.repository.dao.NodeDao +import com.tencent.bkrepo.common.metadata.config.RepositoryProperties +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao import com.tencent.bkrepo.repository.message.RepositoryMessageCode -import com.tencent.bkrepo.repository.model.TMetadata -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.model.TMetadata +import com.tencent.bkrepo.common.metadata.model.TNode +import com.tencent.bkrepo.common.metadata.service.metadata.MetadataService import com.tencent.bkrepo.repository.pojo.metadata.MetadataDeleteRequest import com.tencent.bkrepo.repository.pojo.metadata.MetadataSaveRequest -import com.tencent.bkrepo.repository.service.metadata.MetadataService -import com.tencent.bkrepo.repository.util.MetadataUtils -import com.tencent.bkrepo.repository.util.NodeEventFactory.buildMetadataDeletedEvent -import com.tencent.bkrepo.repository.util.NodeEventFactory.buildMetadataSavedEvent -import com.tencent.bkrepo.repository.util.NodeQueryHelper +import com.tencent.bkrepo.common.metadata.util.MetadataUtils +import com.tencent.bkrepo.common.metadata.util.NodeEventFactory.buildMetadataDeletedEvent +import com.tencent.bkrepo.common.metadata.util.NodeEventFactory.buildMetadataSavedEvent +import com.tencent.bkrepo.common.metadata.util.NodeQueryHelper import org.slf4j.LoggerFactory import org.springframework.context.annotation.Conditional import org.springframework.data.mongodb.core.query.Query @@ -69,7 +70,7 @@ import org.springframework.transaction.annotation.Transactional * 元数据服务实现类 */ @Service -@Conditional(DefaultCondition::class) +@Conditional(SyncCondition::class, DefaultCondition::class) class MetadataServiceImpl( private val nodeDao: NodeDao, private val repositoryProperties: RepositoryProperties, diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/util/MetadataUtils.kt b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/util/MetadataUtils.kt similarity index 98% rename from src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/util/MetadataUtils.kt rename to src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/util/MetadataUtils.kt index 213018fab5..1a4e4c5626 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/util/MetadataUtils.kt +++ b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/util/MetadataUtils.kt @@ -29,7 +29,7 @@ * SOFTWARE. */ -package com.tencent.bkrepo.repository.util +package com.tencent.bkrepo.common.metadata.util import com.tencent.bkrepo.common.api.exception.ErrorCodeException import com.tencent.bkrepo.common.artifact.constant.FORBID_STATUS @@ -41,7 +41,7 @@ import com.tencent.bkrepo.common.artifact.constant.METADATA_KEY_LINK_REPO import com.tencent.bkrepo.common.artifact.constant.SCAN_STATUS import com.tencent.bkrepo.common.security.util.SecurityUtils import com.tencent.bkrepo.repository.message.RepositoryMessageCode -import com.tencent.bkrepo.repository.model.TMetadata +import com.tencent.bkrepo.common.metadata.model.TMetadata import com.tencent.bkrepo.repository.pojo.metadata.ForbidType import com.tencent.bkrepo.repository.pojo.metadata.MetadataModel diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/util/NodeEventFactory.kt b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/util/NodeEventFactory.kt similarity index 98% rename from src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/util/NodeEventFactory.kt rename to src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/util/NodeEventFactory.kt index cd6ce08cc4..7a9066d2d9 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/util/NodeEventFactory.kt +++ b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/util/NodeEventFactory.kt @@ -25,7 +25,7 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.tencent.bkrepo.repository.util +package com.tencent.bkrepo.common.metadata.util import com.tencent.bkrepo.common.artifact.event.metadata.MetadataDeletedEvent import com.tencent.bkrepo.common.artifact.event.metadata.MetadataSavedEvent @@ -35,7 +35,7 @@ import com.tencent.bkrepo.common.artifact.event.node.NodeCreatedEvent import com.tencent.bkrepo.common.artifact.event.node.NodeDeletedEvent import com.tencent.bkrepo.common.artifact.event.node.NodeMovedEvent import com.tencent.bkrepo.common.artifact.event.node.NodeRenamedEvent -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.repository.pojo.metadata.MetadataDeleteRequest import com.tencent.bkrepo.repository.pojo.metadata.MetadataSaveRequest import com.tencent.bkrepo.repository.pojo.node.service.NodeMoveCopyRequest diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/util/NodeQueryHelper.kt b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/util/NodeQueryHelper.kt similarity index 98% rename from src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/util/NodeQueryHelper.kt rename to src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/util/NodeQueryHelper.kt index ca95543580..2d034f6526 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/util/NodeQueryHelper.kt +++ b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/util/NodeQueryHelper.kt @@ -25,18 +25,18 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.tencent.bkrepo.repository.util +package com.tencent.bkrepo.common.metadata.util import com.tencent.bkrepo.auth.api.ServicePermissionClient import com.tencent.bkrepo.common.api.constant.ensureSuffix +import com.tencent.bkrepo.common.api.util.EscapeUtils import com.tencent.bkrepo.common.artifact.path.PathUtils import com.tencent.bkrepo.common.artifact.path.PathUtils.escapeRegex import com.tencent.bkrepo.common.artifact.path.PathUtils.toFullPath import com.tencent.bkrepo.common.artifact.path.PathUtils.toPath import com.tencent.bkrepo.common.metadata.constant.FAKE_SHA256 +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.common.query.enums.OperationType -import com.tencent.bkrepo.common.query.util.MongoEscapeUtils -import com.tencent.bkrepo.repository.model.TNode import com.tencent.bkrepo.repository.pojo.metadata.MetadataModel import com.tencent.bkrepo.repository.pojo.node.NodeListOption import org.slf4j.LoggerFactory @@ -93,7 +93,7 @@ object NodeQueryHelper { Criteria.where(TNode::archived.name).isEqualTo(true), Criteria.where(TNode::compressed.name).isEqualTo(true), ) - path?.let { criteria.and(TNode::fullPath).regex("^${MongoEscapeUtils.escapeRegex(it)}") } + path?.let { criteria.and(TNode::fullPath).regex("^${EscapeUtils.escapeRegex(it)}") } val metadataCriteria = metadata.map { val elemCriteria = Criteria().andOperator( MetadataModel::key.isEqualTo(it.key), diff --git a/src/backend/common/common-query/query-mongo/src/main/kotlin/com/tencent/bkrepo/common/query/handler/impl/MatchHandler.kt b/src/backend/common/common-query/query-mongo/src/main/kotlin/com/tencent/bkrepo/common/query/handler/impl/MatchHandler.kt index 45b8eb8834..217845e759 100644 --- a/src/backend/common/common-query/query-mongo/src/main/kotlin/com/tencent/bkrepo/common/query/handler/impl/MatchHandler.kt +++ b/src/backend/common/common-query/query-mongo/src/main/kotlin/com/tencent/bkrepo/common/query/handler/impl/MatchHandler.kt @@ -31,10 +31,10 @@ package com.tencent.bkrepo.common.query.handler.impl +import com.tencent.bkrepo.common.api.util.EscapeUtils import com.tencent.bkrepo.common.query.enums.OperationType import com.tencent.bkrepo.common.query.handler.MongoQueryRuleHandler import com.tencent.bkrepo.common.query.model.Rule -import com.tencent.bkrepo.common.query.util.MongoEscapeUtils import org.springframework.data.mongodb.core.query.Criteria class MatchHandler : MongoQueryRuleHandler { @@ -44,7 +44,7 @@ class MatchHandler : MongoQueryRuleHandler { } override fun handle(rule: Rule.QueryRule): Criteria { - val escapedValue = MongoEscapeUtils.escapeRegexExceptWildcard(rule.value.toString()) + val escapedValue = EscapeUtils.escapeRegexExceptWildcard(rule.value.toString()) val regexPattern = escapedValue.replace("*", ".*") return Criteria.where(rule.field).regex("^$regexPattern$") } diff --git a/src/backend/common/common-query/query-mongo/src/main/kotlin/com/tencent/bkrepo/common/query/handler/impl/MatchIHandler.kt b/src/backend/common/common-query/query-mongo/src/main/kotlin/com/tencent/bkrepo/common/query/handler/impl/MatchIHandler.kt index 39cb0daf2b..ae5abf3f09 100644 --- a/src/backend/common/common-query/query-mongo/src/main/kotlin/com/tencent/bkrepo/common/query/handler/impl/MatchIHandler.kt +++ b/src/backend/common/common-query/query-mongo/src/main/kotlin/com/tencent/bkrepo/common/query/handler/impl/MatchIHandler.kt @@ -31,10 +31,10 @@ package com.tencent.bkrepo.common.query.handler.impl +import com.tencent.bkrepo.common.api.util.EscapeUtils import com.tencent.bkrepo.common.query.enums.OperationType import com.tencent.bkrepo.common.query.handler.MongoQueryRuleHandler import com.tencent.bkrepo.common.query.model.Rule -import com.tencent.bkrepo.common.query.util.MongoEscapeUtils import org.springframework.data.mongodb.core.query.Criteria /** @@ -47,7 +47,7 @@ class MatchIHandler : MongoQueryRuleHandler { } override fun handle(rule: Rule.QueryRule): Criteria { - val escapedValue = MongoEscapeUtils.escapeRegexExceptWildcard(rule.value.toString()) + val escapedValue = EscapeUtils.escapeRegexExceptWildcard(rule.value.toString()) val regexPattern = escapedValue.replace("*", ".*") return Criteria.where(rule.field).regex("^$regexPattern$", "i") } diff --git a/src/backend/common/common-query/query-mongo/src/main/kotlin/com/tencent/bkrepo/common/query/handler/impl/PrefixHandler.kt b/src/backend/common/common-query/query-mongo/src/main/kotlin/com/tencent/bkrepo/common/query/handler/impl/PrefixHandler.kt index f4bf8f893b..21a48e228d 100644 --- a/src/backend/common/common-query/query-mongo/src/main/kotlin/com/tencent/bkrepo/common/query/handler/impl/PrefixHandler.kt +++ b/src/backend/common/common-query/query-mongo/src/main/kotlin/com/tencent/bkrepo/common/query/handler/impl/PrefixHandler.kt @@ -31,10 +31,10 @@ package com.tencent.bkrepo.common.query.handler.impl +import com.tencent.bkrepo.common.api.util.EscapeUtils import com.tencent.bkrepo.common.query.enums.OperationType import com.tencent.bkrepo.common.query.handler.MongoQueryRuleHandler import com.tencent.bkrepo.common.query.model.Rule -import com.tencent.bkrepo.common.query.util.MongoEscapeUtils import org.springframework.data.mongodb.core.query.Criteria class PrefixHandler : MongoQueryRuleHandler { @@ -44,7 +44,7 @@ class PrefixHandler : MongoQueryRuleHandler { } override fun handle(rule: Rule.QueryRule): Criteria { - val escapedValue = MongoEscapeUtils.escapeRegex(rule.value.toString()) + val escapedValue = EscapeUtils.escapeRegex(rule.value.toString()) return Criteria.where(rule.field).regex("^$escapedValue") } } diff --git a/src/backend/common/common-query/query-mongo/src/main/kotlin/com/tencent/bkrepo/common/query/handler/impl/SuffixHandler.kt b/src/backend/common/common-query/query-mongo/src/main/kotlin/com/tencent/bkrepo/common/query/handler/impl/SuffixHandler.kt index 472478dff4..f05f9f0400 100644 --- a/src/backend/common/common-query/query-mongo/src/main/kotlin/com/tencent/bkrepo/common/query/handler/impl/SuffixHandler.kt +++ b/src/backend/common/common-query/query-mongo/src/main/kotlin/com/tencent/bkrepo/common/query/handler/impl/SuffixHandler.kt @@ -31,10 +31,10 @@ package com.tencent.bkrepo.common.query.handler.impl +import com.tencent.bkrepo.common.api.util.EscapeUtils import com.tencent.bkrepo.common.query.enums.OperationType import com.tencent.bkrepo.common.query.handler.MongoQueryRuleHandler import com.tencent.bkrepo.common.query.model.Rule -import com.tencent.bkrepo.common.query.util.MongoEscapeUtils import org.springframework.data.mongodb.core.query.Criteria class SuffixHandler : MongoQueryRuleHandler { @@ -44,7 +44,7 @@ class SuffixHandler : MongoQueryRuleHandler { } override fun handle(rule: Rule.QueryRule): Criteria { - val escapedValue = MongoEscapeUtils.escapeRegex(rule.value.toString()) + val escapedValue = EscapeUtils.escapeRegex(rule.value.toString()) return Criteria.where(rule.field).regex("$escapedValue$") } } diff --git a/src/backend/common/common-query/query-mongo/src/main/kotlin/com/tencent/bkrepo/common/query/util/MongoEscapeUtils.kt b/src/backend/common/common-query/query-mongo/src/main/kotlin/com/tencent/bkrepo/common/query/util/MongoEscapeUtils.kt deleted file mode 100644 index ddee501a71..0000000000 --- a/src/backend/common/common-query/query-mongo/src/main/kotlin/com/tencent/bkrepo/common/query/util/MongoEscapeUtils.kt +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.tencent.bkrepo.common.query.util - -import com.tencent.bkrepo.common.api.util.EscapeUtils - -object MongoEscapeUtils { - - /** - * 正则特殊符号转义 - */ - fun escapeRegex(input: String): String { - return EscapeUtils.escapeRegex(input) - } - - /** - * 正则特殊符号转义, 但不转义通配符 - */ - fun escapeRegexExceptWildcard(input: String): String { - return EscapeUtils.escapeRegexExceptWildcard(input) - } -} diff --git a/src/backend/job/biz-job/src/main/kotlin/com/tencent/bkrepo/job/batch/file/BasedRepositoryFileExpireResolver.kt b/src/backend/job/biz-job/src/main/kotlin/com/tencent/bkrepo/job/batch/file/BasedRepositoryFileExpireResolver.kt index ea5cac826c..bd8f2980d0 100644 --- a/src/backend/job/biz-job/src/main/kotlin/com/tencent/bkrepo/job/batch/file/BasedRepositoryFileExpireResolver.kt +++ b/src/backend/job/biz-job/src/main/kotlin/com/tencent/bkrepo/job/batch/file/BasedRepositoryFileExpireResolver.kt @@ -1,8 +1,8 @@ package com.tencent.bkrepo.job.batch.file +import com.tencent.bkrepo.common.api.util.EscapeUtils import com.tencent.bkrepo.common.mongo.constant.ID import com.tencent.bkrepo.common.mongo.constant.MIN_OBJECT_ID -import com.tencent.bkrepo.common.query.util.MongoEscapeUtils import com.tencent.bkrepo.common.storage.filesystem.cleanup.FileRetainResolver import com.tencent.bkrepo.job.DELETED_DATE import com.tencent.bkrepo.job.FOLDER @@ -136,7 +136,7 @@ class BasedRepositoryFileExpireResolver( ): Set> { val temp = mutableSetOf>() val prefixCri = pathPrefixs.map { - val escapedValue = MongoEscapeUtils.escapeRegex(it) + val escapedValue = EscapeUtils.escapeRegex(it) Criteria.where(FULL_PATH).regex("^$escapedValue") } val query = Query.query( diff --git a/src/backend/job/biz-job/src/main/kotlin/com/tencent/bkrepo/job/service/impl/ArchiveJobServiceImpl.kt b/src/backend/job/biz-job/src/main/kotlin/com/tencent/bkrepo/job/service/impl/ArchiveJobServiceImpl.kt index 7d54f2d38c..2a0195d6b8 100644 --- a/src/backend/job/biz-job/src/main/kotlin/com/tencent/bkrepo/job/service/impl/ArchiveJobServiceImpl.kt +++ b/src/backend/job/biz-job/src/main/kotlin/com/tencent/bkrepo/job/service/impl/ArchiveJobServiceImpl.kt @@ -4,9 +4,9 @@ import com.tencent.bkrepo.archive.api.ArchiveClient import com.tencent.bkrepo.archive.constant.ArchiveStorageClass import com.tencent.bkrepo.archive.request.ArchiveFileRequest import com.tencent.bkrepo.archive.request.UncompressFileRequest +import com.tencent.bkrepo.common.api.util.EscapeUtils import com.tencent.bkrepo.common.metadata.constant.FAKE_SHA256 import com.tencent.bkrepo.common.mongo.dao.util.sharding.HashShardingUtils -import com.tencent.bkrepo.common.query.util.MongoEscapeUtils import com.tencent.bkrepo.job.BATCH_SIZE import com.tencent.bkrepo.job.SHARDING_COUNT import com.tencent.bkrepo.job.batch.context.NodeContext @@ -109,7 +109,7 @@ class ArchiveJobServiceImpl( Criteria.where("compressed").isEqualTo(true), ) repoName?.let { criteria.and("repoName").isEqualTo(it) } - prefix?.let { criteria.and("fullPath").regex("^${MongoEscapeUtils.escapeRegex(it)}") } + prefix?.let { criteria.and("fullPath").regex("^${EscapeUtils.escapeRegex(it)}") } val metadataCriteria = metadata.map { val elemCriteria = Criteria().andOperator( MetadataModel::key.isEqualTo(it.key), diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/controller/cluster/ClusterMetadataController.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/controller/cluster/ClusterMetadataController.kt index dbea09313e..17a2a9e0b2 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/controller/cluster/ClusterMetadataController.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/controller/cluster/ClusterMetadataController.kt @@ -34,7 +34,7 @@ import com.tencent.bkrepo.common.service.util.ResponseBuilder import com.tencent.bkrepo.repository.api.cluster.ClusterMetadataClient import com.tencent.bkrepo.repository.pojo.metadata.MetadataDeleteRequest import com.tencent.bkrepo.repository.pojo.metadata.MetadataSaveRequest -import com.tencent.bkrepo.repository.service.metadata.MetadataService +import com.tencent.bkrepo.common.metadata.service.metadata.MetadataService import org.springframework.web.bind.annotation.RestController @RestController diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/controller/service/MetadataController.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/controller/service/MetadataController.kt index 00ccb52bed..30a54da116 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/controller/service/MetadataController.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/controller/service/MetadataController.kt @@ -36,7 +36,7 @@ import com.tencent.bkrepo.common.service.util.ResponseBuilder import com.tencent.bkrepo.repository.api.MetadataClient import com.tencent.bkrepo.repository.pojo.metadata.MetadataDeleteRequest import com.tencent.bkrepo.repository.pojo.metadata.MetadataSaveRequest -import com.tencent.bkrepo.repository.service.metadata.MetadataService +import com.tencent.bkrepo.common.metadata.service.metadata.MetadataService import org.springframework.web.bind.annotation.RestController /** diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/controller/user/UserBkCiWebhookController.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/controller/user/UserBkCiWebhookController.kt index 4485f51022..9eb72440b2 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/controller/user/UserBkCiWebhookController.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/controller/user/UserBkCiWebhookController.kt @@ -31,7 +31,7 @@ import com.tencent.bkrepo.common.api.exception.BadRequestException import com.tencent.bkrepo.common.api.exception.SystemErrorException import com.tencent.bkrepo.common.api.message.CommonMessageCode import com.tencent.bkrepo.common.api.util.readJsonString -import com.tencent.bkrepo.repository.config.RepositoryProperties +import com.tencent.bkrepo.common.metadata.config.RepositoryProperties import com.tencent.bkrepo.repository.pojo.webhook.BkCiDevXEnabledPayload import com.tencent.bkrepo.repository.service.webhook.BkciWebhookListener import io.swagger.annotations.Api diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/controller/user/UserMetadataController.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/controller/user/UserMetadataController.kt index 095310b883..e0a6f332dd 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/controller/user/UserMetadataController.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/controller/user/UserMetadataController.kt @@ -44,7 +44,7 @@ import com.tencent.bkrepo.repository.pojo.metadata.MetadataDeleteRequest import com.tencent.bkrepo.repository.pojo.metadata.MetadataSaveRequest import com.tencent.bkrepo.repository.pojo.metadata.UserMetadataDeleteRequest import com.tencent.bkrepo.repository.pojo.metadata.UserMetadataSaveRequest -import com.tencent.bkrepo.repository.service.metadata.MetadataService +import com.tencent.bkrepo.common.metadata.service.metadata.MetadataService import io.swagger.annotations.Api import io.swagger.annotations.ApiOperation import org.springframework.web.bind.annotation.DeleteMapping diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/job/DeletedNodeCleanupJob.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/job/DeletedNodeCleanupJob.kt index d35980d804..1235a38cfe 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/job/DeletedNodeCleanupJob.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/job/DeletedNodeCleanupJob.kt @@ -33,10 +33,10 @@ package com.tencent.bkrepo.repository.job import com.tencent.bkrepo.common.service.cluster.properties.ClusterProperties import com.tencent.bkrepo.common.service.log.LoggerHolder -import com.tencent.bkrepo.repository.dao.NodeDao +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao import com.tencent.bkrepo.common.metadata.dao.repo.RepositoryDao import com.tencent.bkrepo.repository.job.base.CenterNodeJob -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.common.metadata.model.TRepository import com.tencent.bkrepo.common.metadata.service.file.FileReferenceService import org.springframework.data.domain.PageRequest diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/job/NodeDeletedCorrectionJob.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/job/NodeDeletedCorrectionJob.kt index 68f0801b96..53ddd3de1a 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/job/NodeDeletedCorrectionJob.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/job/NodeDeletedCorrectionJob.kt @@ -33,8 +33,8 @@ package com.tencent.bkrepo.repository.job import com.tencent.bkrepo.common.service.log.LoggerHolder import com.tencent.bkrepo.repository.constant.SHARDING_COUNT -import com.tencent.bkrepo.repository.dao.NodeDao -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao +import com.tencent.bkrepo.common.metadata.model.TNode import org.springframework.data.mongodb.core.query.Criteria import org.springframework.data.mongodb.core.query.Query import org.springframework.data.mongodb.core.query.Update diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/job/PackageVersionCorrectionJob.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/job/PackageVersionCorrectionJob.kt index 33c8fe5c3e..1734ad01a7 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/job/PackageVersionCorrectionJob.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/job/PackageVersionCorrectionJob.kt @@ -36,7 +36,7 @@ import com.tencent.bkrepo.common.artifact.pojo.RepositoryType import com.tencent.bkrepo.common.mongo.dao.util.Pages import com.tencent.bkrepo.common.service.log.LoggerHolder import com.tencent.bkrepo.common.service.util.HttpContextHolder -import com.tencent.bkrepo.repository.dao.NodeDao +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao import com.tencent.bkrepo.repository.dao.PackageDao import com.tencent.bkrepo.repository.dao.PackageVersionDao import com.tencent.bkrepo.repository.model.TPackage diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/job/RootNodeCleanupJob.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/job/RootNodeCleanupJob.kt index 8992ba2fae..ea35489af4 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/job/RootNodeCleanupJob.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/job/RootNodeCleanupJob.kt @@ -33,8 +33,8 @@ package com.tencent.bkrepo.repository.job import com.tencent.bkrepo.common.service.log.LoggerHolder import com.tencent.bkrepo.repository.constant.SHARDING_COUNT -import com.tencent.bkrepo.repository.dao.NodeDao -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao +import com.tencent.bkrepo.common.metadata.model.TNode import org.springframework.data.mongodb.core.query.Query import org.springframework.data.mongodb.core.query.inValues import org.springframework.data.mongodb.core.query.where diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/job/base/SwitchableJob.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/job/base/SwitchableJob.kt index 74b8d0276c..1eb7e1361d 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/job/base/SwitchableJob.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/job/base/SwitchableJob.kt @@ -34,7 +34,7 @@ package com.tencent.bkrepo.repository.job.base import com.tencent.bkrepo.common.api.util.HumanReadable import com.tencent.bkrepo.common.api.util.executeAndMeasureTime import com.tencent.bkrepo.common.service.log.LoggerHolder -import com.tencent.bkrepo.repository.config.RepositoryProperties +import com.tencent.bkrepo.common.metadata.config.RepositoryProperties import org.springframework.beans.factory.annotation.Autowired /** diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/listener/NodeModifyEventListener.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/listener/NodeModifyEventListener.kt index 5be54eec15..4c156e9751 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/listener/NodeModifyEventListener.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/listener/NodeModifyEventListener.kt @@ -47,8 +47,8 @@ import com.tencent.bkrepo.common.artifact.path.PathUtils import com.tencent.bkrepo.common.artifact.path.PathUtils.combineFullPath import com.tencent.bkrepo.common.mongo.dao.AbstractMongoDao import com.tencent.bkrepo.common.mongo.dao.util.Pages -import com.tencent.bkrepo.repository.dao.NodeDao -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.repository.service.node.NodeService import org.slf4j.LoggerFactory import org.springframework.context.event.EventListener @@ -316,7 +316,7 @@ class NodeModifyEventListener( includePrefix: String? = null, sourceNodes: List? = null ) { - val action: ((List) -> Unit) = { nodeList -> + val action: ((List) -> Unit) = { nodeList -> nodeList.forEach { if (!sourceNodes.isNullOrEmpty() && !sourceNodes.contains(it.fullPath)) return@forEach updateCache( @@ -381,7 +381,7 @@ class NodeModifyEventListener( } val path = PathUtils.resolveParent(modifiedNode.srcFullPath!!) if (node.folder) { - val action: ((List) -> Unit) = { nodeList -> + val action: ((List) -> Unit) = { nodeList -> nodeList.forEach { sourceNodes.add(combineFullPath(modifiedNode.fullPath, it.fullPath.removePrefix(path))) } @@ -445,4 +445,4 @@ class NodeModifyEventListener( private const val FIXED_DELAY = 10000L private val IGNORE_PROJECT_PREFIX_LIST = listOf(CODE_PROJECT_PREFIX, CLOSED_SOURCE_PREFIX) } -} \ No newline at end of file +} diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/listener/NodeUpdateAccessDateEventListener.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/listener/NodeUpdateAccessDateEventListener.kt index 8e1119a293..dfa8a9b565 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/listener/NodeUpdateAccessDateEventListener.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/listener/NodeUpdateAccessDateEventListener.kt @@ -31,8 +31,8 @@ import com.tencent.bkrepo.common.artifact.event.ArtifactEventProperties import com.tencent.bkrepo.common.artifact.event.base.ArtifactEvent import com.tencent.bkrepo.common.artifact.event.base.EventType import com.tencent.bkrepo.common.mongo.constant.ID -import com.tencent.bkrepo.repository.dao.NodeDao -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao +import com.tencent.bkrepo.common.metadata.model.TNode import org.slf4j.LoggerFactory import org.springframework.data.mongodb.core.query.Query import org.springframework.data.mongodb.core.query.Update diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/model/TPackageVersion.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/model/TPackageVersion.kt index b1a923da67..d90c7b5091 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/model/TPackageVersion.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/model/TPackageVersion.kt @@ -31,6 +31,7 @@ package com.tencent.bkrepo.repository.model +import com.tencent.bkrepo.common.metadata.model.TMetadata import com.tencent.bkrepo.repository.model.TPackageVersion.Companion.VERSION_METADATA_IDX import com.tencent.bkrepo.repository.model.TPackageVersion.Companion.VERSION_METADATA_IDX_DEF import com.tencent.bkrepo.repository.model.TPackageVersion.Companion.VERSION_NAME_IDX diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/search/common/CommonQueryContext.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/search/common/CommonQueryContext.kt index 8b14171c1d..870a6a81d1 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/search/common/CommonQueryContext.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/search/common/CommonQueryContext.kt @@ -37,7 +37,7 @@ import com.tencent.bkrepo.common.query.builder.MongoQueryInterpreter import com.tencent.bkrepo.common.query.interceptor.QueryContext import com.tencent.bkrepo.common.query.model.QueryModel import com.tencent.bkrepo.common.query.model.Rule -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.repository.pojo.repo.RepositoryInfo import org.springframework.data.mongodb.core.query.Query diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/search/common/LocalDatetimeRuleInterceptor.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/search/common/LocalDatetimeRuleInterceptor.kt index 3a1e7fed44..0bc50484ec 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/search/common/LocalDatetimeRuleInterceptor.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/search/common/LocalDatetimeRuleInterceptor.kt @@ -31,7 +31,7 @@ import com.tencent.bkrepo.common.query.enums.OperationType import com.tencent.bkrepo.common.query.interceptor.QueryContext import com.tencent.bkrepo.common.query.interceptor.QueryRuleInterceptor import com.tencent.bkrepo.common.query.model.Rule -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.model.TNode import org.slf4j.LoggerFactory import org.springframework.data.mongodb.core.query.Criteria import org.springframework.stereotype.Component @@ -48,7 +48,7 @@ class LocalDatetimeRuleInterceptor : QueryRuleInterceptor { return rule is Rule.QueryRule && isSupportRule(rule) } - @Suppress("IMPLICIT_CAST_TO_ANY", "UNCHECKED_CAST") + @Suppress("UNCHECKED_CAST") override fun intercept(rule: Rule, context: QueryContext): Criteria { require(rule is Rule.QueryRule) diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/search/common/MetadataRuleInterceptor.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/search/common/MetadataRuleInterceptor.kt index a31d2928aa..7151d5f7cd 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/search/common/MetadataRuleInterceptor.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/search/common/MetadataRuleInterceptor.kt @@ -36,9 +36,10 @@ import com.tencent.bkrepo.common.query.interceptor.QueryContext import com.tencent.bkrepo.common.query.interceptor.QueryRuleInterceptor import com.tencent.bkrepo.common.query.model.Rule import com.tencent.bkrepo.repository.constant.METADATA_PREFIX -import com.tencent.bkrepo.repository.model.TMetadata -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.model.TMetadata +import com.tencent.bkrepo.common.metadata.model.TNode import org.springframework.data.mongodb.core.query.Criteria +import java.util.Locale /** * 元数据规则拦截器 @@ -60,7 +61,8 @@ class MetadataRuleInterceptor : QueryRuleInterceptor { // 历史数据以X-BKREPO-META-{key}设置元数据时未忽略大小写,查询时需要同时查询大小写key val criteria = if (key.contains(Regex(ALPHA_PATTERN))) { - val lowerKeyRule = Rule.QueryRule(TMetadata::key.name, key.toLowerCase(), OperationType.EQ).toFixed() + val lowerKeyRule = + Rule.QueryRule(TMetadata::key.name, key.lowercase(Locale.getDefault()), OperationType.EQ).toFixed() val lowerKeyNestedAndRule = Rule.NestedRule(mutableListOf(lowerKeyRule, valueRule)) val nestedOrRule = Rule.NestedRule(mutableListOf(nestedAndRule, lowerKeyNestedAndRule), Rule.NestedRule.RelationType.OR) diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/search/common/RepoNameRuleInterceptor.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/search/common/RepoNameRuleInterceptor.kt index d81518d3c5..19d2e5225f 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/search/common/RepoNameRuleInterceptor.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/search/common/RepoNameRuleInterceptor.kt @@ -46,7 +46,7 @@ import com.tencent.bkrepo.common.security.util.SecurityUtils import com.tencent.bkrepo.repository.pojo.node.NodeInfo import com.tencent.bkrepo.repository.pojo.repo.RepoListOption import com.tencent.bkrepo.repository.service.repo.RepositoryService -import com.tencent.bkrepo.repository.util.NodeQueryHelper.listPermissionPaths +import com.tencent.bkrepo.common.metadata.util.NodeQueryHelper.listPermissionPaths import org.slf4j.LoggerFactory import org.springframework.data.mongodb.core.query.Criteria import org.springframework.stereotype.Component diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/search/node/NodeModelInterceptor.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/search/node/NodeModelInterceptor.kt index ea73556752..d448bd3e31 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/search/node/NodeModelInterceptor.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/search/node/NodeModelInterceptor.kt @@ -39,7 +39,7 @@ import com.tencent.bkrepo.common.query.model.Rule import com.tencent.bkrepo.common.security.manager.PermissionManager import com.tencent.bkrepo.common.security.permission.PrincipalType import com.tencent.bkrepo.common.security.util.SecurityUtils -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.repository.search.common.ModelValidateInterceptor import org.slf4j.LoggerFactory diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/blocknode/BlockNodeServiceImpl.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/blocknode/BlockNodeServiceImpl.kt index 417922e2e8..c349c7cc98 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/blocknode/BlockNodeServiceImpl.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/blocknode/BlockNodeServiceImpl.kt @@ -30,7 +30,7 @@ package com.tencent.bkrepo.repository.service.blocknode import com.tencent.bkrepo.common.artifact.exception.NodeNotFoundException import com.tencent.bkrepo.common.metadata.dao.blocknode.BlockNodeDao import com.tencent.bkrepo.common.metadata.service.blocknode.impl.AbstractBlockNodeService -import com.tencent.bkrepo.repository.dao.NodeDao +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao import com.tencent.bkrepo.repository.pojo.node.NodeDetail import com.tencent.bkrepo.common.metadata.service.file.FileReferenceService import com.tencent.bkrepo.repository.service.node.impl.NodeBaseService diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/fs/impl/FsServiceImpl.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/fs/impl/FsServiceImpl.kt index edaff62bc8..fd76def54a 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/fs/impl/FsServiceImpl.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/fs/impl/FsServiceImpl.kt @@ -35,16 +35,16 @@ import com.tencent.bkrepo.common.metadata.constant.FAKE_MD5 import com.tencent.bkrepo.common.metadata.constant.FAKE_SHA256 import com.tencent.bkrepo.common.service.util.SpringContextUtils import com.tencent.bkrepo.common.service.cluster.condition.DefaultCondition -import com.tencent.bkrepo.repository.dao.NodeDao -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.repository.pojo.node.NodeDetail import com.tencent.bkrepo.repository.pojo.node.service.NodeCreateRequest import com.tencent.bkrepo.repository.pojo.node.service.NodeSetLengthRequest import com.tencent.bkrepo.repository.service.fs.FsService import com.tencent.bkrepo.repository.service.node.impl.NodeBaseService -import com.tencent.bkrepo.repository.util.MetadataUtils -import com.tencent.bkrepo.repository.util.NodeEventFactory -import com.tencent.bkrepo.repository.util.NodeQueryHelper +import com.tencent.bkrepo.common.metadata.util.MetadataUtils +import com.tencent.bkrepo.common.metadata.util.NodeEventFactory +import com.tencent.bkrepo.common.metadata.util.NodeQueryHelper import org.slf4j.LoggerFactory import org.springframework.context.annotation.Conditional import org.springframework.dao.DuplicateKeyException diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/fs/impl/center/CommitEdgeCenterFsServiceImpl.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/fs/impl/center/CommitEdgeCenterFsServiceImpl.kt index 287933512b..1962650ca7 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/fs/impl/center/CommitEdgeCenterFsServiceImpl.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/fs/impl/center/CommitEdgeCenterFsServiceImpl.kt @@ -30,8 +30,8 @@ package com.tencent.bkrepo.repository.service.fs.impl.center import com.tencent.bkrepo.common.security.util.SecurityUtils import com.tencent.bkrepo.common.service.cluster.properties.ClusterProperties import com.tencent.bkrepo.common.service.cluster.condition.CommitEdgeCenterCondition -import com.tencent.bkrepo.repository.dao.NodeDao -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.repository.pojo.node.service.NodeCreateRequest import com.tencent.bkrepo.repository.service.fs.impl.FsServiceImpl import org.springframework.context.annotation.Conditional diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/fs/impl/edge/EdgeFsServiceImpl.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/fs/impl/edge/EdgeFsServiceImpl.kt index c57caa4e88..81a720a9a6 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/fs/impl/edge/EdgeFsServiceImpl.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/fs/impl/edge/EdgeFsServiceImpl.kt @@ -32,8 +32,8 @@ import com.tencent.bkrepo.common.service.cluster.condition.CommitEdgeEdgeConditi import com.tencent.bkrepo.common.service.cluster.properties.ClusterProperties import com.tencent.bkrepo.common.service.feign.FeignClientFactory import com.tencent.bkrepo.repository.api.cluster.ClusterFsNodeClient -import com.tencent.bkrepo.repository.dao.NodeDao -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.repository.pojo.node.NodeDetail import com.tencent.bkrepo.repository.pojo.node.service.NodeCreateRequest import com.tencent.bkrepo.repository.pojo.node.service.NodeSetLengthRequest diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/metadata/impl/PackageMetadataServiceImpl.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/metadata/impl/PackageMetadataServiceImpl.kt index 7b570b8f47..d2e39e2a0a 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/metadata/impl/PackageMetadataServiceImpl.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/metadata/impl/PackageMetadataServiceImpl.kt @@ -39,7 +39,7 @@ import com.tencent.bkrepo.repository.model.TPackage import com.tencent.bkrepo.repository.model.TPackageVersion import com.tencent.bkrepo.repository.pojo.metadata.packages.PackageMetadataSaveRequest import com.tencent.bkrepo.repository.service.metadata.PackageMetadataService -import com.tencent.bkrepo.repository.util.MetadataUtils +import com.tencent.bkrepo.common.metadata.util.MetadataUtils import org.slf4j.LoggerFactory import org.springframework.stereotype.Service import org.springframework.transaction.annotation.Transactional diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeArchiveSupport.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeArchiveSupport.kt index dbc8aaa7ac..a01284ff54 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeArchiveSupport.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeArchiveSupport.kt @@ -4,12 +4,12 @@ import com.tencent.bkrepo.archive.api.ArchiveClient import com.tencent.bkrepo.archive.request.ArchiveFileRequest import com.tencent.bkrepo.archive.request.UncompressFileRequest import com.tencent.bkrepo.common.artifact.repository.context.ArtifactContextHolder -import com.tencent.bkrepo.repository.dao.NodeDao -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.repository.pojo.node.service.NodeArchiveRestoreRequest import com.tencent.bkrepo.repository.pojo.node.service.NodeArchiveRequest import com.tencent.bkrepo.repository.service.node.NodeArchiveOperation -import com.tencent.bkrepo.repository.util.NodeQueryHelper +import com.tencent.bkrepo.common.metadata.util.NodeQueryHelper import java.time.LocalDateTime import org.slf4j.LoggerFactory import org.springframework.data.mongodb.core.query.Update diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeBaseService.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeBaseService.kt index 8a0528643a..048d54b15d 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeBaseService.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeBaseService.kt @@ -59,10 +59,10 @@ import com.tencent.bkrepo.common.service.util.SpringContextUtils.Companion.publi import com.tencent.bkrepo.common.storage.core.StorageService import com.tencent.bkrepo.common.stream.constant.BinderType import com.tencent.bkrepo.common.stream.event.supplier.MessageSupplier -import com.tencent.bkrepo.repository.config.RepositoryProperties +import com.tencent.bkrepo.common.metadata.config.RepositoryProperties import com.tencent.bkrepo.repository.constant.SYSTEM_USER -import com.tencent.bkrepo.repository.dao.NodeDao -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.repository.pojo.metadata.MetadataModel import com.tencent.bkrepo.repository.pojo.node.NodeDetail import com.tencent.bkrepo.repository.pojo.node.NodeInfo @@ -73,10 +73,10 @@ import com.tencent.bkrepo.repository.pojo.node.service.NodeUpdateAccessDateReque import com.tencent.bkrepo.repository.pojo.node.service.NodeUpdateRequest import com.tencent.bkrepo.repository.service.node.NodeService import com.tencent.bkrepo.repository.service.repo.QuotaService -import com.tencent.bkrepo.repository.util.MetadataUtils -import com.tencent.bkrepo.repository.util.NodeEventFactory.buildCreatedEvent -import com.tencent.bkrepo.repository.util.NodeQueryHelper -import com.tencent.bkrepo.repository.util.NodeQueryHelper.listPermissionPaths +import com.tencent.bkrepo.common.metadata.util.MetadataUtils +import com.tencent.bkrepo.common.metadata.util.NodeEventFactory.buildCreatedEvent +import com.tencent.bkrepo.common.metadata.util.NodeQueryHelper +import com.tencent.bkrepo.common.metadata.util.NodeQueryHelper.listPermissionPaths import com.tencent.bkrepo.router.api.RouterControllerClient import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Autowired diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeCompressSupport.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeCompressSupport.kt index 87455cc5bc..01f7023236 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeCompressSupport.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeCompressSupport.kt @@ -1,11 +1,11 @@ package com.tencent.bkrepo.repository.service.node.impl -import com.tencent.bkrepo.repository.dao.NodeDao -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.repository.pojo.node.service.NodeCompressedRequest import com.tencent.bkrepo.repository.pojo.node.service.NodeUnCompressedRequest import com.tencent.bkrepo.repository.service.node.NodeCompressOperation -import com.tencent.bkrepo.repository.util.NodeQueryHelper +import com.tencent.bkrepo.common.metadata.util.NodeQueryHelper import org.slf4j.LoggerFactory import org.springframework.data.mongodb.core.query.Update import java.time.LocalDateTime diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeDeleteSupport.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeDeleteSupport.kt index da26725be1..a5eefcc980 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeDeleteSupport.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeDeleteSupport.kt @@ -33,17 +33,17 @@ import com.tencent.bkrepo.common.api.util.HumanReadable import com.tencent.bkrepo.common.artifact.path.PathUtils import com.tencent.bkrepo.common.artifact.router.RouterControllerProperties import com.tencent.bkrepo.common.service.util.SpringContextUtils.Companion.publishEvent -import com.tencent.bkrepo.repository.dao.NodeDao -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.repository.pojo.node.NodeDeleteResult import com.tencent.bkrepo.repository.pojo.node.NodeListOption import com.tencent.bkrepo.repository.pojo.node.service.NodeDeleteRequest import com.tencent.bkrepo.repository.pojo.node.service.NodesDeleteRequest import com.tencent.bkrepo.repository.service.node.NodeDeleteOperation import com.tencent.bkrepo.repository.service.repo.QuotaService -import com.tencent.bkrepo.repository.util.NodeEventFactory.buildDeletedEvent -import com.tencent.bkrepo.repository.util.NodeEventFactory.buildNodeCleanEvent -import com.tencent.bkrepo.repository.util.NodeQueryHelper +import com.tencent.bkrepo.common.metadata.util.NodeEventFactory.buildDeletedEvent +import com.tencent.bkrepo.common.metadata.util.NodeEventFactory.buildNodeCleanEvent +import com.tencent.bkrepo.common.metadata.util.NodeQueryHelper import com.tencent.bkrepo.router.api.RouterControllerClient import org.slf4j.LoggerFactory import org.springframework.dao.DuplicateKeyException diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeMoveCopySupport.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeMoveCopySupport.kt index 11af52065b..5e750e21ff 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeMoveCopySupport.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeMoveCopySupport.kt @@ -44,9 +44,9 @@ import com.tencent.bkrepo.common.service.util.SpringContextUtils.Companion.publi import com.tencent.bkrepo.common.storage.core.StorageService import com.tencent.bkrepo.common.storage.credentials.StorageCredentials import com.tencent.bkrepo.repository.constant.DEFAULT_STORAGE_CREDENTIALS_KEY -import com.tencent.bkrepo.repository.dao.NodeDao +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao import com.tencent.bkrepo.common.metadata.dao.repo.RepositoryDao -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.common.metadata.model.TRepository import com.tencent.bkrepo.repository.pojo.node.NodeDetail import com.tencent.bkrepo.repository.pojo.node.NodeListOption @@ -54,8 +54,8 @@ import com.tencent.bkrepo.repository.pojo.node.service.NodeMoveCopyRequest import com.tencent.bkrepo.repository.service.node.NodeMoveCopyOperation import com.tencent.bkrepo.repository.service.repo.QuotaService import com.tencent.bkrepo.common.metadata.service.repo.StorageCredentialService -import com.tencent.bkrepo.repository.util.NodeEventFactory -import com.tencent.bkrepo.repository.util.NodeQueryHelper +import com.tencent.bkrepo.common.metadata.util.NodeEventFactory +import com.tencent.bkrepo.common.metadata.util.NodeQueryHelper import org.slf4j.LoggerFactory import org.springframework.data.mongodb.core.query.Query import java.time.LocalDateTime diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeRenameSupport.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeRenameSupport.kt index 58f633b9cd..64d6f1cbb5 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeRenameSupport.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeRenameSupport.kt @@ -35,13 +35,13 @@ import com.tencent.bkrepo.common.api.exception.ErrorCodeException import com.tencent.bkrepo.common.artifact.message.ArtifactMessageCode import com.tencent.bkrepo.common.artifact.path.PathUtils import com.tencent.bkrepo.common.service.util.SpringContextUtils.Companion.publishEvent -import com.tencent.bkrepo.repository.dao.NodeDao -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.repository.pojo.node.NodeListOption import com.tencent.bkrepo.repository.pojo.node.service.NodeRenameRequest import com.tencent.bkrepo.repository.service.node.NodeRenameOperation -import com.tencent.bkrepo.repository.util.NodeEventFactory.buildRenamedEvent -import com.tencent.bkrepo.repository.util.NodeQueryHelper +import com.tencent.bkrepo.common.metadata.util.NodeEventFactory.buildRenamedEvent +import com.tencent.bkrepo.common.metadata.util.NodeQueryHelper import org.slf4j.LoggerFactory /** diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeRestoreSupport.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeRestoreSupport.kt index 111193026a..0408064030 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeRestoreSupport.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeRestoreSupport.kt @@ -39,8 +39,8 @@ import com.tencent.bkrepo.common.metadata.constant.FAKE_SHA256 import com.tencent.bkrepo.common.metadata.service.blocknode.BlockNodeService import com.tencent.bkrepo.common.security.util.SecurityUtils import com.tencent.bkrepo.fs.server.constant.FS_ATTR_KEY -import com.tencent.bkrepo.repository.dao.NodeDao -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.repository.pojo.node.ConflictStrategy import com.tencent.bkrepo.repository.pojo.node.NodeDeletedPoint import com.tencent.bkrepo.repository.pojo.node.NodeDetail @@ -49,15 +49,15 @@ import com.tencent.bkrepo.repository.pojo.node.NodeRestoreOption import com.tencent.bkrepo.repository.pojo.node.NodeRestoreResult import com.tencent.bkrepo.repository.service.node.NodeRestoreOperation import com.tencent.bkrepo.repository.service.node.impl.NodeBaseService.Companion.convertToDetail -import com.tencent.bkrepo.repository.util.MetadataUtils -import com.tencent.bkrepo.repository.util.NodeQueryHelper -import com.tencent.bkrepo.repository.util.NodeQueryHelper.nodeDeletedFolderQuery -import com.tencent.bkrepo.repository.util.NodeQueryHelper.nodeDeletedPointListQuery -import com.tencent.bkrepo.repository.util.NodeQueryHelper.nodeDeletedPointListQueryBySha256 -import com.tencent.bkrepo.repository.util.NodeQueryHelper.nodeDeletedPointQuery -import com.tencent.bkrepo.repository.util.NodeQueryHelper.nodeListQuery -import com.tencent.bkrepo.repository.util.NodeQueryHelper.nodeQuery -import com.tencent.bkrepo.repository.util.NodeQueryHelper.nodeRestoreUpdate +import com.tencent.bkrepo.common.metadata.util.MetadataUtils +import com.tencent.bkrepo.common.metadata.util.NodeQueryHelper +import com.tencent.bkrepo.common.metadata.util.NodeQueryHelper.nodeDeletedFolderQuery +import com.tencent.bkrepo.common.metadata.util.NodeQueryHelper.nodeDeletedPointListQuery +import com.tencent.bkrepo.common.metadata.util.NodeQueryHelper.nodeDeletedPointListQueryBySha256 +import com.tencent.bkrepo.common.metadata.util.NodeQueryHelper.nodeDeletedPointQuery +import com.tencent.bkrepo.common.metadata.util.NodeQueryHelper.nodeListQuery +import com.tencent.bkrepo.common.metadata.util.NodeQueryHelper.nodeQuery +import com.tencent.bkrepo.common.metadata.util.NodeQueryHelper.nodeRestoreUpdate import org.slf4j.LoggerFactory import org.springframework.dao.DuplicateKeyException import org.springframework.data.mongodb.core.FindAndModifyOptions diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeSearchServiceImpl.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeSearchServiceImpl.kt index 6b1cfd97c3..fefc5d2862 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeSearchServiceImpl.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeSearchServiceImpl.kt @@ -32,9 +32,9 @@ import com.tencent.bkrepo.common.api.util.HumanReadable import com.tencent.bkrepo.common.api.util.toJsonString import com.tencent.bkrepo.common.artifact.pojo.RepositoryType import com.tencent.bkrepo.common.query.model.QueryModel -import com.tencent.bkrepo.repository.config.RepositoryProperties -import com.tencent.bkrepo.repository.dao.NodeDao -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.config.RepositoryProperties +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.repository.pojo.node.NodeInfo import com.tencent.bkrepo.repository.pojo.repo.RepoListOption import com.tencent.bkrepo.repository.pojo.software.ProjectPackageOverview @@ -42,7 +42,7 @@ import com.tencent.bkrepo.repository.search.node.NodeQueryContext import com.tencent.bkrepo.repository.search.node.NodeQueryInterpreter import com.tencent.bkrepo.repository.service.node.NodeSearchService import com.tencent.bkrepo.repository.service.repo.RepositoryService -import com.tencent.bkrepo.repository.util.MetadataUtils +import com.tencent.bkrepo.common.metadata.util.MetadataUtils import org.slf4j.LoggerFactory import org.springframework.data.mongodb.core.query.Query import org.springframework.stereotype.Service diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeServiceImpl.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeServiceImpl.kt index 6e870b5dff..0ec4dd015b 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeServiceImpl.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeServiceImpl.kt @@ -35,8 +35,8 @@ import com.tencent.bkrepo.common.metadata.service.blocknode.BlockNodeService import com.tencent.bkrepo.common.service.cluster.condition.DefaultCondition import com.tencent.bkrepo.common.storage.core.StorageService import com.tencent.bkrepo.common.stream.event.supplier.MessageSupplier -import com.tencent.bkrepo.repository.config.RepositoryProperties -import com.tencent.bkrepo.repository.dao.NodeDao +import com.tencent.bkrepo.common.metadata.config.RepositoryProperties +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao import com.tencent.bkrepo.common.metadata.dao.repo.RepositoryDao import com.tencent.bkrepo.repository.pojo.node.NodeDeleteResult import com.tencent.bkrepo.repository.pojo.node.NodeDeletedPoint diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeStatsSupport.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeStatsSupport.kt index f37be2e0a3..c6cda79abc 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeStatsSupport.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/NodeStatsSupport.kt @@ -35,12 +35,12 @@ import com.tencent.bkrepo.common.api.constant.StringPool import com.tencent.bkrepo.common.api.exception.ErrorCodeException import com.tencent.bkrepo.common.artifact.api.ArtifactInfo import com.tencent.bkrepo.common.artifact.message.ArtifactMessageCode -import com.tencent.bkrepo.repository.dao.NodeDao -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.repository.pojo.node.NodeListOption import com.tencent.bkrepo.repository.pojo.node.NodeSizeInfo import com.tencent.bkrepo.repository.service.node.NodeStatsOperation -import com.tencent.bkrepo.repository.util.NodeQueryHelper +import com.tencent.bkrepo.common.metadata.util.NodeQueryHelper import org.springframework.data.mongodb.core.aggregation.Aggregation.group import org.springframework.data.mongodb.core.aggregation.Aggregation.match import org.springframework.data.mongodb.core.aggregation.Aggregation.newAggregation diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/center/CommitEdgeCenterNodeDeleteSupport.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/center/CommitEdgeCenterNodeDeleteSupport.kt index 70c7d35834..a6e1ef54c0 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/center/CommitEdgeCenterNodeDeleteSupport.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/center/CommitEdgeCenterNodeDeleteSupport.kt @@ -35,12 +35,12 @@ import com.tencent.bkrepo.common.mongo.constant.ID import com.tencent.bkrepo.common.mongo.constant.MIN_OBJECT_ID import com.tencent.bkrepo.common.security.util.SecurityUtils import com.tencent.bkrepo.common.service.cluster.properties.ClusterProperties -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.repository.pojo.node.NodeDeleteResult import com.tencent.bkrepo.repository.pojo.node.NodeListOption import com.tencent.bkrepo.repository.service.node.impl.NodeBaseService import com.tencent.bkrepo.repository.service.node.impl.NodeDeleteSupport -import com.tencent.bkrepo.repository.util.NodeQueryHelper +import com.tencent.bkrepo.common.metadata.util.NodeQueryHelper import org.bson.types.ObjectId import org.jboss.logging.Logger import org.springframework.data.domain.Sort diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/center/CommitEdgeCenterNodeMoveCopySupport.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/center/CommitEdgeCenterNodeMoveCopySupport.kt index f6d3f88a39..8260f7f59c 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/center/CommitEdgeCenterNodeMoveCopySupport.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/center/CommitEdgeCenterNodeMoveCopySupport.kt @@ -33,7 +33,7 @@ import com.tencent.bkrepo.common.artifact.path.PathUtils.toPath import com.tencent.bkrepo.common.metadata.util.ClusterUtils import com.tencent.bkrepo.common.metadata.util.ClusterUtils.isEdgeRequest import com.tencent.bkrepo.common.security.util.SecurityUtils -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.repository.pojo.node.NodeListOption import com.tencent.bkrepo.repository.service.node.impl.NodeBaseService import com.tencent.bkrepo.repository.service.node.impl.NodeMoveCopySupport diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/center/CommitEdgeCenterNodeRenameSupport.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/center/CommitEdgeCenterNodeRenameSupport.kt index b58dc82cd7..d7d2ee0164 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/center/CommitEdgeCenterNodeRenameSupport.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/center/CommitEdgeCenterNodeRenameSupport.kt @@ -34,7 +34,7 @@ import com.tencent.bkrepo.common.metadata.util.ClusterUtils import com.tencent.bkrepo.common.metadata.util.ClusterUtils.isEdgeRequest import com.tencent.bkrepo.common.security.util.SecurityUtils import com.tencent.bkrepo.common.service.cluster.properties.ClusterProperties -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.repository.service.node.impl.NodeBaseService import com.tencent.bkrepo.repository.service.node.impl.NodeRenameSupport import org.slf4j.LoggerFactory diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/center/CommitEdgeCenterNodeRestoreSupport.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/center/CommitEdgeCenterNodeRestoreSupport.kt index 78f631a335..f30024d701 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/center/CommitEdgeCenterNodeRestoreSupport.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/center/CommitEdgeCenterNodeRestoreSupport.kt @@ -30,11 +30,11 @@ package com.tencent.bkrepo.repository.service.node.impl.center import com.tencent.bkrepo.common.api.exception.ErrorCodeException import com.tencent.bkrepo.common.artifact.message.ArtifactMessageCode import com.tencent.bkrepo.common.metadata.util.ClusterUtils -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.repository.pojo.node.ConflictStrategy import com.tencent.bkrepo.repository.service.node.impl.NodeBaseService import com.tencent.bkrepo.repository.service.node.impl.NodeRestoreSupport -import com.tencent.bkrepo.repository.util.NodeQueryHelper +import com.tencent.bkrepo.common.metadata.util.NodeQueryHelper class CommitEdgeCenterNodeRestoreSupport( nodeBaseService: NodeBaseService diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/center/CommitEdgeCenterNodeServiceImpl.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/center/CommitEdgeCenterNodeServiceImpl.kt index 990985ed35..d735141394 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/center/CommitEdgeCenterNodeServiceImpl.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/center/CommitEdgeCenterNodeServiceImpl.kt @@ -41,11 +41,11 @@ import com.tencent.bkrepo.common.service.cluster.condition.CommitEdgeCenterCondi import com.tencent.bkrepo.common.service.cluster.properties.ClusterProperties import com.tencent.bkrepo.common.storage.core.StorageService import com.tencent.bkrepo.common.stream.event.supplier.MessageSupplier -import com.tencent.bkrepo.repository.config.RepositoryProperties -import com.tencent.bkrepo.repository.dao.NodeDao +import com.tencent.bkrepo.common.metadata.config.RepositoryProperties +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao import com.tencent.bkrepo.common.metadata.dao.repo.RepositoryDao -import com.tencent.bkrepo.repository.model.TMetadata -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.model.TMetadata +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.common.metadata.model.TRepository import com.tencent.bkrepo.repository.pojo.metadata.MetadataModel import com.tencent.bkrepo.repository.pojo.node.NodeDeleteResult @@ -62,7 +62,7 @@ import com.tencent.bkrepo.repository.service.node.impl.NodeRestoreSupport import com.tencent.bkrepo.repository.service.node.impl.NodeServiceImpl import com.tencent.bkrepo.repository.service.repo.QuotaService import com.tencent.bkrepo.common.metadata.service.repo.StorageCredentialService -import com.tencent.bkrepo.repository.util.NodeQueryHelper +import com.tencent.bkrepo.common.metadata.util.NodeQueryHelper import com.tencent.bkrepo.router.api.RouterControllerClient import org.slf4j.LoggerFactory import org.springframework.context.annotation.Conditional diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/edge/EdgeNodeBaseService.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/edge/EdgeNodeBaseService.kt index 1dba1b3f74..5d1e44edf0 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/edge/EdgeNodeBaseService.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/edge/EdgeNodeBaseService.kt @@ -40,9 +40,9 @@ import com.tencent.bkrepo.common.service.feign.FeignClientFactory import com.tencent.bkrepo.common.storage.core.StorageService import com.tencent.bkrepo.common.stream.event.supplier.MessageSupplier import com.tencent.bkrepo.repository.api.cluster.ClusterNodeClient -import com.tencent.bkrepo.repository.config.RepositoryProperties -import com.tencent.bkrepo.repository.dao.NodeDao -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.config.RepositoryProperties +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.repository.pojo.node.NodeDetail import com.tencent.bkrepo.repository.pojo.node.service.NodeCreateRequest import com.tencent.bkrepo.repository.pojo.node.service.NodeUpdateAccessDateRequest diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/edge/EdgeNodeServiceImpl.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/edge/EdgeNodeServiceImpl.kt index 441967a8bd..d3d4764e7a 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/edge/EdgeNodeServiceImpl.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/node/impl/edge/EdgeNodeServiceImpl.kt @@ -43,8 +43,8 @@ import com.tencent.bkrepo.common.service.cluster.condition.CommitEdgeEdgeConditi import com.tencent.bkrepo.common.service.cluster.properties.ClusterProperties import com.tencent.bkrepo.common.storage.core.StorageService import com.tencent.bkrepo.common.stream.event.supplier.MessageSupplier -import com.tencent.bkrepo.repository.config.RepositoryProperties -import com.tencent.bkrepo.repository.dao.NodeDao +import com.tencent.bkrepo.common.metadata.config.RepositoryProperties +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao import com.tencent.bkrepo.repository.pojo.node.NodeDeleteResult import com.tencent.bkrepo.repository.pojo.node.NodeDeletedPoint import com.tencent.bkrepo.repository.pojo.node.NodeDetail diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/packages/impl/PackageBaseService.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/packages/impl/PackageBaseService.kt index 434018122b..3d87e6c0c0 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/packages/impl/PackageBaseService.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/packages/impl/PackageBaseService.kt @@ -40,7 +40,7 @@ import com.tencent.bkrepo.repository.pojo.packages.request.PackagePopulateReques import com.tencent.bkrepo.repository.pojo.packages.request.PackageVersionCreateRequest import com.tencent.bkrepo.repository.pojo.packages.request.PopulatedPackageVersion import com.tencent.bkrepo.repository.service.packages.PackageService -import com.tencent.bkrepo.repository.util.MetadataUtils +import com.tencent.bkrepo.common.metadata.util.MetadataUtils import org.slf4j.LoggerFactory import org.springframework.dao.DuplicateKeyException import java.time.LocalDateTime diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/packages/impl/PackageServiceImpl.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/packages/impl/PackageServiceImpl.kt index 53ba63700d..a5382c7020 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/packages/impl/PackageServiceImpl.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/packages/impl/PackageServiceImpl.kt @@ -60,7 +60,7 @@ import com.tencent.bkrepo.repository.pojo.packages.request.PackageUpdateRequest import com.tencent.bkrepo.repository.pojo.packages.request.PackageVersionCreateRequest import com.tencent.bkrepo.repository.pojo.packages.request.PackageVersionUpdateRequest import com.tencent.bkrepo.repository.search.packages.PackageSearchInterpreter -import com.tencent.bkrepo.repository.util.MetadataUtils +import com.tencent.bkrepo.common.metadata.util.MetadataUtils import com.tencent.bkrepo.repository.util.PackageEventFactory import com.tencent.bkrepo.repository.util.PackageEventFactory.buildCreatedEvent import com.tencent.bkrepo.repository.util.PackageEventFactory.buildUpdatedEvent diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/packages/impl/PackageStatisticsServiceImpl.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/packages/impl/PackageStatisticsServiceImpl.kt index 8c0369e56c..0c0a68a9e1 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/packages/impl/PackageStatisticsServiceImpl.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/packages/impl/PackageStatisticsServiceImpl.kt @@ -1,6 +1,6 @@ package com.tencent.bkrepo.repository.service.packages.impl -import com.tencent.bkrepo.common.query.util.MongoEscapeUtils +import com.tencent.bkrepo.common.api.util.EscapeUtils import com.tencent.bkrepo.repository.dao.PackageDao import com.tencent.bkrepo.repository.model.TPackage import com.tencent.bkrepo.repository.pojo.software.CountResult @@ -9,6 +9,7 @@ import com.tencent.bkrepo.repository.service.packages.PackageStatisticsService import org.springframework.data.mongodb.core.aggregation.Aggregation import org.springframework.data.mongodb.core.query.Criteria import org.springframework.stereotype.Service +import java.util.Locale @Service class PackageStatisticsServiceImpl( @@ -20,10 +21,10 @@ class PackageStatisticsServiceImpl( projectId: String, packageName: String? ): List { - val criteria = Criteria.where(TPackage::type.name).`is`(repoType.toUpperCase()) + val criteria = Criteria.where(TPackage::type.name).`is`(repoType.uppercase(Locale.getDefault())) projectId.let { criteria.and(TPackage::projectId.name).`is`(projectId) } packageName?.let { - val escapedValue = MongoEscapeUtils.escapeRegexExceptWildcard(packageName) + val escapedValue = EscapeUtils.escapeRegexExceptWildcard(packageName) val regexPattern = escapedValue.replace("*", ".*") criteria.and(TPackage::name.name).regex("^$regexPattern$") } diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/packages/impl/SoftwarePackageServiceImpl.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/packages/impl/SoftwarePackageServiceImpl.kt index 6e67c92bd5..6852ccafe9 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/packages/impl/SoftwarePackageServiceImpl.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/packages/impl/SoftwarePackageServiceImpl.kt @@ -1,12 +1,12 @@ package com.tencent.bkrepo.repository.service.packages.impl import com.tencent.bkrepo.common.api.pojo.Page +import com.tencent.bkrepo.common.api.util.EscapeUtils import com.tencent.bkrepo.common.artifact.constant.PUBLIC_PROXY_PROJECT import com.tencent.bkrepo.common.artifact.pojo.RepositoryType import com.tencent.bkrepo.common.query.enums.OperationType import com.tencent.bkrepo.common.query.model.QueryModel import com.tencent.bkrepo.common.query.model.Rule -import com.tencent.bkrepo.common.query.util.MongoEscapeUtils import com.tencent.bkrepo.repository.dao.PackageDao import com.tencent.bkrepo.repository.model.TPackage import com.tencent.bkrepo.repository.pojo.repo.RepositoryInfo @@ -49,7 +49,7 @@ class SoftwarePackageServiceImpl( transCri(criteria, allSoftRepo) } packageName?.let { - val escapedValue = MongoEscapeUtils.escapeRegexExceptWildcard(packageName) + val escapedValue = EscapeUtils.escapeRegexExceptWildcard(packageName) val regexPattern = escapedValue.replace("*", ".*") criteria.and(TPackage::name.name).regex("^$regexPattern$") } diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/repo/impl/RepositoryServiceImpl.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/repo/impl/RepositoryServiceImpl.kt index 379948cfd8..9083ffde56 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/repo/impl/RepositoryServiceImpl.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/repo/impl/RepositoryServiceImpl.kt @@ -63,8 +63,8 @@ import com.tencent.bkrepo.common.service.cluster.condition.DefaultCondition import com.tencent.bkrepo.common.service.util.SpringContextUtils.Companion.publishEvent import com.tencent.bkrepo.common.storage.credentials.StorageCredentials import com.tencent.bkrepo.common.stream.event.supplier.MessageSupplier -import com.tencent.bkrepo.repository.config.RepositoryProperties -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.config.RepositoryProperties +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.repository.pojo.node.NodeSizeInfo import com.tencent.bkrepo.repository.pojo.project.RepoRangeQueryRequest import com.tencent.bkrepo.repository.pojo.proxy.ProxyChannelCreateRequest diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/repo/impl/center/CommitEdgeCenterRepositoryServiceImpl.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/repo/impl/center/CommitEdgeCenterRepositoryServiceImpl.kt index 37bbfd28bf..d6adb16b40 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/repo/impl/center/CommitEdgeCenterRepositoryServiceImpl.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/repo/impl/center/CommitEdgeCenterRepositoryServiceImpl.kt @@ -49,7 +49,7 @@ import com.tencent.bkrepo.common.service.cluster.condition.CommitEdgeCenterCondi import com.tencent.bkrepo.common.service.cluster.properties.ClusterProperties import com.tencent.bkrepo.common.service.util.SpringContextUtils import com.tencent.bkrepo.common.stream.event.supplier.MessageSupplier -import com.tencent.bkrepo.repository.config.RepositoryProperties +import com.tencent.bkrepo.common.metadata.config.RepositoryProperties import com.tencent.bkrepo.repository.pojo.repo.RepoCreateRequest import com.tencent.bkrepo.repository.pojo.repo.RepoDeleteRequest import com.tencent.bkrepo.repository.pojo.repo.RepositoryDetail diff --git a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/repo/impl/edge/EdgeRepositoryServiceImpl.kt b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/repo/impl/edge/EdgeRepositoryServiceImpl.kt index 58382b2799..8ee4872f8f 100644 --- a/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/repo/impl/edge/EdgeRepositoryServiceImpl.kt +++ b/src/backend/repository/biz-repository/src/main/kotlin/com/tencent/bkrepo/repository/service/repo/impl/edge/EdgeRepositoryServiceImpl.kt @@ -40,7 +40,7 @@ import com.tencent.bkrepo.common.service.exception.RemoteErrorCodeException import com.tencent.bkrepo.common.service.feign.FeignClientFactory import com.tencent.bkrepo.common.stream.event.supplier.MessageSupplier import com.tencent.bkrepo.repository.api.cluster.ClusterRepositoryClient -import com.tencent.bkrepo.repository.config.RepositoryProperties +import com.tencent.bkrepo.common.metadata.config.RepositoryProperties import com.tencent.bkrepo.repository.pojo.repo.RepoCreateRequest import com.tencent.bkrepo.repository.pojo.repo.RepoDeleteRequest import com.tencent.bkrepo.repository.pojo.repo.RepoUpdateRequest diff --git a/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/FileReferenceServiceTest.kt b/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/FileReferenceServiceTest.kt index 76493f36fd..7e19b7e20a 100644 --- a/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/FileReferenceServiceTest.kt +++ b/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/FileReferenceServiceTest.kt @@ -39,7 +39,7 @@ import com.tencent.bkrepo.repository.UT_REPO_NAME import com.tencent.bkrepo.repository.UT_STORAGE_CREDENTIALS_KEY import com.tencent.bkrepo.repository.UT_USER import com.tencent.bkrepo.common.metadata.dao.file.FileReferenceDao -import com.tencent.bkrepo.repository.dao.NodeDao +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao import com.tencent.bkrepo.repository.pojo.credendials.StorageCredentialsCreateRequest import com.tencent.bkrepo.repository.pojo.node.service.NodeCreateRequest import com.tencent.bkrepo.common.metadata.service.file.FileReferenceService diff --git a/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/MetadataServiceTest.kt b/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/MetadataServiceTest.kt index 741ffef69e..e00e0427a6 100644 --- a/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/MetadataServiceTest.kt +++ b/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/MetadataServiceTest.kt @@ -36,12 +36,12 @@ import com.tencent.bkrepo.repository.UT_PROJECT_ID import com.tencent.bkrepo.repository.UT_REPO_NAME import com.tencent.bkrepo.repository.UT_USER import com.tencent.bkrepo.common.metadata.dao.file.FileReferenceDao -import com.tencent.bkrepo.repository.dao.NodeDao +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao import com.tencent.bkrepo.repository.pojo.metadata.MetadataDeleteRequest import com.tencent.bkrepo.repository.pojo.metadata.MetadataModel import com.tencent.bkrepo.repository.pojo.metadata.MetadataSaveRequest import com.tencent.bkrepo.repository.pojo.node.service.NodeCreateRequest -import com.tencent.bkrepo.repository.service.metadata.MetadataService +import com.tencent.bkrepo.common.metadata.service.metadata.MetadataService import com.tencent.bkrepo.repository.service.node.NodeService import com.tencent.bkrepo.common.metadata.service.project.ProjectService import com.tencent.bkrepo.repository.service.repo.RepositoryService diff --git a/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/NodeQueryWithoutShardingKeyTest.kt b/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/NodeQueryWithoutShardingKeyTest.kt index e3edc5b9fa..aec2dcafc6 100644 --- a/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/NodeQueryWithoutShardingKeyTest.kt +++ b/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/NodeQueryWithoutShardingKeyTest.kt @@ -32,7 +32,7 @@ import com.tencent.bkrepo.repository.UT_REPO_NAME import com.tencent.bkrepo.repository.UT_USER import com.tencent.bkrepo.repository.constant.SHARDING_COUNT import com.tencent.bkrepo.common.metadata.dao.file.FileReferenceDao -import com.tencent.bkrepo.repository.dao.NodeDao +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao import com.tencent.bkrepo.repository.pojo.metadata.MetadataModel import com.tencent.bkrepo.repository.pojo.node.NodeDetail import com.tencent.bkrepo.repository.pojo.node.NodeListOption diff --git a/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/NodeSearchServiceTest.kt b/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/NodeSearchServiceTest.kt index 799106ca7a..5876a1958b 100644 --- a/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/NodeSearchServiceTest.kt +++ b/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/NodeSearchServiceTest.kt @@ -44,7 +44,7 @@ import com.tencent.bkrepo.repository.UT_PROJECT_ID import com.tencent.bkrepo.repository.UT_REPO_NAME import com.tencent.bkrepo.repository.UT_USER import com.tencent.bkrepo.common.metadata.dao.file.FileReferenceDao -import com.tencent.bkrepo.repository.dao.NodeDao +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao import com.tencent.bkrepo.repository.pojo.metadata.MetadataModel import com.tencent.bkrepo.repository.pojo.node.NodeInfo import com.tencent.bkrepo.repository.pojo.node.service.NodeCreateRequest diff --git a/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/NodeServiceTest.kt b/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/NodeServiceTest.kt index 588a40d321..63ad884f2d 100644 --- a/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/NodeServiceTest.kt +++ b/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/NodeServiceTest.kt @@ -42,7 +42,7 @@ import com.tencent.bkrepo.repository.UT_PROJECT_ID import com.tencent.bkrepo.repository.UT_REPO_NAME import com.tencent.bkrepo.repository.UT_USER import com.tencent.bkrepo.common.metadata.dao.file.FileReferenceDao -import com.tencent.bkrepo.repository.dao.NodeDao +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao import com.tencent.bkrepo.repository.pojo.metadata.MetadataModel import com.tencent.bkrepo.repository.pojo.node.NodeListOption import com.tencent.bkrepo.repository.pojo.node.service.NodeCreateRequest diff --git a/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/RepositoryServiceTest.kt b/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/RepositoryServiceTest.kt index e7ebfb552b..6e73af97b4 100644 --- a/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/RepositoryServiceTest.kt +++ b/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/RepositoryServiceTest.kt @@ -47,7 +47,7 @@ import com.tencent.bkrepo.repository.UT_REPO_DISPLAY import com.tencent.bkrepo.repository.UT_REPO_NAME import com.tencent.bkrepo.repository.UT_STORAGE_CREDENTIALS_KEY import com.tencent.bkrepo.repository.UT_USER -import com.tencent.bkrepo.repository.config.RepositoryProperties +import com.tencent.bkrepo.common.metadata.config.RepositoryProperties import com.tencent.bkrepo.repository.constant.SYSTEM_USER import com.tencent.bkrepo.repository.pojo.credendials.StorageCredentialsCreateRequest import com.tencent.bkrepo.repository.pojo.project.ProjectCreateRequest diff --git a/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/ServiceBaseTest.kt b/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/ServiceBaseTest.kt index 6ed4733ed9..22008dcdf9 100644 --- a/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/ServiceBaseTest.kt +++ b/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/ServiceBaseTest.kt @@ -59,8 +59,8 @@ import com.tencent.bkrepo.repository.UT_REPO_DESC import com.tencent.bkrepo.repository.UT_REPO_DISPLAY import com.tencent.bkrepo.repository.UT_REPO_NAME import com.tencent.bkrepo.repository.UT_USER -import com.tencent.bkrepo.repository.config.RepositoryProperties -import com.tencent.bkrepo.repository.dao.NodeDao +import com.tencent.bkrepo.common.metadata.config.RepositoryProperties +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao import com.tencent.bkrepo.common.metadata.dao.project.ProjectDao import com.tencent.bkrepo.common.metadata.listener.ResourcePermissionListener import com.tencent.bkrepo.repository.pojo.project.ProjectCreateRequest diff --git a/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/StorageCredentialServiceTest.kt b/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/StorageCredentialServiceTest.kt index 3ae0bcfa4e..7af7d0be84 100644 --- a/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/StorageCredentialServiceTest.kt +++ b/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/StorageCredentialServiceTest.kt @@ -43,7 +43,7 @@ import com.tencent.bkrepo.common.storage.credentials.StorageCredentials import com.tencent.bkrepo.repository.UT_REGION import com.tencent.bkrepo.repository.UT_STORAGE_CREDENTIALS_KEY import com.tencent.bkrepo.repository.UT_USER -import com.tencent.bkrepo.repository.dao.NodeDao +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao import com.tencent.bkrepo.repository.pojo.credendials.StorageCredentialsCreateRequest import com.tencent.bkrepo.repository.pojo.credendials.StorageCredentialsUpdateRequest import com.tencent.bkrepo.repository.service.repo.RepositoryService diff --git a/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/node/NodeRestoreSupportTest.kt b/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/node/NodeRestoreSupportTest.kt index 397ad05da0..5a7f6949df 100644 --- a/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/node/NodeRestoreSupportTest.kt +++ b/src/backend/repository/biz-repository/src/test/kotlin/com/tencent/bkrepo/repository/service/node/NodeRestoreSupportTest.kt @@ -38,8 +38,8 @@ import com.tencent.bkrepo.repository.UT_PROJECT_ID import com.tencent.bkrepo.repository.UT_REPO_NAME import com.tencent.bkrepo.repository.constant.SYSTEM_USER import com.tencent.bkrepo.common.metadata.dao.file.FileReferenceDao -import com.tencent.bkrepo.repository.dao.NodeDao -import com.tencent.bkrepo.repository.model.TNode +import com.tencent.bkrepo.common.metadata.dao.node.NodeDao +import com.tencent.bkrepo.common.metadata.model.TNode import com.tencent.bkrepo.repository.pojo.node.ConflictStrategy import com.tencent.bkrepo.repository.pojo.node.NodeRestoreOption import com.tencent.bkrepo.repository.pojo.node.service.NodeCreateRequest