Browse Source

mysql_helper.py 增加默认值
spider_map.py 增加备注

罗俊辉 1 year ago
parent
commit
9948edc4f5

+ 2 - 2
application/common/mysql/mysql_helper.py

@@ -17,9 +17,9 @@ from application.config.mysql_config import env_dict
 
 class MysqlHelper(object):
     """
-    MySQL工具
+    MySQL工具, env默认prod版本
     """
-    def __init__(self, env='', mode='', platform='', action=''):
+    def __init__(self, env="prod", mode='', platform='', action=''):
         mysql_config = env_dict[env]
         self.connection = pymysql.connect(
             host=mysql_config['host'],  # 数据库IP地址,内网地址

+ 7 - 1
application/config/topic_group_queue.py

@@ -1,12 +1,18 @@
 class TopicGroup(object):
+    """
+    生成topic,group, platform, mode等信息
+    """
     def __init__(self):
         self.spider_list = [
             ("test", "recommend", "test"),
             ("zhsdm", "recommend", "zhuhaoshiduomo"),
-            # ("zchqs", "recommend"),
         ]
 
     def produce(self):
+        """
+        工作代码
+        :return: list [{}, {}, {}, {}, {}]
+        """
         result = [
             {
                 "topic": "{}_{}_prod".format(i[0], i[1]),

+ 1 - 0
spider/spider_map.py

@@ -15,6 +15,7 @@ spider_map = {
     "test": {
         "recommend": TestClass
     },
+    # 祝好事多磨
     "zhuhaoshiduomo": {
         "recommend": ZhuHaoShiDuoMoRecommend
     }