From cde6ad77663a80d78d77568428a6287b53347716 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期四, 19 三月 2026 17:19:55 +0800
Subject: [PATCH] feat: 新增API路由缓存预热并完善机器人消息日志

---
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotJob.cs |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotJob.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotJob.cs
index f6b1ac5..c7b91b3 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotJob.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotJob.cs
@@ -7,6 +7,7 @@
 using WIDESEAWCS_Tasks.Workflow.Abstractions;
 using WIDESEAWCS_Tasks.Workflow;
 using WIDESEAWCS_Tasks.SocketServer;
+using Microsoft.Extensions.Logging;
 
 namespace WIDESEAWCS_Tasks
 {
@@ -25,15 +26,18 @@
         private readonly IRobotMessageRouter _messageRouter;
         private readonly RobotTaskProcessor _taskProcessor;
         private readonly IRobotWorkflowOrchestrator _workflowOrchestrator;
+        private readonly ILogger<RobotJob> _logger;
 
         public RobotJob(
             TcpSocketServer tcpSocket,
             IRobotTaskService robotTaskService,
             ITaskService taskService,
             ICacheService cache,
-            HttpClientHelper httpClientHelper)
+            HttpClientHelper httpClientHelper,
+            ILogger<RobotJob> logger)
         {
             _stateManager = new RobotStateManager(cache);
+            _logger = logger;
 
             // 鏀跺彛 Socket 璁块棶锛屽悗缁嫢鏇挎崲閫氫俊瀹炵幇鍙渶鏇挎崲缃戝叧灞傘��
             ISocketClientGateway socketGateway = new SocketClientGateway(tcpSocket);
@@ -43,7 +47,7 @@
 
             var simpleCommandHandler = new RobotSimpleCommandHandler(_taskProcessor);
             var prefixCommandHandler = new RobotPrefixCommandHandler(robotTaskService, _taskProcessor, _stateManager, socketGateway);
-            _messageRouter = new RobotMessageHandler(socketGateway, _stateManager, cache, simpleCommandHandler, prefixCommandHandler);
+            _messageRouter = new RobotMessageHandler(socketGateway, _stateManager, cache, simpleCommandHandler, prefixCommandHandler, logger);
 
             _workflowOrchestrator = new RobotWorkflowOrchestrator(_stateManager, _clientManager, _taskProcessor, robotTaskService);
 

--
Gitblit v1.9.3