From 059bfb279d7bb7a45b1a9d3d5e26db238e939a7f Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期三, 15 一月 2025 13:37:47 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs | 31 +++++++++++++++++++++++++++++--
1 files changed, 29 insertions(+), 2 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs"
index 9ed8a34..739828f 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs"
@@ -1,4 +1,5 @@
-锘縰sing Microsoft.AspNetCore.Authorization;
+锘縰sing HslCommunication.WebSocket;
+using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WIDESEAWCS_Core;
@@ -6,6 +7,7 @@
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
+using WIDESEAWCS_Tasks;
namespace WIDESEAWCS_WCSServer.Controllers.Task
{
@@ -14,9 +16,14 @@
public class TaskController : ApiBaseController<ITaskService, Dt_Task>
{
private readonly IHttpContextAccessor _httpContextAccessor;
- public TaskController(ITaskService service, IHttpContextAccessor httpContextAccessor) : base(service)
+ private readonly IRouterExtension _routerExtension;
+ private readonly WebSocketServer _webSocketServer;
+
+ public TaskController(ITaskService service, IHttpContextAccessor httpContextAccessor, IRouterExtension routerExtension, WebSocketServer webSocketServer) : base(service)
{
_httpContextAccessor = httpContextAccessor;
+ _routerExtension = routerExtension;
+ _webSocketServer = webSocketServer;
}
[HttpPost, Route("ReceiveTask"), AllowAnonymous]
@@ -65,5 +72,25 @@
{
return Service.SendSecureReplyToAgv(taskNum);
}
+
+ [HttpPost, HttpGet, Route("GetRouteEndPoint"), AllowAnonymous]
+ public WebResponseContent GetRouteEndPoint(string startPoint, int routeType)
+ {
+ return WebResponseContent.Instance.OK(data: _routerExtension.GetEndPoint(startPoint, routeType));
+ }
+
+ [HttpPost, HttpGet, Route("WebSocketPushMessage"), AllowAnonymous]
+ public WebResponseContent WebSocketPushMessage(string message)
+ {
+ try
+ {
+ _webSocketServer.PublishAllClientPayload(message);
+ return WebResponseContent.Instance.OK();
+ }
+ catch(Exception ex)
+ {
+ return WebResponseContent.Instance.Error(ex.Message);
+ }
+ }
}
}
--
Gitblit v1.9.3