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

47 lines
2.1 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 wechat_ipad.provider_base import WechatProviderBase
from wechat_ipad.providers.server_864.base import Server864APIClientBase
from wechat_ipad.providers.server_864.friend_circle import FriendCircleMixin
from wechat_ipad.providers.server_864.friends import FriendMixin
from wechat_ipad.providers.server_864.group import ChatroomMixin
from wechat_ipad.providers.server_864.login import LoginMixin
from wechat_ipad.providers.server_864.message import MessageMixin
from wechat_ipad.providers.server_864.runtime import Server864RuntimeMixin
from wechat_ipad.providers.server_864.user import UserMixin
class Server864WechatClient(
LoginMixin,
MessageMixin,
FriendCircleMixin,
FriendMixin,
ChatroomMixin,
UserMixin,
Server864RuntimeMixin,
WechatProviderBase,
):
"""864 风格 server 的独立 provider。
说明:
1. 这里保持与 855 provider 类似的模块拆分方式,方便未来继续并行维护多个 server
2. 但内部实现完全独立,不在 855 provider 里堆 `if server_type == 864` 分支;
3. 第一版优先覆盖当前项目真实主链路与常用管理能力,后续再按需要补更多高级接口。
"""
provider_name = "server_864"
server_type = "server_864"
def __init__(self, ip: str, port: int, **kwargs):
"""初始化 864 provider。"""
server_key = str(kwargs.pop("server_key", "") or "").strip()
Server864APIClientBase.__init__(self, ip, port, server_key=server_key, **kwargs)
MessageMixin.__init__(self)
self._init_runtime_state()
async def run_login_health_check(self) -> bool:
"""执行 864 provider 的登录态巡检。"""
# 864 当前不依赖 855 那套“二次自动校验”模型:
# 1. 登录状态更多由服务端维护,客户端不需要额外补一次旧版登录恢复动作;
# 2. 因此这里显式返回 False表示“本 provider 没有额外巡检动作”,避免系统任务报错;
# 3. 后续如果 864 需要补自己的巡检逻辑,也只需要在本 provider 内部扩展。
return False