|
11 | 11 | from django.core.cache import cache |
12 | 12 | from django.db.models import QuerySet |
13 | 13 | from django.utils.translation import gettext_lazy as _ |
14 | | -from drf_spectacular.utils import extend_schema |
| 14 | +from drf_spectacular.types import OpenApiTypes |
| 15 | +from drf_spectacular.utils import extend_schema, OpenApiParameter |
15 | 16 | from rest_framework.request import Request |
16 | 17 | from rest_framework.views import APIView |
17 | 18 |
|
18 | 19 | from common.auth.authenticate import TokenAuth |
19 | 20 | from common.auth.authentication import has_permissions |
20 | 21 | from common.constants.cache_version import Cache_Version |
21 | | -from common.constants.permission_constants import PermissionConstants, Permission, Group, Operate, RoleConstants |
| 22 | +from common.constants.permission_constants import PermissionConstants, RoleConstants |
22 | 23 | from common.exception.app_exception import AppApiException |
23 | 24 | from common.log.log import log |
24 | 25 | from common.result import result |
25 | 26 | from common.utils.common import query_params_to_single_dict |
26 | 27 | from common.utils.rsa_util import decrypt |
27 | 28 | from maxkb.const import CONFIG |
28 | 29 | from models_provider.api.model import DefaultModelResponse |
29 | | -from tools.serializers.tool import encryption |
30 | 30 | from users.api.user import UserProfileAPI, TestWorkspacePermissionUserApi, DeleteUserApi, EditUserApi, \ |
31 | 31 | ChangeUserPasswordApi, UserPageApi, UserListApi, UserPasswordResponse, WorkspaceUserAPI, ResetPasswordAPI, \ |
32 | 32 | SendEmailAPI, CheckCodeAPI, SwitchUserLanguageAPI |
@@ -131,6 +131,13 @@ class UserList(APIView): |
131 | 131 | description=_("Get all user"), |
132 | 132 | operation_id=_("Get all user"), # type: ignore |
133 | 133 | tags=[_("User Management")], # type: ignore |
| 134 | + parameters=[OpenApiParameter( |
| 135 | + name="nick_name", |
| 136 | + description=_('Nickname'), |
| 137 | + type=OpenApiTypes.STR, |
| 138 | + location=OpenApiParameter.QUERY, # type: ignore |
| 139 | + required=False, |
| 140 | + )], |
134 | 141 | responses=UserListApi.get_response()) |
135 | 142 | @has_permissions(RoleConstants.WORKSPACE_MANAGE, RoleConstants.ADMIN, RoleConstants.EXTENDS_ADMIN, |
136 | 143 | RoleConstants.EXTENDS_WORKSPACE_MANAGE, RoleConstants.USER, RoleConstants.EXTENDS_USER) |
|
0 commit comments