diff --git a/mock/migrations/0003_rename_auditsessioncode_zzmockmodel_auditshowid.py b/mock/migrations/0003_rename_auditsessioncode_zzmockmodel_auditshowid.py new file mode 100644 index 0000000..7a13069 --- /dev/null +++ b/mock/migrations/0003_rename_auditsessioncode_zzmockmodel_auditshowid.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.7 on 2023-12-22 10:06 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('mock', '0002_zzmockmodel_auditsessioncode_zzmockmodel_auditstatus'), + ] + + operations = [ + migrations.RenameField( + model_name='zzmockmodel', + old_name='auditSessionCode', + new_name='auditShowId', + ), + ] diff --git a/mock/views.py b/mock/views.py index 1391d3c..4cfb593 100644 --- a/mock/views.py +++ b/mock/views.py @@ -171,16 +171,32 @@ def get_local_ip(): return ip +# { +# 'reportTicket': '', +# 'reportFilmSchedule': '', +# 'uploadScreenSeatInfo': '', +# 'downloadFilmInfo': '', +# 'getCinemaInfo': '', +# 'getScreenInfo': '', +# 'getOvertimeTicketStatus': '', +# 'validError': '', +# 'auditShowId': '', +# 'auditStatus': '' +# } + # 启动mock def enable_mock(request): ip = request.query_params.dict().get('ip') + mock_config = request.query_params.dict().get('mock_config') server_ip = get_local_ip() current_host = db(ip, GET_ZZ_PLATFORM_HOST_SQL)['data'][0]['cinema_common_info_val'] if current_host == 'https://zzcs.yinghezhong.com' or current_host == 'https://dy.yinghezhong.com': db_result = db(ip, UPDATE_ZZ_PLATFORM_HOST_SQL, (f'http://{server_ip}:8000',)) if db_result['result'] > 0: + ZZMockModel.objects.filter(ip=ip).update(**mock_config) return JsonResponse({'status': 'success'}) if current_host == f'http://{server_ip}:8000': + ZZMockModel.objects.filter(ip=ip).update(**mock_config) return JsonResponse({'status': 'success'}) return JsonResponse({'status': 'fail'})