Forráskód Böngészése

update daily msg 定时任务
增加了对 title_md5值字段的计算方法

罗俊辉 9 hónapja
szülő
commit
069303e886
1 módosított fájl, 4 hozzáadás és 3 törlés
  1. 4 3
      updatePublishedMsgDaily.py

+ 4 - 3
updatePublishedMsgDaily.py

@@ -86,14 +86,15 @@ def insertEachMsg(db_client, gh_id, account_name, msg_list):
                     show_zs_count,
                     show_pay_count,
                     wx_sn,
-                    json.dumps(baseInfo, ensure_ascii=False)
+                    json.dumps(baseInfo, ensure_ascii=False),
+                    Functions().str_to_md5(title)
                 )
                 try:
                     insert_sql = f"""
                         INSERT INTO official_articles_v2
-                        (ghId, accountName, appMsgId, title, Type, createTime, updateTime, Digest, ItemIndex, ContentUrl, SourceUrl, CoverImgUrl, CoverImgUrl_1_1, CoverImgUrl_255_1, ItemShowType, IsOriginal, ShowDesc, ori_content, show_view_count, show_like_count, show_zs_count, show_pay_count, wx_sn, baseInfo)
+                        (ghId, accountName, appMsgId, title, Type, createTime, updateTime, Digest, ItemIndex, ContentUrl, SourceUrl, CoverImgUrl, CoverImgUrl_1_1, CoverImgUrl_255_1, ItemShowType, IsOriginal, ShowDesc, ori_content, show_view_count, show_like_count, show_zs_count, show_pay_count, wx_sn, baseInfo, title_md5)
                         values
-                        (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);
+                        (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);
                         """
                     db_client.update(sql=insert_sql, params=info_tuple)
                     log(