backend/image_markuper/config/api_router.py

133 lines
4.0 KiB
Python
Raw Normal View History

2022-10-28 21:52:02 +03:00
from dicom.api.views import (
2022-11-01 12:20:43 +03:00
AddDicomProjectApi,
2022-10-28 21:52:02 +03:00
CreateCircleApi,
2022-11-01 12:20:43 +03:00
CreateFreeHandApi,
2022-10-30 16:40:46 +03:00
CreateRoiApi,
2022-11-01 12:20:43 +03:00
CreateRulerApi,
DeleteDicomProjectApi,
2022-11-03 22:16:11 +03:00
GeneratePatology,
2022-10-28 21:52:02 +03:00
ListCreateDicomApi,
2022-11-01 12:20:43 +03:00
ListCreateProjectApi,
2022-10-30 16:40:46 +03:00
ListUpdateDicomImageNumberApi,
2022-10-28 21:52:02 +03:00
RetrieveUpdateDeleteCircleApi,
RetrieveUpdateDeleteDicomApi,
2022-11-01 12:20:43 +03:00
RetrieveUpdateDeleteFreeHandApi,
RetrieveUpdateDeleteProjectApi,
2022-10-30 16:40:46 +03:00
RetrieveUpdateDeleteRoiApi,
2022-11-01 12:20:43 +03:00
RetrieveUpdateDeleteRulerApi,
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
),
2022-11-01 12:20:43 +03:00
path(
"<str:slug>/free_hand",
CreateFreeHandApi.as_view(),
name="create_free_hand",
),
2022-10-28 21:52:02 +03:00
path(
"<str:slug>/circle",
CreateCircleApi.as_view(),
name="create_circle",
),
2022-11-01 12:20:43 +03:00
path(
"<str:slug>/ruler",
CreateRulerApi.as_view(),
name="create_ruler",
),
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
),
2022-11-01 12:20:43 +03:00
path(
"free_hand/<int:id>",
RetrieveUpdateDeleteFreeHandApi.as_view(),
name="get_update_delete_free_hand",
),
2022-10-28 21:52:02 +03:00
path(
"circle/<int:id>",
RetrieveUpdateDeleteCircleApi.as_view(),
name="get_update_delete_circle",
),
2022-11-01 12:20:43 +03:00
path(
"ruler/<int:id>",
RetrieveUpdateDeleteRulerApi.as_view(),
name="get_update_delete_ruler",
),
]
),
),
path(
"project/",
include(
[
path("", ListCreateProjectApi.as_view(), name="list_create_project"),
path(
"<str:slug>",
RetrieveUpdateDeleteProjectApi.as_view(),
name="get_update_delete_project",
),
path(
"<str:slug>/upload",
AddDicomProjectApi.as_view(),
name="add_dicom_api",
),
path(
"<str:slug>/<str:dicom_slug>",
DeleteDicomProjectApi.as_view(),
name="delete_dicom_api",
),
2022-10-26 23:22:04 +03:00
]
),
),
path(
2022-11-03 22:16:11 +03:00
"generate/",
include(
[
2022-11-03 22:16:11 +03:00
path("patology", GeneratePatology.as_view(), name="generate_patology"),
]
),
2022-11-03 22:16:11 +03:00
),
2022-10-26 23:22:04 +03:00
]