Skip to content

Commit

Permalink
docs: added descriptions for listuserfilesview, create/data/download …
Browse files Browse the repository at this point in the history
…docs views
  • Loading branch information
dev-lymar committed Jun 22, 2024
1 parent 919943d commit f30b487
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
18 changes: 16 additions & 2 deletions makedoc/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
from .serializers import DataDocSerializer, DocumentsSimpleSerializer, FileNameSerializer


class CreateDocsView(APIView):
class CreateDocsAPIView(APIView):
"""
Responsible for creating documents based on data from the cache.
"""
serializer_class = DocumentsSimpleSerializer
permission_classes = [IsAuthenticated]

Expand Down Expand Up @@ -49,7 +52,15 @@ def get(self, request, *args, **kwargs):
return Response({"message": "Documents saved"}, status=status.HTTP_200_OK)


# Загрузка документа
class DownloadDocAPIView(APIView):
"""
To download a file:
- No parameters: get the last created file.
- With the parameter {"file_name": "name your file"} - load a specific file from the list.
"""
permission_classes = [IsAuthenticated]

def post(self, request, *args, **kwargs):
Expand Down Expand Up @@ -81,7 +92,10 @@ def post(self, request, *args, **kwargs):
return response


class DataDocView(generics.GenericAPIView[Any]):
class DataDocAPIView(generics.GenericAPIView[Any]):
"""
Responsible for receiving data, validating it and storing it in cache.
"""
serializer_class = DataDocSerializer
permission_classes = (IsAuthenticated,)

Expand Down
4 changes: 3 additions & 1 deletion users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ class UserUpdatePasswordView(UserRelatedView):
serializer_class = UserUpdatePasswordSerializer


# Отображение списка документов пользователя
class ListUserFilesAPIView(APIView):
"""
Responsible for displaying a list of documents of an authorized user.
"""
permission_classes = (IsAuthenticated,)

def get(self, request, *args, **kwargs):
Expand Down

0 comments on commit f30b487

Please sign in to comment.