""" Django URL 路由配置。 """ from django.urls import path, re_path from django.conf import settings from django.views.static import serve from server.api import ( auth, accounts, tasks, workers, filters, scripts, contacts, stats, settings as api_settings, followup ) urlpatterns = [ # ─── 健康检查 ─── path("health", workers.health_check), # ─── 认证 ─── path("api/auth/login", auth.login), path("api/auth/get_info", auth.get_info), # ─── Worker ─── path("api/workers", workers.worker_list), path("api/workers/browsers", workers.worker_browsers), path("api/workers//browsers", workers.worker_browsers_by_path), path("api/workers/", workers.worker_detail), # ─── 任务 ─── path("api/tasks", tasks.task_list), path("api/tasks//cancel", tasks.task_cancel), path("api/tasks/", tasks.task_list_by_account), # ─── 账号 ─── path("api/accounts", accounts.account_list), path("api/accounts/fill-boss-ids", accounts.fill_boss_ids), path("api/accounts/worker/", accounts.account_list_by_worker), path("api/accounts/", accounts.account_detail), # ─── 招聘筛选快照 ─── path("api/filters/options", filters.recruit_filter_options), # ─── 话术管理 ─── path("api/scripts", scripts.script_list), path("api/scripts/", scripts.script_detail), # ─── 联系记录 ─── path("api/contacts", contacts.contact_list), path("api/contacts/query", contacts.contact_query), path("api/contacts/export", contacts.contact_export), path("api/contacts/", contacts.contact_detail), # ─── 复聊配置 ─── path("api/followup-configs", followup.followup_config_list), path("api/followup-configs/", followup.followup_config_detail), path("api/followup-scripts", followup.followup_script_list), path("api/followup-scripts/", followup.followup_script_detail), path("api/followup-records", followup.followup_record_list), path("api/followup-records/send", followup.followup_send_manual), # ─── 统计分析 ─── path("api/stats", stats.stats_overview), path("api/stats/daily", stats.stats_daily), # ─── 系统配置 ─── path("api/settings", api_settings.settings_list), path("api/settings/", api_settings.settings_detail), # ─── 媒体文件服务 ─── re_path(r'^media/(?P.*)$', serve, {'document_root': settings.MEDIA_ROOT}), ]