From 47f1466d57f12bae7eb65e530165c04e398b5956 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 4 Sep 2021 23:08:17 -0700 Subject: [PATCH] my commit --- backend/channel_plugin/Pipfile | 11 +++++++++++ backend/channel_plugin/apps/channels/urls.py | 3 ++- backend/channel_plugin/apps/channels/views.py | 17 +++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 backend/channel_plugin/Pipfile diff --git a/backend/channel_plugin/Pipfile b/backend/channel_plugin/Pipfile new file mode 100644 index 000000000..22d660a02 --- /dev/null +++ b/backend/channel_plugin/Pipfile @@ -0,0 +1,11 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] + +[dev-packages] + +[requires] +python_version = "3.8" diff --git a/backend/channel_plugin/apps/channels/urls.py b/backend/channel_plugin/apps/channels/urls.py index f63ee08f3..00e31b402 100644 --- a/backend/channel_plugin/apps/channels/urls.py +++ b/backend/channel_plugin/apps/channels/urls.py @@ -2,7 +2,7 @@ from apps.channels.views import ( Test, SearchMessagesAPIView, GetChannelInfo, create_channel, GetChannelRoles, CreateThreadView,ThreadUserRoleView, - ThreadUserRoleUpdateAPIView + ThreadUserRoleUpdateAPIView,GetChannelList ) from apps.channels.views import SendMessageInChannel from django.urls import path @@ -23,4 +23,5 @@ CreateThreadView.as_view(), name="create-thread", ), + path("channels/",GetChannelList.as_view(), name='channels_list'), ] diff --git a/backend/channel_plugin/apps/channels/views.py b/backend/channel_plugin/apps/channels/views.py index 4bc5d00f0..0ef9805ac 100644 --- a/backend/channel_plugin/apps/channels/views.py +++ b/backend/channel_plugin/apps/channels/views.py @@ -195,3 +195,20 @@ def post (self, request): else: return Response(serializer.errors, status=status.HTTP_500_INTERNAL_SERVER_ERROR) +class GetChannelList(APIView): + def get(self, request, pk=0): + channels = [ + {"id": pk, + "title":"Channel title", + "description":"Channel description", + "private":['false'], + "closed":['false'], + "members": [ + {"id":"user_id", + "roles":["id reference to the users role"] + } + ], + }, + ] + + return Response(channels, status=status.HTTP_200_OK) \ No newline at end of file