Browse Source

update 全部任务查询接口,任务总量返回

kk 2 years ago
parent
commit
3618d801cb
1 changed files with 5 additions and 1 deletions
  1. 5 1
      server/conf_task.py

+ 5 - 1
server/conf_task.py

@@ -118,10 +118,14 @@ def getAllTask():
                 task_name=task_name,
             )
             source_list.append(data)
+
+        t_sql = f"""select count(*) from crawler_task"""
+        t_res = MysqlHelper.get_values(t_sql)
+        total = t_res[0]
     except Exception as e:
         return jsonify({"code": "400", 'message': "任务列表获取失败"})
 
-    return jsonify({'code': '200', 'result': source_list})
+    return jsonify({'code': '200', 'result': source_list, 'total': total})
 
 
 @app.route("/v1/crawler/task/getone", methods=["GET"])