From 15ea08a7af9981d0ce7970f208ab3a65605af06e Mon Sep 17 00:00:00 2001 From: RJ Date: Mon, 5 Jun 2023 14:46:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E3=80=90=E5=8A=A0=E9=80=9F=E6=95=B0?= =?UTF-8?q?=E6=8D=AETurbo=E3=80=91=E5=8A=A0=E9=80=9F=E6=AC=A1=E6=95=B0?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=A0=B9=E6=8D=AE=E5=9C=BA=E6=99=AF=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=20#81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/turbo/biz-turbo/build.gradle.kts | 1 + .../com/tencent/devops/turbo/service/TurboWorkStatService.kt | 4 ++-- .../kotlin/com/tencent/devops/common/api/util/OkhttpUtils.kt | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/backend/turbo/biz-turbo/build.gradle.kts b/src/backend/turbo/biz-turbo/build.gradle.kts index 8be24062..62bf066b 100644 --- a/src/backend/turbo/biz-turbo/build.gradle.kts +++ b/src/backend/turbo/biz-turbo/build.gradle.kts @@ -1,6 +1,7 @@ dependencies { api(project(":api-turbo")) api(project(":model-turbo")) + api(project(":common-turbo:common-turbo-api")) api(project(":common-turbo:common-turbo-client")) api(project(":common-turbo:common-turbo-web")) api(project(":common-turbo:common-turbo-quartz")) diff --git a/src/backend/turbo/biz-turbo/src/main/kotlin/com/tencent/devops/turbo/service/TurboWorkStatService.kt b/src/backend/turbo/biz-turbo/src/main/kotlin/com/tencent/devops/turbo/service/TurboWorkStatService.kt index 36f8df36..7ecd785b 100644 --- a/src/backend/turbo/biz-turbo/src/main/kotlin/com/tencent/devops/turbo/service/TurboWorkStatService.kt +++ b/src/backend/turbo/biz-turbo/src/main/kotlin/com/tencent/devops/turbo/service/TurboWorkStatService.kt @@ -4,7 +4,7 @@ package com.tencent.devops.turbo.service import com.fasterxml.jackson.core.type.TypeReference import com.tencent.devops.common.api.exception.TurboException import com.tencent.devops.common.api.exception.code.TURBO_THIRDPARTY_SYSTEM_FAIL -import com.tencent.devops.common.api.util.OkhttpUtil +import com.tencent.devops.common.api.util.OkhttpUtils import com.tencent.devops.common.util.JsonUtil import com.tencent.devops.turbo.dao.repository.TurboRecordRepository import com.tencent.devops.turbo.dao.repository.TurboWorkJobStatsDataRepository @@ -41,7 +41,7 @@ class TurboWorkStatService @Autowired constructor( */ fun getTbsWorkStatData(turboRecordId: String): TurboWorkStatsDto { val tbsWorkStatDataStr: String = try { - OkhttpUtil.doGet( + OkhttpUtils.doGet( url = "$tbsRootPath/api/v1/disttask/work_stats/?decode_job=1&task_id=$turboRecordId" ) } catch (e: Exception) { diff --git a/src/backend/turbo/common-turbo/common-turbo-api/src/main/kotlin/com/tencent/devops/common/api/util/OkhttpUtils.kt b/src/backend/turbo/common-turbo/common-turbo-api/src/main/kotlin/com/tencent/devops/common/api/util/OkhttpUtils.kt index deee1bfd..681aa30a 100644 --- a/src/backend/turbo/common-turbo/common-turbo-api/src/main/kotlin/com/tencent/devops/common/api/util/OkhttpUtils.kt +++ b/src/backend/turbo/common-turbo/common-turbo-api/src/main/kotlin/com/tencent/devops/common/api/util/OkhttpUtils.kt @@ -28,7 +28,7 @@ object OkhttpUtils { .url(url) .get() if (headers.isNotEmpty()) { - headers.forEach { key, value -> + headers.forEach { (key, value) -> requestBuilder.addHeader(key, value) } }