yanjinhui
2025-03-11 cdd170dd9008d8124d63c76ba186e34cfe61a619
ÏîÄ¿´úÂë/WIDESEAWCS_Server Õýʽ/WIDESEAWCS_Server/Program.cs
@@ -21,7 +21,7 @@
using Autofac.Core;
using WIDESEAWCS_QuartzJob.QuartzExtensions;
using Microsoft.AspNetCore.Builder;
using WIDESEA_SerialPortService;
//using WIDESEA_SerialPortService;
using WIDESEA_ISerialPortService;
var builder = WebApplication.CreateBuilder(args);
@@ -81,8 +81,8 @@
//builder.Services.AddSingleton<SerialPortTestService>(sp =>
//    new SerialPortTestService("COM3")); // è¿™é‡Œå¯ä»¥ä¼ å…¥ä¸²å£å·
// æ³¨å†Œ ISerialPortService å®žçް
builder.Services.AddSingleton<ISerialPortService, SerialPortService>();
//// æ³¨å†Œ ISerialPortService å®žçް
//builder.Services.AddSingleton<ISerialPortService, SerialPortService>();
// æ³¨å†Œ SerialPortTestService,并注入 ISerialPortService
//builder.Services.AddSingleton<SerialPortTestJob>(sp =>
@@ -129,7 +129,7 @@
//if (app.Environment.IsDevelopment())
{
    //todo
    //app.UseSwaggerAuthorized();
    app.UseSwaggerAuthorized();
    app.UseSwaggerMiddle(() => Assembly.GetExecutingAssembly().GetManifestResourceStream("WIDESEAWCS_Server.index.html"));
}//判断是否需要打开swagger