From 59634efa318616cef046d543091529d59575167b Mon Sep 17 00:00:00 2001 From: quowingwang Date: Tue, 20 Jan 2026 16:11:20 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E5=B7=A5=E8=89=BA=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/PlcProductionDataController.cs | 3 ++- RIZO.Admin.WebApi/Program.cs | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/RIZO.Admin.WebApi/PLC/Controllers/PlcProductionDataController.cs b/RIZO.Admin.WebApi/PLC/Controllers/PlcProductionDataController.cs index b05334d..cf671d2 100644 --- a/RIZO.Admin.WebApi/PLC/Controllers/PlcProductionDataController.cs +++ b/RIZO.Admin.WebApi/PLC/Controllers/PlcProductionDataController.cs @@ -8,7 +8,8 @@ namespace RIZO.Admin.WebApi.PLC.Controllers /// /// 产线PLC生产参数数据表 /// - [Route("mes/PlcProductionData")] + [Route("plc/PlcProductionData")] + [AllowAnonymous] public class PlcProductionDataController : BaseController { /// diff --git a/RIZO.Admin.WebApi/Program.cs b/RIZO.Admin.WebApi/Program.cs index e5fbc27..4fd5b22 100644 --- a/RIZO.Admin.WebApi/Program.cs +++ b/RIZO.Admin.WebApi/Program.cs @@ -1,22 +1,23 @@ using AspNetCoreRateLimit; using Infrastructure.Converter; +using MDM; using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.Localization; using NLog.Web; -using SqlSugar; -using System.Globalization; -using System.Text.Json; using RIZO.Admin.WebApi.Extensions; +using RIZO.Admin.WebApi.PLC; +using RIZO.Admin.WebApi.PLC.Model; +using RIZO.Admin.WebApi.PLC.Service; +using RIZO.Admin.WebApi.PLC.Service.IService; using RIZO.Common.Cache; using RIZO.Common.DynamicApiSimple.Extens; using RIZO.Infrastructure.WebExtensions; +using RIZO.Mall; using RIZO.ServiceCore.Signalr; using RIZO.ServiceCore.SqlSugar; -using RIZO.Mall; -using RIZO.Admin.WebApi.PLC; -using MDM; -using RIZO.Admin.WebApi.PLC.Model; -using RIZO.Admin.WebApi.PLC.Service; +using SqlSugar; +using System.Globalization; +using System.Text.Json; //using SQLitePCL; var builder = WebApplication.CreateBuilder(args); @@ -32,6 +33,7 @@ builder.Services.AddControllers(); builder.Services.Configure>(builder.Configuration.GetSection("PlcConfigs")); builder.Services.Configure(builder.Configuration.GetSection("GlobalPlcConfig")); builder.Services.AddSingleton(); +builder.Services.AddScoped(); // 新增:注册PLC后台监听服务(项目启动自动执行) //builder.Services.AddHostedService(); // ==========================