|
@@ -35,6 +35,8 @@ class AppCampaignView(View):
|
|
response = ResponseObject(language, 'pc')
|
|
response = ResponseObject(language, 'pc')
|
|
if operation == 'getCampaignList': # 获取广告活动列表
|
|
if operation == 'getCampaignList': # 获取广告活动列表
|
|
return self.get_campaign_list(request_dict, response)
|
|
return self.get_campaign_list(request_dict, response)
|
|
|
|
+ elif operation == 'getCountryList': # 查询国家列表
|
|
|
|
+ return self.get_country_list(response)
|
|
elif operation == 'addCampaign': # 添加广告活动
|
|
elif operation == 'addCampaign': # 添加广告活动
|
|
return self.add_campaign(request, request_dict, response)
|
|
return self.add_campaign(request, request_dict, response)
|
|
elif operation == 'updateCampaign': # 更新广告活动
|
|
elif operation == 'updateCampaign': # 更新广告活动
|
|
@@ -520,3 +522,24 @@ class AppCampaignView(View):
|
|
|
|
|
|
return response.json(0, {"behavior_log_list": behavior_log_list,
|
|
return response.json(0, {"behavior_log_list": behavior_log_list,
|
|
"total": paginator.count})
|
|
"total": paginator.count})
|
|
|
|
+
|
|
|
|
+ def get_country_list(self, response):
|
|
|
|
+ try:
|
|
|
|
+ if SERVER_TYPE == 'Ansjer.us_config.formal_settings':
|
|
|
|
+ region_api = 'https://www.dvema.com/'
|
|
|
|
+ elif SERVER_TYPE == 'Ansjer.eur_config.formal_settings':
|
|
|
|
+ region_api = 'https://api.zositeche.com/'
|
|
|
|
+ elif SERVER_TYPE == 'Ansjer.cn_config.formal_settings':
|
|
|
|
+ region_api = 'https://www.zositechc.cn/'
|
|
|
|
+ else:
|
|
|
|
+ region_api= 'https://test.zositechc.cn/'
|
|
|
|
+ country_qs = CountryModel.objects.filter(region__api=region_api).values('country_name')
|
|
|
|
+ if not country_qs.exists():
|
|
|
|
+ return response.json(173)
|
|
|
|
+
|
|
|
|
+ country_list = []
|
|
|
|
+ for country in country_qs:
|
|
|
|
+ country_list.append(country['country_name'])
|
|
|
|
+ return response.json(0, {'list': country_list})
|
|
|
|
+ except Exception as e:
|
|
|
|
+ return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|