|
@@ -11,7 +11,7 @@ import urllib.parse
|
|
|
|
|
|
from applications.functions.log import logging
|
|
from applications.functions.log import logging
|
|
from static.config import db_article
|
|
from static.config import db_article
|
|
-from applications.functions.common import request_for_info
|
|
|
|
|
|
+from applications.functions.common import request_for_info, shuffle_list
|
|
|
|
|
|
|
|
|
|
class Response(object):
|
|
class Response(object):
|
|
@@ -19,7 +19,7 @@ class Response(object):
|
|
召回逻辑
|
|
召回逻辑
|
|
"""
|
|
"""
|
|
|
|
|
|
- def __init__(self, trace_id, mysql_client, mini_program_type):
|
|
|
|
|
|
+ def __init__(self, trace_id, mysql_client, mini_program_type, flow_pool_level_tag):
|
|
"""
|
|
"""
|
|
长文: 25, 29, 31
|
|
长文: 25, 29, 31
|
|
投流: 33
|
|
投流: 33
|
|
@@ -31,6 +31,7 @@ class Response(object):
|
|
self.trace_id = trace_id
|
|
self.trace_id = trace_id
|
|
self.mysql_client = mysql_client
|
|
self.mysql_client = mysql_client
|
|
self.mini_program_type = mini_program_type
|
|
self.mini_program_type = mini_program_type
|
|
|
|
+ self.flow_pool_level_tag = flow_pool_level_tag
|
|
self.mini_map = {
|
|
self.mini_map = {
|
|
# 25: {
|
|
# 25: {
|
|
# "avatar": "https://rescdn.yishihui.com/0temp/ttmhzfsh.png",
|
|
# "avatar": "https://rescdn.yishihui.com/0temp/ttmhzfsh.png",
|
|
@@ -81,10 +82,15 @@ class Response(object):
|
|
"index": 33
|
|
"index": 33
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- # self.test_id_set = {'gh_080bb43aa0dc', 'gh_e0eb490115f5', 'gh_6d9f36e3a7be', 'gh_29074b51f2b7', 'gh_6d205db62f04',
|
|
|
|
- # 'gh_d49df5e974ca', 'gh_d4dffc34ac39', 'gh_89ef4798d3ea', 'gh_b15de7c99912', 'gh_9eef14ad6c16',
|
|
|
|
- # 'gh_0c89e11f8bf3', 'gh_f902cea89e48', 'gh_6b7c2a257263', 'gh_183d80deffb8', 'gh_9f8dc5b0c74e',
|
|
|
|
- # 'gh_1b27dd1beeca', 'gh_e24da99dc899', 'gh_dd4c857bbb36', 'gh_7e5818b2dd83'}
|
|
|
|
|
|
+ self.test_accounts = {}
|
|
|
|
+
|
|
|
|
+ async def chooseBestVideoId(self, ori_vid_list):
|
|
|
|
+ """
|
|
|
|
+ 选择裂变表现最好的视频 id
|
|
|
|
+ :return:
|
|
|
|
+ """
|
|
|
|
+
|
|
|
|
+ return ori_vid_list
|
|
|
|
|
|
async def get_result(self):
|
|
async def get_result(self):
|
|
"""
|
|
"""
|
|
@@ -100,14 +106,26 @@ class Response(object):
|
|
gh_id, vid1, vid2, vid3, kimi_title, content_status, process_times = info_tuple[
|
|
gh_id, vid1, vid2, vid3, kimi_title, content_status, process_times = info_tuple[
|
|
0
|
|
0
|
|
]
|
|
]
|
|
|
|
+ ori_video_id_list = [vid1, vid2, vid3]
|
|
|
|
+
|
|
|
|
+ if self.flow_pool_level_tag == 'autoArticlePoolLevel4':
|
|
|
|
+ result_list = shuffle_list(ori_video_id_list)
|
|
|
|
+ elif self.flow_pool_level_tag == 'autoArticlePoolLevel3':
|
|
|
|
+ result_list = await self.chooseBestVideoId(ori_video_id_list)
|
|
|
|
+ # elif self.flow_pool_level_tag == 'autoArticlePoolLevel1':
|
|
|
|
+ # result_list = ori_video_id_list
|
|
|
|
+ # elif self.flow_pool_level_tag == 'default':
|
|
|
|
+ # result_list = ori_video_id_list
|
|
|
|
+ else:
|
|
|
|
+ result_list = ori_video_id_list
|
|
|
|
+
|
|
response = {
|
|
response = {
|
|
"gh_id": gh_id,
|
|
"gh_id": gh_id,
|
|
- "vid_list": [vid1, vid2, vid3],
|
|
|
|
|
|
+ "vid_list": result_list,
|
|
"kimi_title": kimi_title,
|
|
"kimi_title": kimi_title,
|
|
"content_status": content_status,
|
|
"content_status": content_status,
|
|
"process_times": process_times,
|
|
"process_times": process_times,
|
|
}
|
|
}
|
|
- print(response)
|
|
|
|
return response
|
|
return response
|
|
|
|
|
|
def create_gzh_path(self, video_id, shared_uid, gh_id):
|
|
def create_gzh_path(self, video_id, shared_uid, gh_id):
|