feat(douyu): 落地账号平台同步与登录配额

This commit is contained in:
yml
2026-11-21 21:27:14 +08:00
parent 72bc346c9b
commit 1d262cdfd9
30 changed files with 3087 additions and 85 deletions
+18
View File
@@ -157,6 +157,24 @@ def is_high_value_expr(*, now: datetime | None = None):
return value_tier_expr(now=now) <= HIGH_VALUE_TIER_MAX
def is_high_value_account(
account: Account,
*,
now: datetime | None = None,
) -> bool:
"""Python 侧价值判定,供登录分类和库存队列复用 SQL 口径。"""
moment = now or datetime.now(UTC)
fresh = bool(
account.high_value_checked_at
and account.high_value_checked_at >= high_value_fresh_cutoff(now=moment)
)
available = fresh and (
account.high_value_bairimeng_status == HIGH_VALUE_STATUS_AVAILABLE
or account.high_value_mengtu_status == HIGH_VALUE_STATUS_AVAILABLE
)
return available or int(account.points or 0) >= HIGH_VALUE_POINTS
def suit_sort_rank_expr(*, now: datetime | None = None):
"""列表「高价值套装」列的排序,和格子上看到的一致。数字越小越值钱。