合并代码
This commit is contained in:
@@ -305,6 +305,39 @@ def passAnchorData():
|
||||
LogManager.error(e)
|
||||
return ResultData(data="", code=1001).toJson()
|
||||
|
||||
@app.route('/followAndGreetUnion', methods=['POST'])
|
||||
def followAndGreetUnion():
|
||||
try:
|
||||
LogManager.method_info("关注打招呼", "关注打招呼(联盟号)")
|
||||
data: Dict[str, Any] = request.get_json()
|
||||
# 设备列表
|
||||
idList = data.get("deviceList", [])
|
||||
# 主播列表
|
||||
acList = data.get("anchorList", [])
|
||||
LogManager.info(f"[INFO] 获取数据: {idList} {acList}")
|
||||
|
||||
AiUtils.save_aclist_flat_append(acList)
|
||||
|
||||
# 是否需要回复
|
||||
needReply = data.get("needReply", True)
|
||||
# 获取打招呼数据
|
||||
ev.prologueList = data.get("prologueList", [])
|
||||
|
||||
# 添加主播数据
|
||||
addModelToAnchorList(acList)
|
||||
# 启动线程,执行脚本
|
||||
for udid in idList:
|
||||
manager = ScriptManager()
|
||||
event = threading.Event()
|
||||
# 启动脚本
|
||||
thread = threading.Thread(target=manager.safe_followAndGreetUnion, args=(udid, needReply, event))
|
||||
# 添加到线程管理
|
||||
ThreadManager.add(udid, thread, event)
|
||||
return ResultData(data="").toJson()
|
||||
except Exception as e:
|
||||
LogManager.error(e)
|
||||
return ResultData(data="", code=1001).toJson()
|
||||
|
||||
|
||||
# 获取私信数据
|
||||
@app.route("/getPrologueList", methods=['GET'])
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user