|
@@ -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)
|