From 7982b51042b7bd924f092893c6cc22ee64da98ab Mon Sep 17 00:00:00 2001 From: greysonfang Date: Tue, 7 Jan 2025 19:25:16 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat=EF=BC=9A=E6=96=B0=E5=A2=9Eservice?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E7=94=A8=E4=BA=8E=E8=8E=B7=E5=8F=96=E6=B5=81?= =?UTF-8?q?=E6=B0=B4=E7=BA=BF=E7=BB=84=E4=B8=8B=E6=B5=81=E6=B0=B4=E7=BA=BF?= =?UTF-8?q?=20#11383?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../process/api/service/ServicePipelineViewResource.kt | 10 ++++++++++ .../process/api/ServicePipelineViewResourceImpl.kt | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/api/service/ServicePipelineViewResource.kt b/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/api/service/ServicePipelineViewResource.kt index 9f0a1cda35c7..13ac3deb1233 100644 --- a/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/api/service/ServicePipelineViewResource.kt +++ b/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/api/service/ServicePipelineViewResource.kt @@ -208,4 +208,14 @@ interface ServicePipelineViewResource { @PathParam("pipelineId") pipelineId: String ): Result> + + @Operation(summary = "根据视图ID获取流水线ID列表") + @POST + @Path("/pipelines/listPipelineIdByViewIds") + fun listPipelineIdByViewIds( + @PathParam("projectId") + projectId: String, + @Parameter(description = "按视图过滤", required = false) + viewIdsEncode: List + ): Result> } diff --git a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/api/ServicePipelineViewResourceImpl.kt b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/api/ServicePipelineViewResourceImpl.kt index cf6add53457a..906d239d5058 100644 --- a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/api/ServicePipelineViewResourceImpl.kt +++ b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/api/ServicePipelineViewResourceImpl.kt @@ -208,4 +208,13 @@ class ServicePipelineViewResourceImpl @Autowired constructor( pipelineViewGroupService.listViewIdsByPipelineId(projectId, pipelineId) ) } + + override fun listPipelineIdByViewIds( + projectId: String, + viewIdsEncode: List + ): Result> { + return Result( + pipelineViewGroupService.listPipelineIdsByViewIds(projectId, viewIdsEncode) + ) + } } From 84e6cf82ec9201d48cf6beb871dd896de72df05b Mon Sep 17 00:00:00 2001 From: greysonfang Date: Tue, 7 Jan 2025 20:41:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?bug=EF=BC=9A=E4=BF=AE=E6=94=B9=E5=88=86?= =?UTF-8?q?=E7=BA=A7=E7=AE=A1=E7=90=86=E5=91=98=E6=8E=88=E6=9D=83=E8=8C=83?= =?UTF-8?q?=E5=9B=B4=E5=81=B6=E7=8E=B0=E4=B8=8D=E6=88=90=E5=8A=9F=E7=8E=B0?= =?UTF-8?q?=E8=B1=A1=20#11334?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AbsProjectServiceImpl.kt | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/backend/ci/core/project/biz-project/src/main/kotlin/com/tencent/devops/project/service/impl/AbsProjectServiceImpl.kt b/src/backend/ci/core/project/biz-project/src/main/kotlin/com/tencent/devops/project/service/impl/AbsProjectServiceImpl.kt index 31bed594fb25..3877d4fa72eb 100644 --- a/src/backend/ci/core/project/biz-project/src/main/kotlin/com/tencent/devops/project/service/impl/AbsProjectServiceImpl.kt +++ b/src/backend/ci/core/project/biz-project/src/main/kotlin/com/tencent/devops/project/service/impl/AbsProjectServiceImpl.kt @@ -59,6 +59,7 @@ import com.tencent.devops.common.auth.api.pojo.ProjectConditionDTO import com.tencent.devops.common.auth.api.pojo.ResourceRegisterInfo import com.tencent.devops.common.auth.api.pojo.SubjectScopeInfo import com.tencent.devops.common.auth.code.ProjectAuthServiceCode +import com.tencent.devops.common.auth.enums.SubjectScopeType import com.tencent.devops.common.client.Client import com.tencent.devops.common.client.ClientTokenService import com.tencent.devops.common.event.dispatcher.SampleEventDispatcher @@ -766,9 +767,27 @@ abstract class AbsProjectServiceImpl @Autowired constructor( beforeSubjectScopes: List, afterSubjectScopes: List ): Boolean { - val beforeIds = beforeSubjectScopes.map { it.id }.toSet() - val afterIds = afterSubjectScopes.map { it.id }.toSet() - return beforeIds != afterIds + val beforeUsernames = beforeSubjectScopes + .filter { it.type == SubjectScopeType.USER.value } + .map { it.username } + .toSet() + + val afterUsernames = afterSubjectScopes + .filter { it.type == SubjectScopeType.USER.value } + .map { it.username } + .toSet() + + val beforeDeptIds = beforeSubjectScopes + .filter { it.type != SubjectScopeType.USER.value } + .map { it.id } + .toSet() + + val afterDeptIds = afterSubjectScopes + .filter { it.type != SubjectScopeType.USER.value } + .map { it.id } + .toSet() + + return beforeUsernames != afterUsernames || beforeDeptIds != afterDeptIds } private fun updateApprovalInfo(