Files
state-corp-backend/src/core/api_v1_urls.py
2026-09-21 16:35:13 +02:00

53 lines
1.9 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.
"""
API v1 URL configuration.
Все API эндпоинты версионированы под /api/v1/
"""
from apps.core.report_upload_history import ReportUploadHistoryView
from apps.core.report_uploads import ReportUploadDownloadView
from apps.core.views import (
BackgroundJobListView,
BackgroundJobStatusView,
BackgroundJobStreamView,
)
from apps.user.sso_views import SsoCallbackView, SsoStartView
from django.urls import include, path
app_name = "api_v1"
jobs_urlpatterns = [
path("", BackgroundJobListView.as_view(), name="job-list"),
path("<str:task_id>/stream/", BackgroundJobStreamView.as_view(), name="job-stream"),
path("<str:task_id>/", BackgroundJobStatusView.as_view(), name="job-status"),
]
urlpatterns = [
path("auth/sso/", SsoCallbackView.as_view(), name="sso-callback"),
path("auth/sso/start/", SsoStartView.as_view(), name="sso-start"),
path("analytics/", include("apps.organization.analytics_root_urls")),
path("exchange/", include("apps.exchange.urls")),
path("dictionaries/", include("apps.organization.dictionary_urls")),
path("users/", include("apps.user.urls")),
path("jobs/", include((jobs_urlpatterns, "jobs"))),
path("organizations/", include("apps.organization.urls")),
path("registers/", include("apps.registers.urls")),
path("", include("apps.external_data.urls")),
path("forms/f1/", include("apps.form_1.urls")),
path("forms/f2/", include("apps.form_2.urls")),
path("forms/f3/", include("apps.form_3.urls")),
path("forms/f4/", include("apps.form_4.urls")),
path("forms/f5/", include("apps.form_5.urls")),
path("forms/f6/", include("apps.form_6.urls")),
path(
"forms/uploads/history/",
ReportUploadHistoryView.as_view(),
name="report-upload-history",
),
path(
"forms/<str:form>/uploads/<int:load_batch>/download/",
ReportUploadDownloadView.as_view(),
name="report-upload-download",
),
]