perf: 整理用户授权资产的API

This commit is contained in:
Jiangjie.Bai
2022-09-13 15:41:39 +08:00
parent 4a21f86cd1
commit a2c006f01b
5 changed files with 52 additions and 59 deletions

View File

@@ -64,6 +64,7 @@ class UserGrantedNodeAssetsMixin:
pagination_class = NodeGrantedAssetPagination
pagination_node: Node
user: User
kwargs: dict
def get_queryset(self):
if getattr(self, 'swagger_fake_view', False):
@@ -91,6 +92,9 @@ class AssetsTreeFormatMixin(SerializeToTreeNodeMixin):
"""
将 资产 序列化成树的结构返回
"""
filter_queryset: callable
get_queryset: callable
filterset_fields = ['name', 'ip', 'id', 'comment']
search_fields = ['name', 'ip', 'comment']