- 新增 apps/core/ai_audit.py AI 审核服务 - 新增 apps/core/views.py API 视图 - 新增 apps/core/urls.py URL 路由 - 更新 config/urls.py 注册 AI 审核 API - 支持文章/评论/服务的自动审核 - 包含敏感词检测、广告检测、内容质量评估
38 lines
1.2 KiB
Python
38 lines
1.2 KiB
Python
"""
|
|
URL configuration for the project.
|
|
"""
|
|
|
|
from django.contrib import admin
|
|
from django.urls import path, include
|
|
from django.conf import settings
|
|
from django.conf.urls.static import static
|
|
from rest_framework_simplejwt.views import (
|
|
TokenObtainPairView,
|
|
TokenRefreshView,
|
|
)
|
|
from apps.api.views import CustomTokenObtainPairView
|
|
|
|
urlpatterns = [
|
|
path('admin/', admin.site.urls),
|
|
|
|
# Authentication
|
|
path('api/auth/login/', CustomTokenObtainPairView.as_view(), name='token_obtain_pair'),
|
|
path('api/auth/token/refresh/', TokenRefreshView.as_view(), name='token_refresh'),
|
|
|
|
# API endpoints
|
|
path('api/', include('apps.users.urls')),
|
|
path('api/', include('apps.regions.urls')),
|
|
path('api/', include('apps.articles.urls')),
|
|
path('api/', include('apps.featured_services.urls')),
|
|
path('api/', include('apps.moderation.urls')),
|
|
path('api/', include('apps.interactions.urls')),
|
|
path('api/', include('apps.api.urls')),
|
|
path('api/', include('apps.core.urls')), # AI 审核 API
|
|
|
|
# GraphQL
|
|
path('graphql/', include('apps.api.graphql_urls')),
|
|
]
|
|
|
|
# Serve media files in development
|
|
if settings.DEBUG:
|
|
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) |