- Update food, outfits, props, home-decor pages and components - Add permissions page and sidebar updates - Update API client and all API modules (auth, food, dances, etc.) - Add card model migrations for optional fields - Update Django views, serializers, and authentication - Add affinity level migrations and user app updates - Add project documentation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
32 lines
1.4 KiB
Python
32 lines
1.4 KiB
Python
from django.urls import path, include
|
|
from rest_framework.routers import DefaultRouter
|
|
from .views import (
|
|
ParadiseUserViewSet, CustomRegisterView, PhoneLoginView,
|
|
SendVerifyCodeView, EmailLoginView, UsernameLoginView, MacAddressLoginView,
|
|
GroupViewSet, AffinityRuleViewSet, AffinityLevelViewSet
|
|
)
|
|
|
|
router = DefaultRouter()
|
|
router.register('groups', GroupViewSet, basename='group')
|
|
router.register('affinity-rules', AffinityRuleViewSet, basename='affinity-rule')
|
|
router.register('affinity-levels', AffinityLevelViewSet, basename='affinity-level')
|
|
router.register('', ParadiseUserViewSet)
|
|
|
|
# 用户视图集的登录相关路径
|
|
urlpatterns = [
|
|
# 认证相关路径集中管理
|
|
path('auth/', include('userapp.auth_urls')),
|
|
# 注册相关
|
|
path('auth/register/', CustomRegisterView.as_view(), name='register'),
|
|
# 登录相关
|
|
path('auth/phone/login/', PhoneLoginView.as_view(), name='phone_login'),
|
|
path('auth/email/login/', EmailLoginView.as_view(), name='email_login'),
|
|
path('auth/username/login/', UsernameLoginView.as_view(), name='username_login'),
|
|
path('auth/mac/login/', MacAddressLoginView.as_view(), name='mac_login'),
|
|
# 手机验证码
|
|
path('auth/phone/verify/', SendVerifyCodeView.as_view(), name='send_verify_code'),
|
|
# 第三方账号相关
|
|
path('accounts/', include('allauth.urls')),
|
|
# 包含剩余的用户管理接口
|
|
path('', include(router.urls)),
|
|
] |