From 543b902566540f3a08022bc4553a814a9f91dd0c Mon Sep 17 00:00:00 2001 From: yaoxuwan Date: Thu, 27 Apr 2023 17:56:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8D=87=E7=BA=A7devops-framework?= =?UTF-8?q?=E7=89=88=E6=9C=AC=20#73?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auth/api/ServiceTemporaryTokenResource.kt | 2 - .../ServiceTemporaryTokenResourceImpl.kt | 2 + .../otel/mongodb/OtelMongoConfiguration.kt | 12 +- .../otel/mongodb/TraceCommandListener.kt | 137 ------------------ ...aceMongoClientSettingsBuilderCustomizer.kt | 42 ------ .../resource/OtelResourceConfiguration.kt | 50 ------- .../otel/resource/OtelResourceProperties.kt | 35 ----- .../otel/resource/OtelResourceProvider.kt | 50 ------- .../replication/api/ClusterNodeClient.kt | 2 - .../replication/api/ReplicaTaskClient.kt | 2 - .../service/ServiceClusterNodeController.kt | 2 + .../service/ServiceReplicaTaskController.kt | 2 + 12 files changed, 8 insertions(+), 330 deletions(-) delete mode 100644 src/backend/common/common-service/src/main/kotlin/com/tencent/bkrepo/common/service/otel/mongodb/TraceCommandListener.kt delete mode 100644 src/backend/common/common-service/src/main/kotlin/com/tencent/bkrepo/common/service/otel/mongodb/TraceMongoClientSettingsBuilderCustomizer.kt delete mode 100644 src/backend/common/common-service/src/main/kotlin/com/tencent/bkrepo/common/service/otel/resource/OtelResourceConfiguration.kt delete mode 100644 src/backend/common/common-service/src/main/kotlin/com/tencent/bkrepo/common/service/otel/resource/OtelResourceProperties.kt delete mode 100644 src/backend/common/common-service/src/main/kotlin/com/tencent/bkrepo/common/service/otel/resource/OtelResourceProvider.kt diff --git a/src/backend/auth/api-auth/src/main/kotlin/com/tencent/bkrepo/auth/api/ServiceTemporaryTokenResource.kt b/src/backend/auth/api-auth/src/main/kotlin/com/tencent/bkrepo/auth/api/ServiceTemporaryTokenResource.kt index 8411fc9853..a22728a663 100644 --- a/src/backend/auth/api-auth/src/main/kotlin/com/tencent/bkrepo/auth/api/ServiceTemporaryTokenResource.kt +++ b/src/backend/auth/api-auth/src/main/kotlin/com/tencent/bkrepo/auth/api/ServiceTemporaryTokenResource.kt @@ -44,12 +44,10 @@ import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.PathVariable import org.springframework.web.bind.annotation.PostMapping import org.springframework.web.bind.annotation.RequestBody -import org.springframework.web.bind.annotation.RequestMapping @Api("临时token服务接口") @Primary @FeignClient(AUTH_SERVICE_NAME, contextId = "ServiceTemporaryTokenResource") -@RequestMapping("/service/temporary/token") interface ServiceTemporaryTokenResource { @ApiOperation("创建临时token") diff --git a/src/backend/auth/biz-auth/src/main/kotlin/com/tencent/bkrepo/auth/resource/ServiceTemporaryTokenResourceImpl.kt b/src/backend/auth/biz-auth/src/main/kotlin/com/tencent/bkrepo/auth/resource/ServiceTemporaryTokenResourceImpl.kt index 3205e2677f..0f97ce4efc 100644 --- a/src/backend/auth/biz-auth/src/main/kotlin/com/tencent/bkrepo/auth/resource/ServiceTemporaryTokenResourceImpl.kt +++ b/src/backend/auth/biz-auth/src/main/kotlin/com/tencent/bkrepo/auth/resource/ServiceTemporaryTokenResourceImpl.kt @@ -37,12 +37,14 @@ import com.tencent.bkrepo.auth.pojo.token.TemporaryTokenInfo import com.tencent.bkrepo.auth.service.TemporaryTokenService import com.tencent.bkrepo.common.api.pojo.Response import com.tencent.bkrepo.common.service.util.ResponseBuilder +import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController /** * 临时token服务接口实现类 */ @RestController +@RequestMapping("/service/temporary/token") class ServiceTemporaryTokenResourceImpl( private val temporaryTokenService: TemporaryTokenService ) : ServiceTemporaryTokenResource { diff --git a/src/backend/common/common-service/src/main/kotlin/com/tencent/bkrepo/common/service/otel/mongodb/OtelMongoConfiguration.kt b/src/backend/common/common-service/src/main/kotlin/com/tencent/bkrepo/common/service/otel/mongodb/OtelMongoConfiguration.kt index bdc65aa629..60d7bee1ed 100644 --- a/src/backend/common/common-service/src/main/kotlin/com/tencent/bkrepo/common/service/otel/mongodb/OtelMongoConfiguration.kt +++ b/src/backend/common/common-service/src/main/kotlin/com/tencent/bkrepo/common/service/otel/mongodb/OtelMongoConfiguration.kt @@ -41,20 +41,12 @@ import org.springframework.context.annotation.Configuration @ConditionalOnClass(OtelTracer::class, MongoClientImpl::class) class OtelMongoConfiguration { - @Bean - fun traceMongoClientSettingsBuilderCustomizer( - tracer: Tracer, - customizers: ObjectProvider> - ): TraceMongoClientSettingsBuilderCustomizer { - return TraceMongoClientSettingsBuilderCustomizer(tracer, customizers.ifAvailable.orEmpty()) - } - - @Bean +// @Bean fun dbMongoSpanCustomizer(): TraceMongoSpanCustomizer { return DBMongoSpanCustomizer() } - @Bean +// @Bean fun netMongoSpanCustomizer(): TraceMongoSpanCustomizer { return NetMongoSpanCustomizer() } diff --git a/src/backend/common/common-service/src/main/kotlin/com/tencent/bkrepo/common/service/otel/mongodb/TraceCommandListener.kt b/src/backend/common/common-service/src/main/kotlin/com/tencent/bkrepo/common/service/otel/mongodb/TraceCommandListener.kt deleted file mode 100644 index 6ed3a47c4c..0000000000 --- a/src/backend/common/common-service/src/main/kotlin/com/tencent/bkrepo/common/service/otel/mongodb/TraceCommandListener.kt +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 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.service.otel.mongodb - -import com.mongodb.event.CommandFailedEvent -import com.mongodb.event.CommandListener -import com.mongodb.event.CommandStartedEvent -import com.mongodb.event.CommandSucceededEvent -import org.bson.BsonDocument -import org.bson.BsonValue -import org.slf4j.LoggerFactory -import org.springframework.cloud.sleuth.Span -import org.springframework.cloud.sleuth.Tracer -import java.util.concurrent.ConcurrentHashMap -import java.util.function.Consumer - -class TraceCommandListener( - private val tracer: Tracer, - private val customizers: List -) : CommandListener { - - private val requestContext = ConcurrentHashMap() - - override fun commandStarted(event: CommandStartedEvent) { - val databaseName = event.databaseName - if ("admin" == databaseName) { - return - } - - val parent = tracer.currentSpan() - if (parent == null) { - return - } - val childSpanBuilder = tracer.spanBuilder() - childSpanBuilder.setParent(parent.context()) - - val commandName = event.commandName - val command = event.command - val collectionName = getCollectionName(command, commandName) - - childSpanBuilder.name(getSpanName(commandName, collectionName)) - .kind(Span.Kind.CLIENT) - - if (collectionName != null) { - childSpanBuilder.tag("db.mongodb.collection", collectionName) - } - - customizers.forEach(Consumer { customizer: TraceMongoSpanCustomizer -> - customizer.customizeCommandStartSpan( - event, - childSpanBuilder - ) - }) - - val childSpan = childSpanBuilder.start() - requestContext[event.requestId] = childSpan - if (logger.isDebugEnabled) { - logger.debug("Created a child span [$childSpan] for mongo instrumentation") - } - } - - override fun commandSucceeded(event: CommandSucceededEvent) { - val span = requestContext[event.requestId] ?: return - logger.debug("Get a child span [$span] from request context") - span.end() - requestContext.remove(event.requestId) - } - - override fun commandFailed(event: CommandFailedEvent) { - val span = requestContext[event.requestId] ?: return - logger.debug("Get a child span [$span] from request context") - span.error(event.throwable) - span.end() - requestContext.remove(event.requestId) - } - - private fun getCollectionName(command: BsonDocument, commandName: String): String? { - if (COMMANDS_WITH_COLLECTION_NAME.contains(commandName)) { - val collectionName = getNonEmptyBsonString(command[commandName]) - if (collectionName != null) { - return collectionName - } - } - // 其他的一些命令,例如getMore,包含字段 {"collection": collectionName} - return getNonEmptyBsonString(command["collection"]) - } - - private fun getNonEmptyBsonString(bsonValue: BsonValue?): String? { - if (bsonValue == null || !bsonValue.isString) { - return null - } - val stringValue = bsonValue.asString().value.trim { it <= ' ' } - return stringValue.ifEmpty { null } - } - - private fun getSpanName(commandName: String, collectionName: String?): String { - return if (collectionName == null) { - commandName - } else { - "$collectionName.$commandName" - } - } - - companion object { - private val logger = LoggerFactory.getLogger(TraceCommandListener::class.java) - val COMMANDS_WITH_COLLECTION_NAME = setOf( - "aggregate", "count", "distinct", "mapReduce", "geoSearch", "delete", "find", "findAndModify", - "insert", "update", "collMod", "compact", "convertToCapped", "create", "createIndexes", "drop", - "dropIndexes", "killCursors", "listIndexes", "reIndex" - ) - } -} diff --git a/src/backend/common/common-service/src/main/kotlin/com/tencent/bkrepo/common/service/otel/mongodb/TraceMongoClientSettingsBuilderCustomizer.kt b/src/backend/common/common-service/src/main/kotlin/com/tencent/bkrepo/common/service/otel/mongodb/TraceMongoClientSettingsBuilderCustomizer.kt deleted file mode 100644 index de91a38fc7..0000000000 --- a/src/backend/common/common-service/src/main/kotlin/com/tencent/bkrepo/common/service/otel/mongodb/TraceMongoClientSettingsBuilderCustomizer.kt +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 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.service.otel.mongodb - -import com.mongodb.MongoClientSettings -import org.springframework.boot.autoconfigure.mongo.MongoClientSettingsBuilderCustomizer -import org.springframework.cloud.sleuth.Tracer - -class TraceMongoClientSettingsBuilderCustomizer( - private val tracer: Tracer, - private val customizers: List -): MongoClientSettingsBuilderCustomizer { - - override fun customize(clientSettingsBuilder: MongoClientSettings.Builder) { - clientSettingsBuilder.addCommandListener(TraceCommandListener(tracer, customizers)) - } -} diff --git a/src/backend/common/common-service/src/main/kotlin/com/tencent/bkrepo/common/service/otel/resource/OtelResourceConfiguration.kt b/src/backend/common/common-service/src/main/kotlin/com/tencent/bkrepo/common/service/otel/resource/OtelResourceConfiguration.kt deleted file mode 100644 index e007d5cfbd..0000000000 --- a/src/backend/common/common-service/src/main/kotlin/com/tencent/bkrepo/common/service/otel/resource/OtelResourceConfiguration.kt +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 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.service.otel.resource - -import io.opentelemetry.sdk.resources.Resource -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty -import org.springframework.boot.context.properties.EnableConfigurationProperties -import org.springframework.cloud.sleuth.otel.bridge.OtelTracer -import org.springframework.context.annotation.Bean -import org.springframework.context.annotation.Configuration -import java.util.function.Supplier - -@Configuration(proxyBeanMethods = false) -@EnableConfigurationProperties(OtelResourceProperties::class) -@ConditionalOnProperty(value = ["spring.sleuth.enabled"], matchIfMissing = true) -@ConditionalOnClass(OtelTracer::class) -class OtelResourceConfiguration { - - @Bean - fun otelResourceProvider(properties: OtelResourceProperties): Supplier { - return OtelResourceProvider(properties).provide() - } - -} diff --git a/src/backend/common/common-service/src/main/kotlin/com/tencent/bkrepo/common/service/otel/resource/OtelResourceProperties.kt b/src/backend/common/common-service/src/main/kotlin/com/tencent/bkrepo/common/service/otel/resource/OtelResourceProperties.kt deleted file mode 100644 index 27260a53b7..0000000000 --- a/src/backend/common/common-service/src/main/kotlin/com/tencent/bkrepo/common/service/otel/resource/OtelResourceProperties.kt +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 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.service.otel.resource - -import org.springframework.boot.context.properties.ConfigurationProperties - -@ConfigurationProperties("spring.sleuth.otel.resource") -data class OtelResourceProperties ( - var attributes: Map = mapOf() -) diff --git a/src/backend/common/common-service/src/main/kotlin/com/tencent/bkrepo/common/service/otel/resource/OtelResourceProvider.kt b/src/backend/common/common-service/src/main/kotlin/com/tencent/bkrepo/common/service/otel/resource/OtelResourceProvider.kt deleted file mode 100644 index d7fc3f8cc6..0000000000 --- a/src/backend/common/common-service/src/main/kotlin/com/tencent/bkrepo/common/service/otel/resource/OtelResourceProvider.kt +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 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.service.otel.resource - -import io.opentelemetry.api.common.Attributes -import io.opentelemetry.sdk.resources.Resource -import java.util.function.Supplier - -/** - * Otel自定义资源配置 - */ -class OtelResourceProvider( - private val properties: OtelResourceProperties -) { - - fun provide(): Supplier { - val attributesBuilder = Attributes.builder() - properties.attributes.forEach(attributesBuilder::put) - return Supplier { - Resource.create( - attributesBuilder.build() - ) - } - } -} diff --git a/src/backend/replication/api-replication/src/main/kotlin/com/tencent/bkrepo/replication/api/ClusterNodeClient.kt b/src/backend/replication/api-replication/src/main/kotlin/com/tencent/bkrepo/replication/api/ClusterNodeClient.kt index 9f5fb6cf7c..26f57dbcd1 100644 --- a/src/backend/replication/api-replication/src/main/kotlin/com/tencent/bkrepo/replication/api/ClusterNodeClient.kt +++ b/src/backend/replication/api-replication/src/main/kotlin/com/tencent/bkrepo/replication/api/ClusterNodeClient.kt @@ -35,12 +35,10 @@ import org.springframework.cloud.openfeign.FeignClient import org.springframework.context.annotation.Primary import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.PathVariable -import org.springframework.web.bind.annotation.RequestMapping @Api("分发服务操作接口") @Primary @FeignClient(REPLICATION_SERVICE_NAME, contextId = "ServiceClusterNodeClient") -@RequestMapping("/service/cluster") interface ClusterNodeClient { @GetMapping("/{name}") diff --git a/src/backend/replication/api-replication/src/main/kotlin/com/tencent/bkrepo/replication/api/ReplicaTaskClient.kt b/src/backend/replication/api-replication/src/main/kotlin/com/tencent/bkrepo/replication/api/ReplicaTaskClient.kt index 770b09f811..e713574e4b 100644 --- a/src/backend/replication/api-replication/src/main/kotlin/com/tencent/bkrepo/replication/api/ReplicaTaskClient.kt +++ b/src/backend/replication/api-replication/src/main/kotlin/com/tencent/bkrepo/replication/api/ReplicaTaskClient.kt @@ -37,12 +37,10 @@ import org.springframework.cloud.openfeign.FeignClient import org.springframework.context.annotation.Primary import org.springframework.web.bind.annotation.PostMapping import org.springframework.web.bind.annotation.RequestBody -import org.springframework.web.bind.annotation.RequestMapping @Api("同步任务服务操作接口") @Primary @FeignClient(REPLICATION_SERVICE_NAME, contextId = "ReplicaTaskClient") -@RequestMapping("/service/task") interface ReplicaTaskClient { @ApiOperation("创建任务") diff --git a/src/backend/replication/biz-replication/src/main/kotlin/com/tencent/bkrepo/replication/controller/service/ServiceClusterNodeController.kt b/src/backend/replication/biz-replication/src/main/kotlin/com/tencent/bkrepo/replication/controller/service/ServiceClusterNodeController.kt index 78b0604c02..62b024a345 100644 --- a/src/backend/replication/biz-replication/src/main/kotlin/com/tencent/bkrepo/replication/controller/service/ServiceClusterNodeController.kt +++ b/src/backend/replication/biz-replication/src/main/kotlin/com/tencent/bkrepo/replication/controller/service/ServiceClusterNodeController.kt @@ -32,9 +32,11 @@ import com.tencent.bkrepo.common.service.util.ResponseBuilder import com.tencent.bkrepo.replication.api.ClusterNodeClient import com.tencent.bkrepo.replication.pojo.cluster.ClusterNodeInfo import com.tencent.bkrepo.replication.service.ClusterNodeService +import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController @RestController +@RequestMapping("/service/cluster") class ServiceClusterNodeController( private val clusterNodeService: ClusterNodeService ) : ClusterNodeClient { diff --git a/src/backend/replication/biz-replication/src/main/kotlin/com/tencent/bkrepo/replication/controller/service/ServiceReplicaTaskController.kt b/src/backend/replication/biz-replication/src/main/kotlin/com/tencent/bkrepo/replication/controller/service/ServiceReplicaTaskController.kt index 315ccb8703..f352effc88 100644 --- a/src/backend/replication/biz-replication/src/main/kotlin/com/tencent/bkrepo/replication/controller/service/ServiceReplicaTaskController.kt +++ b/src/backend/replication/biz-replication/src/main/kotlin/com/tencent/bkrepo/replication/controller/service/ServiceReplicaTaskController.kt @@ -33,9 +33,11 @@ import com.tencent.bkrepo.replication.api.ReplicaTaskClient import com.tencent.bkrepo.replication.pojo.task.ReplicaTaskInfo import com.tencent.bkrepo.replication.pojo.task.request.ReplicaTaskCreateRequest import com.tencent.bkrepo.replication.service.ReplicaTaskService +import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController @RestController +@RequestMapping("/service/task") class ServiceReplicaTaskController( private val replicaTaskService: ReplicaTaskService ) : ReplicaTaskClient {