2026-09-07 19:43:48 +03:00

33 lines
1.0 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""
URL routing для Communications REST API
Этот модуль определяет DRF router с ViewSets для:
- Chats (чаты)
- Messages (сообщения)
- Polls (голосования)
Использование в главном urls.py:
from communications.api.urls import router as communications_router
path('api/v1/communications/', include(communications_router.urls))
История:
- Создан: 11 марта 2026 (перенос из api/v1/)
"""
from rest_framework.routers import DefaultRouter
from .viewsets import ChatViewSet, MessageViewSet, PollViewSet
# Создаем DRF router
router = DefaultRouter()
# Регистрируем ViewSets
router.register(r"chats", ChatViewSet, basename="chats")
router.register(r"messages", MessageViewSet, basename="messages")
router.register(r"polls", PollViewSet, basename="polls")
# Экспортируем для использования в главном urls.py
urlpatterns = router.urls
__all__ = ["router", "urlpatterns"]