import requests from django.shortcuts import render from django.http.response import JsonResponse from mock.utils import mock_service from mock.models import ZZMockModel from django.views.decorators.csrf import csrf_exempt ZZ_URL = 'https://zzcs.yinghezhong.com' # 数据上报 # 1、票房数据上报接口 POST /report/reportTicket @csrf_exempt def report_ticket(request): ip = request.META.get('REMOTE_ADDR') mock_service_switch = ZZMockModel.objects.filter(ip=ip).first() if mock_service_switch.reportTicket is True: return mock_service.mock(ip, 'reportTicket') else: return mock_service.bypass(request) # 2、排片数据上报接口 POST /report/reportFilmSchedule # 3、座位信息上报接口 POST /report/uploadScreenSeatInfo # 数据下载 # 1、影片信息下载接口 GET /data/downloadFilmInfo # 2、影院信息下载接口 GET /data/getCinemaInfo def get_cinema_info(request): ip = request.META.get('REMOTE_ADDR') mock_service_switch = ZZMockModel.objects.filter(ip=ip).first() if mock_service_switch.getCinemaInfo is True: return mock_service.mock(ip, 'getCinemaInfo') else: return mock_service.bypass(request) # 3、影厅信息下载接口 GET /data/getScreenInfo # 超时票务审批 # 1、超时票务受理情况查询接口 GET /data/getOvertimeTicketStatus # # 数据查询 # 2、数据清洗错误查询接口 POST /query/validError