- 新增 POST /api/huya/workbench-accounts/import-cookies(huya:task + huya:import): 外部 CK 复用现有解析入库后直接加入当前用户的工作台集合,导入完即可在工作台执行 「生成开通支付码/绑定二维码/查询角色/刷新积分」等操作 - 新账号自动 assigned_to=导入者:客服的账号列表按归属过滤,不设归属会「导入成功但看不到」 - import_huya_cookies_detailed 返回账号对象供工作台复用,原 import_huya_cookies 行为不变 - 工作台账号卡片新增「导入外部 CK」入口(huya:import 权限控制)与导入弹窗 验证:新增 tests/test_huya_workbench_import_ck.py(入库、归属、工作台集合、重复导入幂等、 全脏数据不建记录);按 AGENTS.md 做了反向验证(关掉归属赋值后该用例变红,还原后恢复)。 前端 tsc -b 与全量 pytest 通过。
105 lines
2.7 KiB
Python
105 lines
2.7 KiB
Python
"""虎牙 API:按账号 / 登录 / 注册 / Cookie / 工作台 / 设备拆分。"""
|
|
|
|
from fastapi import APIRouter
|
|
|
|
from .accounts import (
|
|
assign_account,
|
|
batch_assign_accounts,
|
|
batch_tag,
|
|
batch_tag_selection,
|
|
create_browser_exchange_kit,
|
|
delete_account,
|
|
delete_accounts_batch,
|
|
delete_accounts_batch_selection,
|
|
import_cookies,
|
|
import_password_accounts,
|
|
list_accounts,
|
|
list_huya_account_ids,
|
|
list_tags,
|
|
set_account_tag,
|
|
)
|
|
from .accounts import router as accounts_router
|
|
from .cookies import router as cookies_router
|
|
from .devices import router as devices_router
|
|
from .login import (
|
|
app_password_login_account,
|
|
app_password_login_selected_accounts,
|
|
auto_sms_login_account,
|
|
fetch_account_sms_code,
|
|
password_login_account,
|
|
password_login_selected_accounts,
|
|
send_sms_code,
|
|
sms_login_account,
|
|
test_sms_url_endpoint,
|
|
)
|
|
from .login import router as login_router
|
|
from .register import router as register_router
|
|
from .workbench import (
|
|
cleanup_orphan_tasks,
|
|
create_task_batch,
|
|
get_config,
|
|
get_task,
|
|
import_workbench_cookies,
|
|
list_goods,
|
|
list_huya_workbench_accounts,
|
|
list_recharge_goods,
|
|
list_tasks,
|
|
stop_batch,
|
|
task_types,
|
|
tasks_summary,
|
|
update_config,
|
|
update_huya_workbench_accounts,
|
|
ws_huya_logs,
|
|
)
|
|
from .workbench import router as workbench_router
|
|
|
|
router = APIRouter(prefix="/api/huya", tags=["虎牙"])
|
|
router.include_router(accounts_router)
|
|
router.include_router(login_router)
|
|
router.include_router(register_router)
|
|
router.include_router(cookies_router)
|
|
router.include_router(workbench_router)
|
|
router.include_router(devices_router)
|
|
|
|
__all__ = [
|
|
"app_password_login_account",
|
|
"app_password_login_selected_accounts",
|
|
"assign_account",
|
|
"auto_sms_login_account",
|
|
"batch_assign_accounts",
|
|
"batch_tag",
|
|
"batch_tag_selection",
|
|
"cleanup_orphan_tasks",
|
|
"create_browser_exchange_kit",
|
|
"create_task_batch",
|
|
"delete_account",
|
|
"delete_accounts_batch",
|
|
"delete_accounts_batch_selection",
|
|
"fetch_account_sms_code",
|
|
"get_config",
|
|
"get_task",
|
|
"import_cookies",
|
|
"import_password_accounts",
|
|
"import_workbench_cookies",
|
|
"list_accounts",
|
|
"list_goods",
|
|
"list_huya_account_ids",
|
|
"list_huya_workbench_accounts",
|
|
"list_recharge_goods",
|
|
"list_tags",
|
|
"list_tasks",
|
|
"password_login_account",
|
|
"password_login_selected_accounts",
|
|
"router",
|
|
"send_sms_code",
|
|
"set_account_tag",
|
|
"sms_login_account",
|
|
"stop_batch",
|
|
"task_types",
|
|
"tasks_summary",
|
|
"test_sms_url_endpoint",
|
|
"update_config",
|
|
"update_huya_workbench_accounts",
|
|
"ws_huya_logs",
|
|
]
|