2025-08-08 22:08:10 +08:00
|
|
|
import threading
|
|
|
|
|
from typing import Dict, Any
|
|
|
|
|
from Entity.AnchorModel import AnchorModel
|
|
|
|
|
|
2025-08-01 13:43:51 +08:00
|
|
|
# wda apple bundle id
|
2025-08-28 22:10:32 +08:00
|
|
|
WdaAppBundleId = "com.yolozsAgent.wda.xctrunner"
|
2025-09-03 16:34:29 +08:00
|
|
|
|
2025-08-08 22:08:10 +08:00
|
|
|
# 全局主播列表
|
|
|
|
|
anchorList: list[AnchorModel] = []
|
|
|
|
|
# 线程锁
|
|
|
|
|
anchorListLock = threading.Lock()
|
2025-08-12 18:53:06 +08:00
|
|
|
# 打招呼数据
|
|
|
|
|
prologueList = []
|
|
|
|
|
# 评论列表
|
|
|
|
|
commentsList = []
|
2025-08-13 20:20:13 +08:00
|
|
|
# 存储主播名和session_id的字典
|
|
|
|
|
anchorWithSession = {}
|
2025-08-08 22:08:10 +08:00
|
|
|
|
2025-09-04 19:35:36 +08:00
|
|
|
# 前端传递的token
|
2025-09-03 19:03:34 +08:00
|
|
|
token = ''
|
2025-09-04 19:35:36 +08:00
|
|
|
# 前端传递的
|
|
|
|
|
tenantId = 0
|
|
|
|
|
|
|
|
|
|
userId = 0
|
2025-09-03 19:03:34 +08:00
|
|
|
|
|
|
|
|
|
2025-08-08 22:08:10 +08:00
|
|
|
# 安全删除数据
|
|
|
|
|
def removeModelFromAnchorList(model: AnchorModel):
|
|
|
|
|
with anchorListLock:
|
|
|
|
|
anchorList.remove(model)
|
|
|
|
|
|
2025-09-03 19:03:34 +08:00
|
|
|
|
2025-08-08 22:08:10 +08:00
|
|
|
# 添加数据
|
|
|
|
|
def addModelToAnchorList(models: list[Dict[str, Any]]):
|
|
|
|
|
with anchorListLock:
|
|
|
|
|
for dic in models:
|
|
|
|
|
obj = AnchorModel.dictToModel(dic)
|
2025-08-11 22:06:48 +08:00
|
|
|
anchorList.append(obj)
|