Skip to content

Commit

Permalink
feat: 单体兼容性调整 TencentBlueKing#2202
Browse files Browse the repository at this point in the history
* feat: 单体兼容性调整 TencentBlueKing#2202

* feat: 代码调整 TencentBlueKing#2202
  • Loading branch information
zacYL authored Jun 3, 2024
1 parent 07e86fa commit 20cf255
Show file tree
Hide file tree
Showing 28 changed files with 47 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import org.springframework.web.bind.annotation.RestController
@Api("Proxy管理接口")
@RestController
@RequestMapping("/api/proxy")
class ProxyController(
class AuthProxyController(
private val proxyService: ProxyService
) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import org.springframework.stereotype.Repository
* 临时token数据访问层
*/
@Repository
class TemporaryTokenDao : SimpleMongoDao<TTemporaryToken>() {
class AuthTemporaryTokenDao : SimpleMongoDao<TTemporaryToken>() {

/**
* 根据[token]查找临时token信息
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ package com.tencent.bkrepo.auth.service.impl
import com.tencent.bkrepo.auth.model.TTemporaryToken
import com.tencent.bkrepo.auth.pojo.token.TemporaryTokenCreateRequest
import com.tencent.bkrepo.auth.pojo.token.TemporaryTokenInfo
import com.tencent.bkrepo.auth.dao.TemporaryTokenDao
import com.tencent.bkrepo.auth.dao.AuthTemporaryTokenDao
import com.tencent.bkrepo.auth.service.TemporaryTokenService
import com.tencent.bkrepo.common.api.constant.StringPool
import com.tencent.bkrepo.common.api.util.Preconditions
Expand All @@ -50,7 +50,7 @@ import java.util.UUID
@Service("authTemporaryTokenServiceImpl")
@Conditional(DefaultCondition::class)
class TemporaryTokenServiceImpl(
private val temporaryTokenRepository: TemporaryTokenDao
private val temporaryTokenRepository: AuthTemporaryTokenDao
) : TemporaryTokenService {

override fun createToken(request: TemporaryTokenCreateRequest): List<TemporaryTokenInfo> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

package com.tencent.bkrepo.auth.service.impl.center

import com.tencent.bkrepo.auth.dao.TemporaryTokenDao
import com.tencent.bkrepo.auth.dao.AuthTemporaryTokenDao
import com.tencent.bkrepo.auth.service.impl.TemporaryTokenServiceImpl
import com.tencent.bkrepo.common.service.cluster.CommitEdgeCenterCondition
import org.springframework.context.annotation.Conditional
Expand All @@ -36,7 +36,7 @@ import org.springframework.stereotype.Service
@Service
@Conditional(CommitEdgeCenterCondition::class)
class CommitEdgeCenterTemporaryTokenServiceImpl(
temporaryTokenRepository: TemporaryTokenDao
temporaryTokenRepository: AuthTemporaryTokenDao
) : TemporaryTokenServiceImpl(
temporaryTokenRepository
)
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ package com.tencent.bkrepo.auth.service.impl.edge
import com.tencent.bkrepo.auth.api.cluster.ClusterTemporaryTokenClient
import com.tencent.bkrepo.auth.pojo.token.TemporaryTokenCreateRequest
import com.tencent.bkrepo.auth.pojo.token.TemporaryTokenInfo
import com.tencent.bkrepo.auth.dao.TemporaryTokenDao
import com.tencent.bkrepo.auth.dao.AuthTemporaryTokenDao
import com.tencent.bkrepo.auth.service.impl.TemporaryTokenServiceImpl
import com.tencent.bkrepo.common.service.cluster.ClusterProperties
import com.tencent.bkrepo.common.service.cluster.CommitEdgeEdgeCondition
Expand All @@ -41,7 +41,7 @@ import org.springframework.stereotype.Service
@Service
@Conditional(CommitEdgeEdgeCondition::class)
class CommitEdgeTemporaryTokenServiceImpl(
temporaryTokenRepository: TemporaryTokenDao,
temporaryTokenRepository: AuthTemporaryTokenDao,
private val clusterProperties: ClusterProperties
) : TemporaryTokenServiceImpl(
temporaryTokenRepository
Expand Down
1 change: 1 addition & 0 deletions src/backend/boot-assembly/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ dependencies {
implementation(project(":lfs:biz-lfs"))
implementation(project(":ddc:biz-ddc"))
implementation(project(":archive:biz-archive"))
implementation(project(":router-controller:biz-router-controller"))
}

configurations.all {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import org.slf4j.LoggerFactory
import org.springframework.context.event.EventListener
import org.springframework.dao.DuplicateKeyException
import org.springframework.scheduling.annotation.Async
import org.springframework.stereotype.Component
import java.time.Duration
import java.time.LocalDateTime
import java.time.ZoneId
Expand All @@ -48,7 +47,6 @@ import java.time.format.DateTimeFormatter
/**
* 记录制品访问时间,用于统计项目制品使用习惯
*/
@Component
class ArtifactAccessRecorder(
private val preloadProperties: ArtifactPreloadProperties,
private val artifactAccessRecordDao: ArtifactAccessRecordDao,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,11 @@ import com.tencent.bkrepo.repository.pojo.node.NodeListOption
import com.tencent.bkrepo.repository.pojo.repo.RepositoryInfo
import org.slf4j.LoggerFactory
import org.springframework.data.domain.PageRequest
import org.springframework.stereotype.Service
import java.time.Duration
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.util.concurrent.TimeUnit

@Service
class ArtifactPreloadPlanServiceImpl(
private val nodeClient: NodeClient,
private val repositoryClient: RepositoryClient,
Expand Down Expand Up @@ -148,7 +146,7 @@ class ArtifactPreloadPlanServiceImpl(
if (sizeNotMatch || pathNotMatch || createTimeNotMatch) {
logger.info(
"${node.projectId}/${node.repoName}${node.fullPath} not match preload strategy, " +
"node size[${node.size}], node createdDateTime[$createdDateTime]"
"node size[${node.size}], node createdDateTime[$createdDateTime]"
)
return null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,9 @@ import com.tencent.bkrepo.common.artifact.message.ArtifactMessageCode.ARTIFACT_P
import com.tencent.bkrepo.common.artifact.message.ArtifactMessageCode.ARTIFACT_PRELOAD_STRATEGY_NOT_FOUND
import org.slf4j.LoggerFactory
import org.springframework.scheduling.support.CronExpression
import org.springframework.stereotype.Service
import java.time.LocalDateTime
import java.util.regex.PatternSyntaxException

@Service
class ArtifactPreloadStrategyServiceImpl(
private val artifactPreloadStrategyDao: ArtifactPreloadStrategyDao,
private val preloadProperties: ArtifactPreloadProperties,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,10 @@ import com.tencent.bkrepo.common.storage.core.cache.event.CacheFileDeletedEvent
import org.slf4j.LoggerFactory
import org.springframework.context.event.EventListener
import org.springframework.scheduling.annotation.Async
import org.springframework.stereotype.Component

/**
* 缓存文件相关事件监听器
*/
@Component
class CacheFileEventListener(
private val properties: ArtifactPreloadProperties,
private val preloadPlanService: ArtifactPreloadPlanService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import com.tencent.bkrepo.common.storage.monitor.measureThroughput
import com.tencent.bkrepo.common.storage.util.existReal
import com.tencent.bkrepo.repository.api.StorageCredentialsClient
import org.slf4j.LoggerFactory
import org.springframework.stereotype.Component
import java.nio.file.Files
import java.nio.file.Paths
import java.nio.file.attribute.FileTime
Expand All @@ -58,7 +57,6 @@ import java.util.concurrent.TimeUnit
/**
* 制品加载器,负责将制品加载到存储缓存中
*/
@Component
class DefaultPreloadPlanExecutor(
private val preloadProperties: ArtifactPreloadProperties,
private val cacheStorageService: StorageService,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available.
*
* Copyright (C) 2023 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.
*/

dependencies {
api(project(":router-controller:api-router-controller"))
api(project(":common:common-mongo"))
api(project(":common:common-query:query-mongo"))
api(project(":common:common-service"))
api(project(":common:common-security"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
*/

dependencies {
api(project(":router-controller:api-router-controller"))
api(project(":common:common-mongo"))
api(project(":common:common-query:query-mongo"))
api(project(":common:common-service"))
api(project(":common:common-security"))
}
implementation(project(":router-controller:biz-router-controller"))
}

0 comments on commit 20cf255

Please sign in to comment.