employee 增加list 接口

This commit is contained in:
caoqianming 2022-01-27 09:56:11 +08:00
parent 8cb4f244d1
commit f8bfee6f89
1 changed files with 2 additions and 1 deletions

View File

@ -24,7 +24,7 @@ from rest_framework.decorators import action
# Create your views here.
class EmployeeViewSet(CreateUpdateModelAMixin, OptimizationMixin, UpdateModelMixin, RetrieveModelMixin, GenericViewSet):
class EmployeeViewSet(CreateUpdateModelAMixin, OptimizationMixin, UpdateModelMixin, ListModelMixin, RetrieveModelMixin, GenericViewSet):
"""
员工详细信息
"""
@ -32,6 +32,7 @@ class EmployeeViewSet(CreateUpdateModelAMixin, OptimizationMixin, UpdateModelMix
queryset = Employee.objects.all()
filterset_class = EmployeeFilterSet
serializer_class = EmployeeSerializer
search_fields = ['user__name', 'number', 'user__username']
ordering = ['-pk']
def update(self, request, *args, **kwargs):