浏览代码

Merge branch '2024-10-18-luojunhui-new-server-change-minigram' of Server/title_with_video into 2024-09-23newDbTasks

luojunhui 6 月之前
父节点
当前提交
df78620f68
共有 2 个文件被更改,包括 19 次插入24 次删除
  1. 11 17
      server/api/minigram.py
  2. 8 7
      server/api/response.py

+ 11 - 17
server/api/minigram.py

@@ -3,12 +3,6 @@
 """
 minigram_map = {
     1: {
-        # 25: {
-        #     "avatar": "https://rescdn.yishihui.com/0temp/ttmhzfsh.png",
-        #     "id": "wx0b7d95eb293b783b",
-        #     "name": "天天美好祝福生活",
-        #     "index": 25
-        # },
         25: {
                 "avatar": "https://rescdn.yishihui.com/0temp/pqsp.png",
                 "id": "wxbdd2a2e93d9a6e25",
@@ -16,23 +10,23 @@ minigram_map = {
                 "index": 25
             },
         29: {
-            "avatar": "https://rescdn.yishihui.com/0temp/cyfyld.png",
-            "id": "wx65c76bb4c67934db",
-            "name": "财运福运来到",
-            "index": 29
-        },
+                "avatar": "https://rescdn.yishihui.com/0temp/pqsp.png",
+                "id": "wxbdd2a2e93d9a6e25",
+                "name": "票圈视频",
+                "index": 29
+            },
         31: {
-            "avatar": "https://rescdn.yishihui.com/0temp/mhzfshxf2.png",
-            "id": "wx2e4478b1641b3b15",
-            "name": "美好祝福生活幸福",
+            "avatar": "https://rescdn.yishihui.com/0temp/pqsp.png",
+            "id": "wxbdd2a2e93d9a6e25",
+            "name": "票圈视频",
             "index": 31
         }
     },
     2: {
         36: {
-            "avatar": "https://rescdn.yishihui.com/0temp/zfyfyc.jpeg",
-            "id": "wxcddf231abd0dabdc",
-            "name": "祝福有福有财",
+            "avatar": "https://rescdn.yishihui.com/0temp/pqsp.png",
+            "id": "wxbdd2a2e93d9a6e25",
+            "name": "票圈视频",
             "index": 36
         },
         33: {

+ 8 - 7
server/api/response.py

@@ -153,6 +153,7 @@ class Response(object):
         """
         gh_id = result['gh_id']
         response = json.loads(result['response'])
+        long_articles_mini_program_id = 25
         touliu_mini_program_id = 33
         we_com_mini_program_id = 27
         match self.mini_program_type:
@@ -160,13 +161,13 @@ class Response(object):
                 L = []
                 new_item_list = []
                 for index, item in enumerate(response, 1):
-                    random_num = random.randint(1, 10)
-                    if random_num in [1, 2, 3, 4, 5, 6]:
-                        long_articles_mini_program_id = 25
-                    elif random_num in [7, 8]:
-                        long_articles_mini_program_id = 29
-                    else:
-                        long_articles_mini_program_id = 31
+                    # random_num = random.randint(1, 10)
+                    # if random_num in [1, 2, 3, 4, 5, 6]:
+                    #     long_articles_mini_program_id = 25
+                    # elif random_num in [7, 8]:
+                    #     long_articles_mini_program_id = 29
+                    # else:
+                    #     long_articles_mini_program_id = 31
                     card, new_item = await self.generate_single_card(index, gh_id, long_articles_mini_program_id, item)
                     L.append(card)
                     new_item_list.append(new_item)