refactor(douyu): 统一活动查询与直播商品映射

- 收口斗鱼活动、商品、绑定信息和兑换资格查询
- 工作台改为复用统一客户端、快照与实时商品目录
- 补充活动查询与商品映射测试
This commit is contained in:
yml
2026-11-18 10:59:20 +08:00
parent 1ca768eba5
commit 0220ef995f
15 changed files with 711 additions and 303 deletions
+3 -2
View File
@@ -19,6 +19,7 @@ from core.douyu import (
from ..models import Account, DouyuTask
from .business_events import record_recharge
from .douyu_activity_query import query_exchange_balance, query_gold_account
from .douyu_runner_core import DOUYU_PAYMENT_POLL_INTERVAL, DOUYU_PAYMENT_POLL_SECONDS
from .douyu_service import update_account_profile_from_cookie
@@ -42,8 +43,8 @@ class GoldMixin:
self, client: DouyuActivityClient, account: Account
) -> dict:
"""刷新鱼翅和钱包兑换余额并写回账号表。"""
gold = client.gold_account()
exchange = client.exchange_balance()
gold = query_gold_account(client)
exchange = query_exchange_balance(client)
account.gold_balance = self._to_int(gold.get("gold"))
account.exchange_balance = self._to_int(exchange.get("count"))
account.updated_at = datetime.now(UTC)