本次提交对渠道模块进行了全面升级,包含以下核心改进: 1. 新增二维码登录相关协议方法,完善登录流程 2. 优化配置监听逻辑,增加渠道运行状态前置校验 3. 重构动作注册机制,支持动态注册渠道动作并新增批量操作能力 4. 扩展渠道能力模型,新增广播、文件传输等支持 5. 优化适配器加载路径,新增元宝适配器支持 6. 新增凭证过期检查与告警能力,完善运维监控 7. 重构统计收集器,支持多维度渠道统计数据 8. 优化消息路由策略,新增策略缓存与安全处理逻辑 9. 重构基础适配器,新增凭证管理工具方法 10. 完善状态存储功能,支持凭证数据管理与批量清理 11. 重构渠道管理器,新增配置校验、动态渠道管理、限流能力 12. 优化健康检查与状态上报逻辑,完善审计日志与异常处理
24 lines
623 B
Python
24 lines
623 B
Python
from __future__ import annotations
|
|
|
|
from typing import TYPE_CHECKING, Protocol, runtime_checkable
|
|
|
|
if TYPE_CHECKING:
|
|
from yuxi.channels.models import HealthStatus
|
|
|
|
|
|
@runtime_checkable
|
|
class ChannelGatewayProtocol(Protocol):
|
|
async def connect(self) -> None: ...
|
|
|
|
async def disconnect(self) -> None: ...
|
|
|
|
async def health_check(self) -> HealthStatus: ...
|
|
|
|
async def pre_connect(self) -> dict: ...
|
|
|
|
async def logout_account(self, ctx) -> None: ...
|
|
|
|
async def login_with_qr_start(self, force: bool, timeout_ms: int) -> str: ...
|
|
|
|
async def login_with_qr_check(self, session_id: str) -> dict: ...
|