Browse Source

flask_app: 接口增加参数

Signed-off-by: Binren Zhnag <zhangbr@elab-plus.com>
Binren Zhnag 5 years ago
parent
commit
83ee40cb77
1 changed files with 3 additions and 2 deletions
  1. 3 2
      flask_app.py

+ 3 - 2
flask_app.py

@@ -218,8 +218,9 @@ def update_other_city():
 @app.route('/report_test', methods=['GET', 'POST'])
 def report_test():
     try:
-        reprt_push = ReportPush('bi_report')
-        result = reprt_push.report_data_query(2)
+        task_id = request.args.get('id', default=None, type=int)
+        report_push = ReportPush('bi_report')
+        result = report_push.report_data_query(task_id)
         return json.dumps(result, ensure_ascii=False, cls=DecimalEncoder)
     except Exception as e:
         return str(e)