backend/config/api_router.py

73 lines
2.2 KiB
Python
Raw Normal View History

2022-10-28 21:52:02 +03:00
from dicom.api.views import (
CreateCircleApi,
2022-10-30 16:40:46 +03:00
CreateRoiApi,
2022-10-28 21:52:02 +03:00
ListCreateDicomApi,
2022-10-30 16:40:46 +03:00
ListUpdateDicomImageNumberApi,
2022-10-28 21:52:02 +03:00
RetrieveUpdateDeleteCircleApi,
RetrieveUpdateDeleteDicomApi,
2022-10-30 16:40:46 +03:00
RetrieveUpdateDeleteRoiApi,
2022-10-29 22:46:19 +03:00
SmartFileUploadApi,
2022-10-28 21:52:02 +03:00
)
2022-10-26 23:22:04 +03:00
from django.urls import include, path
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView
from users.api.views import RegisterView
2022-10-25 23:29:13 +03:00
2022-10-26 23:22:04 +03:00
urlpatterns = [
path(
"auth/",
include(
[
path("token/", TokenObtainPairView.as_view(), name="token_obtain_pair"),
path("refresh/", TokenRefreshView.as_view(), name="token_refresh"),
path("register/", RegisterView.as_view(), name="user_register"),
]
),
),
path(
"dicom/",
include(
[
2022-10-30 16:40:46 +03:00
path("", ListCreateDicomApi.as_view(), name="dicom_list_create"),
2022-10-29 22:46:19 +03:00
path("upload", SmartFileUploadApi.as_view(), name="upload_dicom_api"),
2022-10-26 23:22:04 +03:00
path(
"<str:slug>",
RetrieveUpdateDeleteDicomApi.as_view(),
name="get_update_delete_dicom",
),
2022-10-28 21:52:02 +03:00
path(
2022-10-30 16:40:46 +03:00
"<str:slug>/roi",
CreateRoiApi.as_view(),
2022-10-30 00:12:13 +03:00
name="create_roi",
2022-10-28 21:52:02 +03:00
),
path(
"<str:slug>/circle",
CreateCircleApi.as_view(),
name="create_circle",
),
2022-10-30 16:40:46 +03:00
path(
"<str:slug>/<int:layer>",
ListUpdateDicomImageNumberApi.as_view(),
name="update_dicom_layer",
),
2022-10-28 21:52:02 +03:00
]
),
),
path(
"shapes/",
include(
[
path(
2022-10-30 16:40:46 +03:00
"roi/<int:id>",
RetrieveUpdateDeleteRoiApi.as_view(),
2022-10-30 00:12:13 +03:00
name="get_update_delete_roi",
2022-10-28 21:52:02 +03:00
),
path(
"circle/<int:id>",
RetrieveUpdateDeleteCircleApi.as_view(),
name="get_update_delete_circle",
),
2022-10-26 23:22:04 +03:00
]
),
),
]