|
1 | 1 | from django.urls import path
|
2 |
| -from api import views |
| 2 | +from api.views import sign_api |
| 3 | +from api.views import sign_api_sec |
| 4 | +from api.views import other_api |
3 | 5 |
|
4 | 6 | urlpatterns = [
|
5 |
| - # learning interface test: |
6 |
| - # ex : /v1/hello_world/ |
7 |
| - path('hello_world/', views.hello_world), |
8 |
| - path('user/<slug:username>', views.user), |
9 |
| - path('get_user_info/<int:uid>', views.get_user_info), |
10 |
| - path('search', views.search), |
11 |
| - path('login', views.post_login), |
12 |
| - path('add_user', views.post_add_user), |
13 |
| - path('header', views.post_header), |
| 7 | + |
| 8 | + # 发布会签到系统接口: |
| 9 | + # ex : /api/add_event/ |
| 10 | + path('add_event/', sign_api.add_event, name='add_event'), |
| 11 | + # ex : /api/add_guest/ |
| 12 | + path('add_guest/', sign_api.add_guest, name='add_guest'), |
| 13 | + # ex : /api/get_event_list/ |
| 14 | + path('get_event_list/', sign_api.get_event_list, name='get_event_list'), |
| 15 | + # ex : /api/get_guest_list/ |
| 16 | + path('get_guest_list/', sign_api.get_guest_list, name='get_guest_list'), |
| 17 | + # ex : /api/user_sign/ |
| 18 | + path('user_sign/', sign_api.user_sign, name='user_sign'), |
| 19 | + |
| 20 | + # 安全接口 |
| 21 | + # ex : /api/sec_get_event_list/ |
| 22 | + path('sec_get_event_list/', sign_api_sec.get_event_list, name='get_event_list'), |
| 23 | + # ex : /api/sec_add_event/ |
| 24 | + path('sec_add_event/', sign_api_sec.add_event, name='add_event'), |
| 25 | + # ex : /api/sec_get_guest_list/ |
| 26 | + path('sec_get_guest_list/', sign_api_sec.get_guest_list, name='get_guest_list'), |
| 27 | + |
| 28 | + # 更多接口胡学习 |
| 29 | + # ex : /api/hello_world/ |
| 30 | + path('hello_world/', other_api.hello_world), |
| 31 | + path('user/<slug:username>', other_api.user), |
| 32 | + path('get_user_info/<int:uid>', other_api.get_user_info), |
| 33 | + path('search', other_api.search), |
| 34 | + path('login', other_api.post_login), |
| 35 | + path('add_user', other_api.post_add_user), |
| 36 | + path('header', other_api.post_header), |
14 | 37 |
|
15 | 38 | # RESTful 风格接口
|
16 |
| - path('user/<int:uid>/', views.user), |
| 39 | + path('user/<int:uid>/', other_api.user), |
17 | 40 |
|
18 | 41 | # session 记录用户状态
|
19 |
| - path('user_login', views.user_login), |
20 |
| - path('user_login_data', views.user_login_data), |
| 42 | + path('user_login', other_api.user_login), |
| 43 | + path('user_login_data', other_api.user_login_data), |
21 | 44 |
|
22 | 45 |
|
23 | 46 | # 接口的依赖
|
24 |
| - path('get_activity', views.get_activity), |
25 |
| - path('get_user', views.get_user), |
26 |
| - path('get_lucky_number', views.get_lucky_number), |
| 47 | + path('get_activity', other_api.get_activity), |
| 48 | + path('get_user', other_api.get_user), |
| 49 | + path('get_lucky_number', other_api.get_lucky_number), |
27 | 50 |
|
28 | 51 | # 文件上传
|
29 |
| - path('upload_file', views.upload_file) |
| 52 | + path('upload_file', other_api.upload_file) |
30 | 53 |
|
31 | 54 | ]
|
0 commit comments