|
23 | 23 |
|
24 | 24 | import phonenumbers |
25 | 25 | from blue_krill.data_types.enum import EnumField, StructuredEnum |
| 26 | +from django.conf import settings |
26 | 27 | from django.db.models import Q, QuerySet |
27 | | - |
28 | | -# from django.conf import settings |
29 | 28 | from django.http import Http404 |
30 | | - |
31 | | -# from django.utils.decorators import method_decorator |
32 | | -# from django.views.decorators.cache import cache_page |
| 29 | +from django.utils.decorators import method_decorator |
| 30 | +from django.views.decorators.cache import cache_page |
33 | 31 | from rest_framework import generics |
34 | 32 | from rest_framework.response import Response |
35 | 33 |
|
|
49 | 47 | ) |
50 | 48 | from bkuser.apps.tenant.constants import TenantUserStatus |
51 | 49 | from bkuser.apps.tenant.models import DataSourceDepartment, TenantDepartment, TenantUser |
| 50 | +from bkuser.common.cache import CacheEnum |
52 | 51 | from bkuser.common.error_codes import error_codes |
53 | 52 | from bkuser.common.views import ExcludePatchAPIViewMixin |
54 | 53 | from bkuser.utils.tree import Tree |
@@ -384,7 +383,7 @@ class ProfileListApi(LegacyOpenApiCommonMixin, TenantUserListToUserInfosMixin, g |
384 | 383 |
|
385 | 384 | pagination_class = LegacyOpenApiPagination |
386 | 385 |
|
387 | | - # @method_decorator(cache_page(cache="redis", 60 * 60, key_prefix="openapi_v2_profile_list")) |
| 386 | + @method_decorator(cache_page(cache=CacheEnum.REDIS.value, timeout=settings.OPEN_API_V2_LIST_USER_CACHE_TIMEOUT)) |
388 | 387 | def get(self, request, *args, **kwargs): |
389 | 388 | slz = ProfileListInputSLZ(data=request.query_params) |
390 | 389 | slz.is_valid(raise_exception=True) |
|
0 commit comments