Browse Source

add 获取一个api开发

kk 2 năm trước cách đây
mục cha
commit
c996de1506
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      server/conf_task.py

+ 3 - 3
server/conf_task.py

@@ -21,13 +21,13 @@ def getSource():
     get_data = request.args.to_dict()
     fields = get_data.get('fields')
     # # 对参数进行操作
-    sql = 'select source, task_type, spider_name, machine, description from crawler_source'
+    sql = 'select source, task_type, spider_name, machine, source_desc, task_type_desc, spider_name_desc from crawler_source'
 
     result = MysqlHelper.get_values(sql)
     if not result:
         return jsonify({'code': '200', 'result': [], 'message': 'no data'})
     source_list = list()
-    for source, task_type, spider_name, machine, description, task_type_desc, spider_name_desc in result:
+    for source, task_type, spider_name, machine, source_desc, task_type_desc, spider_name_desc in result:
         source_dict = {}
         source_dict[source] = {
             'task_type': [
@@ -41,7 +41,7 @@ def getSource():
                     ]
                 }
             ],
-            'description': description
+            'description': source_desc
         }
         source_list.append(source_dict)
     return jsonify({'code': '200', 'result': source_list})