12 lines
386 B
Python
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:")
|