From e4414fe44b568a3d34e8a0c177c319d672d01b60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=20=E9=AB=98?= <1260824032@qq.com> Date: Wed, 29 Oct 2025 11:28:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin.NET.Core/Option/MqttOptions.cs | 84 +++++++++---------- .../Service/Mqtt/SysMqttService.cs | 12 +-- .../OpenAccess/Dto/GenerateSignatureOutput.cs | 38 ++++----- .../Service/Print/SysPrintService.cs | 42 +++++----- 4 files changed, 88 insertions(+), 88 deletions(-) diff --git a/Admin.NET/Admin.NET.Core/Option/MqttOptions.cs b/Admin.NET/Admin.NET.Core/Option/MqttOptions.cs index 873a5d6a..011d9d13 100644 --- a/Admin.NET/Admin.NET.Core/Option/MqttOptions.cs +++ b/Admin.NET/Admin.NET.Core/Option/MqttOptions.cs @@ -1,43 +1,43 @@ -// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 -// -// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 -// -// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - -namespace Admin.NET.Core; - -/// -/// MQTT 配置选项 -/// -public sealed class MqttOptions : IConfigurableOptions -{ - /// - /// 是否启用 - /// - public bool Enabled { get; set; } - - /// - /// 端口 - /// - public int Port { get; set; } - - /// - /// IP地址 - /// - public string IPAddress { get; set; } - - /// - /// 最大连接数 - /// - public int ConnectionBacklog { get; set; } - - /// - /// 服务器主动发消息时的ClientId - /// - public string MqttServerId { get; set; } - - /// - /// 输出日志 - /// - public bool Logging { get; set; } +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core; + +/// +/// MQTT 配置选项 +/// +public sealed class MqttOptions : IConfigurableOptions +{ + /// + /// 是否启用 + /// + public bool Enabled { get; set; } + + /// + /// 端口 + /// + public int Port { get; set; } + + /// + /// IP地址 + /// + public string IPAddress { get; set; } + + /// + /// 最大连接数 + /// + public int ConnectionBacklog { get; set; } + + /// + /// 服务器主动发消息时的ClientId + /// + public string MqttServerId { get; set; } + + /// + /// 输出日志 + /// + public bool Logging { get; set; } } \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Service/Mqtt/SysMqttService.cs b/Admin.NET/Admin.NET.Core/Service/Mqtt/SysMqttService.cs index bde16576..18805181 100644 --- a/Admin.NET/Admin.NET.Core/Service/Mqtt/SysMqttService.cs +++ b/Admin.NET/Admin.NET.Core/Service/Mqtt/SysMqttService.cs @@ -18,23 +18,23 @@ public class SysMqttService() : IDynamicApiController, ITransient /// 获取客户端列表 🔖 /// /// - [DisplayName("获取客户端列表")] + [DisplayName("获取客户端列表")] public async Task> GetClients() { if (MqttHostedService.MqttServer == null) throw Oops.Oh("【MQTT】服务未启动"); return await MqttHostedService.MqttServer.GetClientsAsync(); - } - + } + /// /// 发布主题消息 🔖 /// /// - /// - [DisplayName("发布主题消息")] + /// + [DisplayName("发布主题消息")] public async Task PublicMessage(PublicMessageInput input) - { + { var mqttHostedService = App.GetRequiredService(); await mqttHostedService.PublicMessageAsync(input.Topic, input.Message); } diff --git a/Admin.NET/Admin.NET.Core/Service/OpenAccess/Dto/GenerateSignatureOutput.cs b/Admin.NET/Admin.NET.Core/Service/OpenAccess/Dto/GenerateSignatureOutput.cs index 80881316..262047bd 100644 --- a/Admin.NET/Admin.NET.Core/Service/OpenAccess/Dto/GenerateSignatureOutput.cs +++ b/Admin.NET/Admin.NET.Core/Service/OpenAccess/Dto/GenerateSignatureOutput.cs @@ -1,20 +1,20 @@ -// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 -// -// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 -// -// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - -namespace Admin.NET.Core.Service; - -public class GenerateSignatureOutput -{ - /// - /// 时间戳 - /// - public long Timestamp { get; set; } - - /// - /// 签名 - /// - public string Signature { get; set; } +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core.Service; + +public class GenerateSignatureOutput +{ + /// + /// 时间戳 + /// + public long Timestamp { get; set; } + + /// + /// 签名 + /// + public string Signature { get; set; } } \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Service/Print/SysPrintService.cs b/Admin.NET/Admin.NET.Core/Service/Print/SysPrintService.cs index 3f5a2b4a..8e223395 100644 --- a/Admin.NET/Admin.NET.Core/Service/Print/SysPrintService.cs +++ b/Admin.NET/Admin.NET.Core/Service/Print/SysPrintService.cs @@ -24,7 +24,7 @@ public class SysPrintService : IDynamicApiController, ITransient /// /// /// - [DisplayName("获取打印模板列表")] + [DisplayName("获取打印模板列表")] public async Task> Page(PagePrintInput input) { return await _sysPrintRep.AsQueryable() @@ -38,7 +38,7 @@ public class SysPrintService : IDynamicApiController, ITransient /// /// /// - [DisplayName("获取打印模板")] + [DisplayName("获取打印模板")] public async Task GetPrint(string name) { return await _sysPrintRep.GetFirstAsync(u => u.Name == name); @@ -50,7 +50,7 @@ public class SysPrintService : IDynamicApiController, ITransient /// /// [ApiDescriptionSettings(Name = "Add"), HttpPost] - [DisplayName("增加打印模板")] + [DisplayName("增加打印模板")] public async Task AddPrint(AddPrintInput input) { var isExist = await _sysPrintRep.IsAnyAsync(u => u.Name == input.Name); @@ -65,7 +65,7 @@ public class SysPrintService : IDynamicApiController, ITransient /// /// [ApiDescriptionSettings(Name = "Update"), HttpPost] - [DisplayName("更新打印模板")] + [DisplayName("更新打印模板")] public async Task UpdatePrint(UpdatePrintInput input) { var isExist = await _sysPrintRep.IsAnyAsync(u => u.Name == input.Name && u.Id != input.Id); @@ -73,23 +73,23 @@ public class SysPrintService : IDynamicApiController, ITransient await _sysPrintRep.AsUpdateable(input.Adapt()).IgnoreColumns(true).ExecuteCommandAsync(); } - - /// - /// 复制打印模板 🖨️ - /// - /// - /// + + /// + /// 复制打印模板 🖨️ + /// + /// + /// [ApiDescriptionSettings(Name = "Copy"), HttpPost] - [DisplayName("复制打印模板")] - public async Task CopyPrint(DeletePrintInput input) - { - var print = await _sysPrintRep.AsQueryable().Where(u => u.Id == input.Id).FirstAsync(); - if (print == null) - throw Oops.Bah("模板不存在"); - print.Name = print.Name + "_Copy_" + DateTime.Now.ToString("ddHHmmss"); - print.Id = 0; - await AddPrint(print.Adapt()); - } + [DisplayName("复制打印模板")] + public async Task CopyPrint(DeletePrintInput input) + { + var print = await _sysPrintRep.AsQueryable().Where(u => u.Id == input.Id).FirstAsync(); + if (print == null) + throw Oops.Bah("模板不存在"); + print.Name = print.Name + "_Copy_" + DateTime.Now.ToString("ddHHmmss"); + print.Id = 0; + await AddPrint(print.Adapt()); + } /// /// 删除打印模板 🖨️ @@ -97,7 +97,7 @@ public class SysPrintService : IDynamicApiController, ITransient /// /// [ApiDescriptionSettings(Name = "Delete"), HttpPost] - [DisplayName("删除打印模板")] + [DisplayName("删除打印模板")] public async Task DeletePrint(DeletePrintInput input) { await _sysPrintRep.DeleteByIdAsync(input.Id);