From 5bbb8e206ae8328a5e1233eb43ed4ecb2a02a98e Mon Sep 17 00:00:00 2001
From: yangpeixing <yangpeixing@hnkhzn.com>
Date: 星期二, 25 十一月 2025 11:06:46 +0800
Subject: [PATCH] 1

---
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs |   33 +++++++++++++++++++++------------
 1 files changed, 21 insertions(+), 12 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs"
index 585b845..fae4d26 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs"
@@ -1,21 +1,27 @@
-using WIDESEA_Core.Helper;
-using WIDESEA_Core.Extensions;
-using WIDESEA_Core.Middlewares;
-using System.Reflection;
-using WIDESEA_Core.Filter;
-using Newtonsoft.Json.Converters;
-using Newtonsoft.Json;
-using System.Text;
+using Autofac;
+using Autofac.Extensions.DependencyInjection;
 using Microsoft.AspNetCore.Mvc.Controllers;
 using Microsoft.Extensions.DependencyInjection.Extensions;
-using Autofac.Extensions.DependencyInjection;
-using Autofac;
-using WIDESEA_WMSServer.Filter;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+using System.Reflection;
+using System.Text;
 using WIDESEA_Core.Core;
+using WIDESEA_Core.Extensions;
+using WIDESEA_Core.Filter;
+using WIDESEA_Core.Helper;
+using WIDESEA_Core.Middlewares;
 using WIDESEA_StorageTaskServices;
+using WIDESEA_WMSServer.Filter;
+using WIDESEAWCS_Server.HostedService;
 
 var builder = WebApplication.CreateBuilder(args);
-
+if (!HslCommunication.Authorization.SetAuthorizationCode("95f1611d-633c-46ea-b03a-38ede1629f74"))
+{
+    ConsoleHelper.WriteErrorLine("授权失败!当前程序只能使用24小时!");
+}
+else
+    ConsoleHelper.WriteSuccessLine("授权成功!");
 builder.Host.UseServiceProviderFactory(new AutofacServiceProviderFactory()).ConfigureContainer<ContainerBuilder>(builder =>
 {
     builder.RegisterModule(new AutofacModuleRegister());//带有接口层的服务注入
@@ -48,6 +54,9 @@
 
 builder.Services.AddHttpContextSetup();
 
+ConsoleHelper.WriteSuccessLine("注册WebSocket");
+builder.Services.AddWebSocketSetup();
+
 builder.Services.AddMvc(options =>
 {
     options.Filters.Add(typeof(ApiAuthorizeFilter));

--
Gitblit v1.9.3