You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2023/01/16 03:02:08 UTC

[GitHub] [inlong] fuweng11 commented on a diff in pull request #7233: [INLONG-7232][Manager] Supports automatic management of audit ids

fuweng11 commented on code in PR #7233:
URL: https://github.com/apache/inlong/pull/7233#discussion_r1070781333


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/AuditServiceImpl.java:
##########
@@ -240,40 +245,38 @@ public List<AuditVO> listByCondition(AuditRequest request) throws Exception {
     }
 
     private List<String> getAuditIds(String groupId, String streamId, String sinkNodeType) {
-        List<String> auditIds = LoginUserUtils.getLoginUser().getRoles().contains(UserRoleCode.ADMIN)
-                ? new ArrayList<>(auditIdListForAdmin)
-                : new ArrayList<>(auditIdListForUser);
+        Set<String> auditSet = LoginUserUtils.getLoginUser().getRoles().contains(UserRoleCode.ADMIN)
+                ? new HashSet<>(auditIdListForAdmin)
+                : new HashSet<>(auditIdListForUser);
+
+        Object fixedObj = new Object();
+        Map<String, Object> auditIdMap = auditSet.stream().collect(Collectors.toMap(x -> x, x -> fixedObj));

Review Comment:
   Here, we only need to use set to obtain ids instead of map to encapsulate other information.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org