-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Placeholder documentation for api/v3/feeds
- Loading branch information
Showing
3 changed files
with
24 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,27 @@ | ||
from django.conf import settings | ||
from rest_framework.decorators import api_view | ||
from rest_framework.response import Response | ||
from rest_framework.views import APIView | ||
from drf_spectacular.utils import extend_schema, OpenApiExample | ||
|
||
__all__ = ["feeds"] | ||
@extend_schema( | ||
description="Returns announcement feeds.", | ||
responses={200: {"announcements": []}}, | ||
examples=[ | ||
OpenApiExample( | ||
name="Feeds", | ||
response_only=True, | ||
status_codes=[200], | ||
value=[ | ||
{"announcement1": "placeholder"}, | ||
{"announcement2": "placeholder"} | ||
], | ||
) | ||
], | ||
) | ||
class Feeds(APIView): | ||
"""Returns Announcement feeds.""" | ||
|
||
|
||
@api_view() | ||
def feeds(request): | ||
""" | ||
Returns Announcement feeds. | ||
https://noi.nyiyui.ca/k/1063/5041#Get_Feeds | ||
""" | ||
return Response(list(settings.ANNOUNCEMENTS_CUSTOM_FEEDS)) | ||
@staticmethod | ||
def get(request): | ||
return Response(list(settings.ANNOUNCEMENTS_CUSTOM_FEEDS)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters