Files
abot/wechat_ipad/provider_base.py
2026-05-07 13:48:49 +08:00

26 lines
1.0 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from abc import ABC
class WechatProviderBase(ABC):
"""微信接入 Provider 的轻量基类。
设计说明:
1. 当前阶段不强制所有 Provider 继承一整套复杂抽象接口,只提供一个共同的语义入口;
2. 这里保留 `provider_name`、`server_type` 两个最基础标识,便于 Gateway 与日志识别;
3. 后续如需补统一生命周期方法,可继续在该基类上增量扩展,而不影响现有阅读体验。
"""
provider_name = "base"
server_type = "base"
async def run_login_health_check(self) -> bool:
"""执行 provider 自己定义的登录态巡检。
设计说明:
1. 不同 provider 的登录维护方式差异很大,不能再把这类逻辑留在 Robot 业务层;
2. 855 需要继续执行“二次登录校验”864 当前则不依赖这套动作;
3. 因此基类默认返回 False表示“当前 provider 没有额外巡检动作”,具体实现由各 provider 自己覆盖。
"""
return False