| | |
| | | namespace WIDESEAWCS_Tasks.Workflow.Abstractions |
| | | { |
| | | /// <summary> |
| | | /// 机器人消息路由入口。用于承接 TcpSocketServer 的消息事件。 |
| | | /// 机器人消息路由接口 - 负责接收来自 TcpSocketServer 的消息并分发给合适的处理器 |
| | | /// </summary> |
| | | public interface IRobotMessageRouter |
| | | { |
| | | /// <summary> |
| | | /// 处理接收到的消息 |
| | | /// </summary> |
| | | /// <param name="message">原始消息字符串</param> |
| | | /// <param name="isJson">消息是否为 JSON 格式</param> |
| | | /// <param name="client">TCP 客户端连接</param> |
| | | /// <param name="state">机器人当前状态</param> |
| | | /// <returns>响应消息,如果无需回复则返回 null</returns> |
| | | Task<string?> HandleMessageReceivedAsync(string message, bool isJson, TcpClient client, RobotSocketState state); |
| | | } |
| | | } |
| | | |