refactor: 优化查询主机逻辑.
This commit is contained in:
@@ -34,6 +34,6 @@ public class AuthorizedHostWrapperVO {
|
||||
private Map<String, Set<Long>> treeNodes;
|
||||
|
||||
@Schema(description = "最近访问的主机")
|
||||
private List<Long> latestHosts;
|
||||
private Set<Long> latestHosts;
|
||||
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ public class AssetAuthorizedDataServiceImpl implements AssetAuthorizedDataServic
|
||||
favoriteResult.get(),
|
||||
dataAliasResult.get());
|
||||
// 设置最近连接的主机
|
||||
wrapper.setLatestHosts(latestConnectHostIdList.get());
|
||||
wrapper.setLatestHosts(new LinkedHashSet<>(latestConnectHostIdList.get()));
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</sql>
|
||||
|
||||
<select id="selectLatestConnectHostId" resultType="java.lang.Long">
|
||||
SELECT DISTINCT host_id
|
||||
SELECT host_id
|
||||
FROM host_connect_log
|
||||
WHERE deleted = 0
|
||||
AND type = #{type}
|
||||
|
||||
Reference in New Issue
Block a user