parent
							
								
									75642532e9
								
							
						
					
					
						commit
						ac4be88ca0
					
				
				 12 changed files with 88 additions and 17 deletions
			
			
		@ -0,0 +1,3 @@ | 
				
			||||
from django.contrib import admin | 
				
			||||
 | 
				
			||||
# Register your models here. | 
				
			||||
@ -0,0 +1,6 @@ | 
				
			||||
from django.apps import AppConfig | 
				
			||||
 | 
				
			||||
 | 
				
			||||
class MockConfig(AppConfig): | 
				
			||||
    default_auto_field = 'django.db.models.BigAutoField' | 
				
			||||
    name = 'mock' | 
				
			||||
@ -0,0 +1,3 @@ | 
				
			||||
from django.db import models | 
				
			||||
 | 
				
			||||
# Create your models here. | 
				
			||||
@ -0,0 +1,3 @@ | 
				
			||||
from django.test import TestCase | 
				
			||||
 | 
				
			||||
# Create your tests here. | 
				
			||||
@ -0,0 +1,24 @@ | 
				
			||||
""" | 
				
			||||
URL configuration for dingxin_toolbox_drf project. | 
				
			||||
 | 
				
			||||
The `urlpatterns` list routes URLs to views. For more information please see: | 
				
			||||
    https://docs.djangoproject.com/en/4.2/topics/http/urls/ | 
				
			||||
Examples: | 
				
			||||
Function views | 
				
			||||
    1. Add an import:  from my_app import views | 
				
			||||
    2. Add a URL to urlpatterns:  path('', views.home, name='home') | 
				
			||||
Class-based views | 
				
			||||
    1. Add an import:  from other_app.views import Home | 
				
			||||
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home') | 
				
			||||
Including another URLconf | 
				
			||||
    1. Import the include() function: from django.urls import include, path | 
				
			||||
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls')) | 
				
			||||
""" | 
				
			||||
from django.contrib import admin | 
				
			||||
from django.urls import path, include | 
				
			||||
from mock.views import * | 
				
			||||
 | 
				
			||||
urlpatterns = [ | 
				
			||||
    # path('report/reportTicket/', report_ticket), | 
				
			||||
    path('data/getCinemaInfo', get_cinema_info), | 
				
			||||
] | 
				
			||||
@ -0,0 +1,27 @@ | 
				
			||||
from django.shortcuts import render | 
				
			||||
from django.http.response import JsonResponse | 
				
			||||
 | 
				
			||||
 | 
				
			||||
# Create your views here. | 
				
			||||
 | 
				
			||||
# 1、票房数据上报接口 POST /report/reportTicket | 
				
			||||
def report_ticket(request): | 
				
			||||
    if request.method == 'POST': | 
				
			||||
        print(request.headers) | 
				
			||||
        print(request.body) | 
				
			||||
        return JsonResponse({'status': 'success'}) | 
				
			||||
 | 
				
			||||
 | 
				
			||||
# 数据下载 | 
				
			||||
# 1、影片信息下载接口 GET /data/downloadFilmInfo | 
				
			||||
# 2、影院信息下载接口 GET /data/getCinemaInfo | 
				
			||||
def get_cinema_info(request): | 
				
			||||
    print(request.headers) | 
				
			||||
    print(request.body) | 
				
			||||
    if request.method == 'GET': | 
				
			||||
        print('getCinemaInfo') | 
				
			||||
        print(request.headers) | 
				
			||||
        print(request.body) | 
				
			||||
        return JsonResponse({'status': 'success'}) | 
				
			||||
 | 
				
			||||
# 3、影厅信息下载接口 GET /data/getScreenInfo | 
				
			||||
					Loading…
					
					
				
		Reference in new issue