ForcePilot/backend/package/yuxi/channel/session/user_mapping.py
Kris bab30f2715
Some checks failed
Deploy VitePress site to Pages / build (push) Has been cancelled
Ruff Format Check / Ruff Format & Lint (push) Has been cancelled
Deploy VitePress site to Pages / Deploy (push) Has been cancelled
feat:0715
2026-07-15 12:30:58 +08:00

12 lines
386 B
Python

"""渠道虚拟用户 UID 映射"""
def build_channel_user_uid(channel_type: str, account_id: str) -> str:
"""按 `channel:{channel_type}:{account_id}` 格式构造渠道虚拟用户 UID。"""
return f"channel:{channel_type}:{account_id}"
def is_channel_user(uid: str) -> bool:
"""判断给定 UID 是否为渠道虚拟用户。"""
return uid.startswith("channel:")