def stars_employee_list(request, employee_id):
"""
Returns stars list from employee
---
serializer: stars.serializers.StarSerializer
responseMessages:
- code: 401
message: Unauthorized. Authentication credentials were not provided. Invalid token.
- code: 403
message: Forbidden, authentication credentials were not provided
- code: 404
message: Not found
"""
if request.method == 'GET':
employee = get_object_or_404(Employee, pk=employee_id)
employee_stars = Star.objects.filter(to_user=employee)
paginator = PageNumberPagination()
results = paginator.paginate_queryset(employee_stars, request)
serializer = StarSerializer(results, many=True)
return paginator.get_paginated_response(serializer.data)
评论列表
文章目录