This is an automated email from the ASF dual-hosted git repository.

dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new 62c89a0acd [INLONG-9856][Manager] Fix the problem for missing tenant 
information when listTag (#9857)
62c89a0acd is described below

commit 62c89a0acd4be113d41cd5aed3f214abc25847c7
Author: fuweng11 <76141879+fuwen...@users.noreply.github.com>
AuthorDate: Thu Mar 21 09:11:08 2024 +0800

    [INLONG-9856][Manager] Fix the problem for missing tenant information when 
listTag (#9857)
---
 .../service/cluster/InlongClusterServiceImpl.java    | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git 
a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterServiceImpl.java
 
b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterServiceImpl.java
index 2c62c5a35c..3733318817 100644
--- 
a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterServiceImpl.java
+++ 
b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterServiceImpl.java
@@ -230,7 +230,15 @@ public class InlongClusterServiceImpl implements 
InlongClusterService {
             throw new BusinessException(ErrorCodeEnum.CLUSTER_NOT_FOUND,
                     String.format("inlong cluster tag not found by id=%s", 
id));
         }
-        return CommonBeanUtils.copyProperties(entity, ClusterTagResponse::new);
+        ClusterTagResponse response = CommonBeanUtils.copyProperties(entity, 
ClusterTagResponse::new);
+        List<String> tenantList = tenantClusterTagMapper
+                .selectByTag(entity.getClusterTag()).stream()
+                .map(TenantClusterTagEntity::getTenant)
+                .collect(Collectors.toList());
+        response.setTenantList(tenantList);
+
+        LOGGER.debug("success to get cluster tag info by id={}", id);
+        return response;
     }
 
     @Override
@@ -239,7 +247,15 @@ public class InlongClusterServiceImpl implements 
InlongClusterService {
         Page<InlongClusterTagEntity> entityPage = 
(Page<InlongClusterTagEntity>) clusterTagMapper
                 .selectByCondition(request);
         PageResult<ClusterTagResponse> pageResult = 
PageResult.fromPage(entityPage)
-                .map(entity -> CommonBeanUtils.copyProperties(entity, 
ClusterTagResponse::new));
+                .map(entity -> {
+                    ClusterTagResponse response = 
CommonBeanUtils.copyProperties(entity, ClusterTagResponse::new);
+                    List<String> tenantList = tenantClusterTagMapper
+                            .selectByTag(entity.getClusterTag()).stream()
+                            .map(TenantClusterTagEntity::getTenant)
+                            .collect(Collectors.toList());
+                    response.setTenantList(tenantList);
+                    return response;
+                });
 
         LOGGER.debug("success to list cluster tag by {}", request);
         return pageResult;

Reply via email to