feat(accounts): 统一可换绑时间并加本地 7 天锁
- 新增官方时间、本地 bind_ok、7 天锁到期、检查时间和来源字段 - role_change_available_at 改为官方时间与本地锁取较晚者 - 绑定成功和官方探测统一写有效时间 - 分配过滤增加最近 elite bind_ok 的数据库兜底 - 迁移 0129 从 account_events 回填历史账号 - 补充字段/回填过滤测试和生命周期文档
This commit is contained in:
@@ -32,6 +32,7 @@ from .account_binding import (
|
||||
binding_pending_decision,
|
||||
binding_snapshot,
|
||||
derive_from_bind_info,
|
||||
effective_role_change_available_at,
|
||||
is_bound_act,
|
||||
role_change_available_at,
|
||||
set_bind_status,
|
||||
@@ -1011,9 +1012,14 @@ def _apply_role_result(
|
||||
account.game_name = role_name
|
||||
account.game_channel = channel
|
||||
account.change_role_wait_time = _to_int(role.get("change_role_wait_time"))
|
||||
account.role_change_available_at = role_change_available_at(
|
||||
role.get("bind_info")
|
||||
official_at = role_change_available_at(role.get("bind_info"))
|
||||
account.role_change_official_at = official_at
|
||||
account.role_change_checked_at = datetime.now(UTC)
|
||||
account.role_change_available_at = effective_role_change_available_at(
|
||||
official_at=official_at,
|
||||
last_bind_ok_at=account.last_bind_ok_at,
|
||||
)
|
||||
account.role_change_source = "official"
|
||||
elif scope == SCOPE_ESPORTS:
|
||||
account.esports_game_name = role_name
|
||||
account.esports_game_channel = channel
|
||||
|
||||
Reference in New Issue
Block a user