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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]