Skip to content

Commit

Permalink
"Refactor URL routing for better separation of concerns."
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxiaolulu committed Apr 28, 2024
1 parent 5b6fa81 commit e38ebea
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 140 deletions.
14 changes: 14 additions & 0 deletions backend/api/routers/statistics.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from django.urls import path
from rest_framework.routers import DefaultRouter
from api.service.dashboard import StatisticsView


router = DefaultRouter()

app_urls = [
path("summay", StatisticsView.as_view()),
]


app_name = "statistics"
urlpatterns = app_urls + router.urls
16 changes: 16 additions & 0 deletions backend/api/routers/tree.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from django.urls import path
from rest_framework.routers import DefaultRouter
from api.service.https import (
TreeView
)


router = DefaultRouter()

app_urls = [
path("<int:pk>&<int:use_type>", TreeView.as_view()),
]


app_name = "tree"
urlpatterns = app_urls + router.urls
18 changes: 18 additions & 0 deletions backend/api/routers/user.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from django.urls import path
from rest_framework.routers import DefaultRouter
from api.service.user import (
CustomJsonWebToken,
UserListViewSet
)


router = DefaultRouter()

app_urls = [
path("login/", CustomJsonWebToken.as_view()),
path("list", UserListViewSet.as_view()),
]


app_name = "user"
urlpatterns = app_urls + router.urls
140 changes: 0 additions & 140 deletions backend/api/urls.py

This file was deleted.

0 comments on commit e38ebea

Please sign in to comment.