2022-03-18 18:13:36 +03:00
|
|
|
from django.urls import path
|
2022-03-19 20:23:17 +03:00
|
|
|
from rest_framework.routers import DefaultRouter
|
2022-03-20 15:46:53 +03:00
|
|
|
from .viewsets import UserViewSet, MessageViewSet, ChatViewSet, CreateChatFromTgViewSet, \
|
|
|
|
MessageCreateWithUsernameViewSet, AddUserToChatViewSet, FromUsernameToUserViewset, FromTgIdToChats
|
2022-03-18 18:13:36 +03:00
|
|
|
|
2022-03-19 20:23:17 +03:00
|
|
|
router = DefaultRouter()
|
|
|
|
|
|
|
|
router.register('user', UserViewSet, basename='user')
|
|
|
|
router.register('message', MessageViewSet, basename='message')
|
|
|
|
router.register('chat', ChatViewSet, basename='chat')
|
2022-03-20 15:46:53 +03:00
|
|
|
router.register('chat-from-username', CreateChatFromTgViewSet, basename='chat-from-username')
|
|
|
|
router.register('message-from-username', MessageCreateWithUsernameViewSet, basename='message-from-username')
|
|
|
|
router.register('add-viewer-to-chat', AddUserToChatViewSet, basename='add-user-to-chat')
|
|
|
|
router.register('from-username-to-user', FromUsernameToUserViewset, basename='from-username-to-user')
|
|
|
|
router.register('from-tg-id-to-admin-chats', FromTgIdToChats, basename='from-tg-id-to-admin-chats')
|
|
|
|
urlpatterns = []
|
2022-03-19 20:23:17 +03:00
|
|
|
urlpatterns.extend(router.urls)
|