34 lines
1.0 KiB
Python
34 lines
1.0 KiB
Python
"""
|
|
URL configuration for file storage API.
|
|
"""
|
|
|
|
from django.urls import path, include
|
|
from rest_framework.routers import DefaultRouter
|
|
|
|
from .views import (
|
|
MediaFileViewSet,
|
|
PublicShareViewSet,
|
|
MemoryCardViewSet,
|
|
PublicDownloadView,
|
|
PublicShareInfoView,
|
|
PublicShareVerifyPasswordView,
|
|
)
|
|
|
|
router = DefaultRouter()
|
|
router.register(r'media', MediaFileViewSet, basename='media')
|
|
router.register(r'shares', PublicShareViewSet, basename='shares')
|
|
router.register(r'cards', MemoryCardViewSet, basename='cards')
|
|
|
|
# API URLs (under /api/v1/)
|
|
api_urlpatterns = [
|
|
path('', include(router.urls)),
|
|
]
|
|
|
|
# Public share URLs (under /s/)
|
|
public_urlpatterns = [
|
|
path('<str:token>/', PublicDownloadView.as_view(), name='public_download'),
|
|
path('<str:token>/download/', PublicDownloadView.as_view(), name='public_download_explicit'),
|
|
path('<str:token>/info/', PublicShareInfoView.as_view(), name='public_share_info'),
|
|
path('<str:token>/verify/', PublicShareVerifyPasswordView.as_view(), name='public_share_verify'),
|
|
]
|