|
@@ -1,18 +1,16 @@
|
|
-import os
|
|
|
|
|
|
+import uuid
|
|
|
|
+import yaml
|
|
|
|
|
|
headers = {'Content-Type': 'application/json'}
|
|
headers = {'Content-Type': 'application/json'}
|
|
|
|
|
|
-os_env = os.getenv('LYY_DEV', 'unknown')
|
|
|
|
-debug_url = "http://139.186.134.115:8806/jeecg-boot/"
|
|
|
|
-product_url = 'http://api.tjyourong.com.cn/jeecg-boot/'
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-dev_server_port = 'http://139.186.165.84:31012/'
|
|
|
|
-product_server_port = 'http://139.186.27.96:31012/'
|
|
|
|
|
|
+with open('/data/pythonProject/ai_target/config/config.yaml', mode='r', encoding='utf-8') as f:
|
|
|
|
+ config = yaml.load(f.read(), Loader=yaml.FullLoader)
|
|
|
|
+ mac_ip_config = config['mac_ip_config']
|
|
|
|
|
|
|
|
+mac = uuid.UUID(int=uuid.getnode()).hex[-12:]
|
|
|
|
|
|
# 创建计划url
|
|
# 创建计划url
|
|
-create_campaign_url = (debug_url if os_env == 'dev' else product_url) + 'kuaishou/create/campaignCreate'
|
|
|
|
|
|
+create_campaign_url = mac_ip_config[mac]['yourong_url'] + 'kuaishou/create/campaignCreate'
|
|
|
|
|
|
# 修改广告计划状态url
|
|
# 修改广告计划状态url
|
|
# 入参:accountId 账户id Long
|
|
# 入参:accountId 账户id Long
|
|
@@ -35,16 +33,14 @@ create_campaign_url = (debug_url if os_env == 'dev' else product_url) + 'kuaisho
|
|
# },
|
|
# },
|
|
# "timestamp": 1630030314462
|
|
# "timestamp": 1630030314462
|
|
# }
|
|
# }
|
|
-update_campaign_status_url = (debug_url if os_env == 'dev' else product_url) + 'kuaishou/batch/batchUpdateStatus'
|
|
|
|
-
|
|
|
|
|
|
+update_campaign_status_url = mac_ip_config[mac]['yourong_url'] + 'kuaishou/batch/batchUpdateStatus'
|
|
|
|
|
|
# 创建组和创意url
|
|
# 创建组和创意url
|
|
-create_group_and_creative_url = (debug_url if os_env == 'dev' else product_url) + 'kuaishou/create/createUnitAndCreative'
|
|
|
|
|
|
+create_group_and_creative_url = mac_ip_config[mac]['yourong_url'] + 'kuaishou/create/createUnitAndCreative'
|
|
|
|
|
|
# ai_target_combine 服务的接口
|
|
# ai_target_combine 服务的接口
|
|
-target_combine_url = (dev_server_port if os_env == 'dev' else product_server_port) + 'ai_target_combine'
|
|
|
|
|
|
+target_combine_url = mac_ip_config[mac]['ai_target_url'] + 'ai_target_combine'
|
|
|
|
|
|
# 定向人群预估查询
|
|
# 定向人群预估查询
|
|
-
|
|
|
|
-estimate_people_number_url = (debug_url if os_env == 'dev' else product_url) + 'estimatePeopleNumber/getCount'
|
|
|
|
|
|
+estimate_people_number_url = mac_ip_config[mac]['yourong_url'] + 'estimatePeopleNumber/getCount'
|
|
|
|
|