Browse Source

update 获取数据源接口数据接口修改

kk 2 years ago
parent
commit
a5fb22f0a2
1 changed files with 15 additions and 6 deletions
  1. 15 6
      server/conf_task.py

+ 15 - 6
server/conf_task.py

@@ -28,17 +28,26 @@ def getSource():
         if not result:
             return jsonify({'code': '200', 'result': [], 'message': '没有更多数据'})
         source_list = list()
+
+        # [
+        #     {
+        #         'description': task_type_desc,
+        #         'type': [
+        #             {
+        #                 'spider_name': spider_name,
+        #                 'description': spider_name_desc
+        #             }
+        #         ],
         for source, task_type, spider_name, machine, source_desc, task_type_desc, spider_name_desc in result:
             source_dict = {
                 'task_type': [
                     {
+                        'type': task_type,
                         'description': task_type_desc,
-                        'author': [
-                            {
-                                'spider_name': spider_name,
-                                'description': spider_name_desc
-                            }
-                        ]
+                        'spider': {
+                            'spider_name': spider_name,
+                            'description': spider_name_desc
+                        }
                     }
                 ],
                 'description': source_desc,