Files
medical_training/apps/user/urls.py
T

37 lines
1.9 KiB
Python

from django.urls import path, include
from rest_framework.routers import DefaultRouter
from . import views
from .auth.send_code import send_code
from .auth.register import register
from .auth.login import login_password, login_code
from .auth.logout import logout
from .auth.refresh import refresh_token
from .auth.reset_password import reset_password
router = DefaultRouter()
router.register(r'users', views.UserViewSet, basename='user')
router.register(r'roles', views.RoleViewSet, basename='role')
router.register(r'teacher-student-relations', views.TeacherStudentRelationViewSet, basename='teacher-student-relation')
router.register(r'institutions', views.InstitutionViewSet, basename='institution')
router.register(r'departments', views.DepartmentViewSet, basename='department')
urlpatterns = [
path('', include(router.urls)),
# 移动端机构列表(不分页,登录前可调用)
path('institution_list/', views.institution_list, name='institution-list'),
# 移动端配置页(登录后):机构信息 / 所属机构科室列表 / 学生信息配置
path('institution_info/', views.institution_info, name='institution-info'),
path('my_departments/', views.my_departments, name='my-departments'),
path('profile/config/', views.student_profile_config, name='student-profile-config'),
# 移动端个人中心:个人信息获取(GET) / 更新(PATCH)
path('profile/', views.profile, name='profile'),
# 认证相关
path('auth/send-code/', send_code, name='send-code'),
path('auth/register/', register, name='register'),
path('auth/login/', login_password, name='login-password'),
path('auth/login-code/', login_code, name='login-code'),
path('auth/logout/', logout, name='logout'),
path('auth/refresh/', refresh_token, name='refresh-token'),
path('auth/reset-password/', reset_password, name='reset-password'),
]