소스 검색

修改上新代码逻辑

syh 4 년 전
부모
커밋
12944e9b2d
4개의 변경된 파일8개의 추가작업 그리고 14개의 파일을 삭제
  1. 1 1
      .idea/ai_ads.iml
  2. 1 1
      .idea/misc.xml
  3. 1 0
      ai_historical_high_quality_material_handler.py
  4. 5 12
      server.py

+ 1 - 1
.idea/ai_ads.iml

@@ -5,7 +5,7 @@
       <excludeFolder url="file://$MODULE_DIR$/.pytest_cache" />
       <excludeFolder url="file://$MODULE_DIR$/venv" />
     </content>
-    <orderEntry type="inheritedJdk" />
+    <orderEntry type="jdk" jdkName="Python 3.8 (base)" jdkType="Python SDK" />
     <orderEntry type="sourceFolder" forTests="false" />
   </component>
   <component name="PyDocumentationSettings">

+ 1 - 1
.idea/misc.xml

@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
-  <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (ai_ads)" project-jdk-type="Python SDK" />
+  <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8 (base)" project-jdk-type="Python SDK" />
 </project>

+ 1 - 0
ai_historical_high_quality_material_handler.py

@@ -5,6 +5,7 @@ import traceback
 import requests
 import tornado.web
 from utils.DataBaseConfig import *
+from utils.UrlConfig import *
 
 
 class AiHistoricalHighQualityMaterial(tornado.web.RequestHandler):

+ 5 - 12
server.py

@@ -4,8 +4,10 @@ from utils.HttpUtils import HttpUtils
 from ai_auto_create_creative_job import AiAutoCreateCreativeJob
 import json
 from utils import ResultDictUtils
+from flask_cors import CORS
 
 app = Flask(__name__)
+CORS(app, resources=r'/*')
 mysql = MysqlSearchUtils()
 httpUtils = HttpUtils()
 aiAutoCreateCreativeJob = AiAutoCreateCreativeJob()
@@ -26,8 +28,10 @@ def get_json():
     return response_dict
 
 
-@app.route('/getList')
+@app.route('/getList',methods=["post"])
 def get_list():
+    body = request.json
+    print(body["accountId"])
     response_dict = {}
     list = mysql.get_all()
     response_dict["list"] = list
@@ -50,16 +54,5 @@ def auto_create_creative_job():
     response_dict["data"] = rest
     return response_dict
 
-@app.route('/autoCreateCreativeJob')
-def auto_create_creative_job():
-    response_dict = ResultDictUtils.common_success_dict
-    account_id = request.args.get("accountId")
-    if 0 == account_id or account_id is None:
-        return ResultDictUtils.params_error_dict
-    rest = aiAutoCreateCreativeJob.auto_create_job(account_id)
-    response_dict["data"] = rest
-    return response_dict
-
-
 if __name__ == '__main__':
     app.run(host='0.0.0.0',port=8079,debug=True)