Files
boss_dp/server/urls.py

78 lines
3.1 KiB
Python
Raw Permalink Normal View History

2026-02-14 16:50:02 +08:00
"""
Django URL 路由配置
"""
2026-03-04 14:11:12 +08:00
from django.urls import path, re_path
from django.conf import settings
from django.views.static import serve
2026-02-14 16:50:02 +08:00
2026-03-05 10:27:28 +08:00
from server.api import (
2026-03-07 23:51:18 +08:00
auth, accounts, tasks, workers, filters, scripts, contacts, stats,
settings as api_settings, followup, scheduled_task
2026-03-05 10:27:28 +08:00
)
2026-02-14 16:50:02 +08:00
urlpatterns = [
# ─── 健康检查 ───
path("health", workers.health_check),
# ─── 认证 ───
path("api/auth/login", auth.login),
2026-02-25 20:12:26 +08:00
path("api/auth/get_info", auth.get_info),
2026-02-14 16:50:02 +08:00
# ─── Worker ───
path("api/workers", workers.worker_list),
2026-02-26 21:16:59 +08:00
path("api/workers/browsers", workers.worker_browsers),
2026-02-26 21:19:19 +08:00
path("api/workers/<str:worker_id>/browsers", workers.worker_browsers_by_path),
2026-02-26 21:21:47 +08:00
path("api/workers/<str:worker_id>", workers.worker_detail),
2026-02-14 16:50:02 +08:00
# ─── 任务 ───
path("api/tasks", tasks.task_list),
2026-03-06 13:06:36 +08:00
path("api/tasks/detail/<str:task_id>", tasks.task_detail),
2026-03-03 10:50:32 +08:00
path("api/tasks/<str:task_id>/cancel", tasks.task_cancel),
2026-03-01 23:39:47 +08:00
path("api/tasks/<int:account_id>", tasks.task_list_by_account),
2026-02-14 16:50:02 +08:00
# ─── 账号 ───
path("api/accounts", accounts.account_list),
2026-02-27 14:11:12 +08:00
path("api/accounts/fill-boss-ids", accounts.fill_boss_ids),
2026-03-01 23:21:31 +08:00
path("api/accounts/worker/<str:worker_id>", accounts.account_list_by_worker),
2026-02-14 16:50:02 +08:00
path("api/accounts/<int:account_id>", accounts.account_detail),
2026-02-14 17:58:29 +08:00
2026-03-06 10:47:46 +08:00
# ─── 招聘筛选快照 ───
2026-03-06 10:05:49 +08:00
path("api/filters/options", filters.recruit_filter_options),
2026-03-06 11:19:17 +08:00
path("api/filters/sync", filters.recruit_filter_sync),
2026-02-14 17:58:29 +08:00
# ─── 话术管理 ───
path("api/scripts", scripts.script_list),
path("api/scripts/<int:pk>", scripts.script_detail),
# ─── 联系记录 ───
path("api/contacts", contacts.contact_list),
2026-02-25 00:10:04 +08:00
path("api/contacts/query", contacts.contact_query),
2026-03-04 14:11:12 +08:00
path("api/contacts/export", contacts.contact_export),
2026-02-14 17:58:29 +08:00
path("api/contacts/<int:pk>", contacts.contact_detail),
2026-03-05 10:27:28 +08:00
# ─── 复聊配置 ───
path("api/followup-configs", followup.followup_config_list),
path("api/followup-configs/<int:pk>", followup.followup_config_detail),
path("api/followup-scripts", followup.followup_script_list),
path("api/followup-scripts/<int:pk>", followup.followup_script_detail),
path("api/followup-records", followup.followup_record_list),
path("api/followup-records/send", followup.followup_send_manual),
2026-02-14 17:58:29 +08:00
# ─── 统计分析 ───
path("api/stats", stats.stats_overview),
path("api/stats/daily", stats.stats_daily),
2026-03-07 23:51:18 +08:00
# ─── 定时任务 ───
path("api/scheduled-tasks", scheduled_task.scheduled_task_list),
path("api/scheduled-tasks/<int:task_id>", scheduled_task.scheduled_task_detail),
path("api/scheduled-tasks/<int:task_id>/run", scheduled_task.run_scheduled_task_now),
path("api/scheduled-tasks/<int:task_id>/toggle", scheduled_task.toggle_scheduled_task),
2026-02-14 17:58:29 +08:00
# ─── 系统配置 ───
2026-03-04 14:11:12 +08:00
path("api/settings", api_settings.settings_list),
path("api/settings/<str:key>", api_settings.settings_detail),
# ─── 媒体文件服务 ───
re_path(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT}),
2026-02-14 16:50:02 +08:00
]