增加了api功能:

创建API文档页面 :新建了 status/templates/status/api_docs.html 模板文件,包含:

- API认证方式说明
- 所有API端点的详细说明(POST /api/checkin/、GET /api/services/、GET /api/services/{id}/history/、GET /api/status-summary/)
- 每个端点的请求体和响应体示例
- 状态码和检测类型的说明
This commit is contained in:
2025-09-07 19:51:04 +08:00
parent 1cac84b9d4
commit 16e3b14984
14 changed files with 421 additions and 3 deletions

12
status/api_urls.py Normal file
View File

@@ -0,0 +1,12 @@
from django.urls import path
from . import api_views
urlpatterns = [
# 客户端上报接口
path('checkin/', api_views.CheckInAPIView.as_view(), name='api-checkin'),
# 查询接口
path('services/', api_views.ServiceListAPIView.as_view(), name='api-service-list'),
path('services/<int:service_id>/history/', api_views.ServiceHistoryAPIView.as_view(), name='api-service-history'),
path('status-summary/', api_views.StatusSummaryAPIView.as_view(), name='api-status-summary'),
]