ソースを参照

修改配置文件

liyuyi@c-top.com.cn 3 年 前
コミット
41a7816842
3 ファイル変更31 行追加18 行削除
  1. 3 1
      .idea/ai_target.iml
  2. 17 2
      config/config.yaml
  3. 11 15
      config/url.py

+ 3 - 1
.idea/ai_target.iml

@@ -1,7 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <module type="PYTHON_MODULE" version="4">
   <component name="NewModuleRootManager">
-    <content url="file://$MODULE_DIR$" />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
+    </content>
     <orderEntry type="jdk" jdkName="Remote Python 3.8.10 (sftp://root@139.186.165.84:22/data/Miniconda3/envs/ai_target/bin/python)" jdkType="Python SDK" />
     <orderEntry type="sourceFolder" forTests="false" />
   </component>

+ 17 - 2
config/config.yaml

@@ -63,9 +63,9 @@ bayesDim:
         fieldName: 'city'
 
 
-# 活跃素材筛选规则:近7天累计激活个数达到100个
+# 活跃素材筛选规则:近60天累计激活个数达到100个
 activeMaterialFilterRule:
-  days: 14
+  days: 60
   activation: 100
 
 # 计算推荐组合的素材筛选规则:近两个月内累计达到100个
@@ -85,5 +85,20 @@ filterTargetCombine:
     combineCnt: 20
 
 
+mac_ip_config:
+  # 开发环境
+  '5254003fa716':
+      ai_target_url: "http://139.186.165.84:31012/"
+      yourong_url: "http://192.168.0.195:8806/jeecg-boot/"
+  # 测试环境
+  '52540003f5dd':
+      ai_target_url: "http://139.186.134.115:31012/"
+      yourong_url: "http://192.168.0.195:8806/jeecg-boot/"
+  # 生产环境
+  '525400c98142':
+      ai_target_url: "http://139.186.27.96:31012/"
+      yourong_url: "http://api.tjyourong.com.cn/jeecg-boot/"
+
+
 
 

+ 11 - 15
config/url.py

@@ -1,18 +1,16 @@
-import os
+import uuid
+import yaml
 
 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
-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
 # 入参:accountId    账户id                     Long
@@ -35,16 +33,14 @@ create_campaign_url = (debug_url if os_env == 'dev' else product_url) + 'kuaisho
 #     },
 #     "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
-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 服务的接口
-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'