测序
This commit is contained in:
parent
6cb45cff7c
commit
e4414fe44b
@ -1,43 +1,43 @@
|
|||||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||||
//
|
//
|
||||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||||
//
|
//
|
||||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||||
|
|
||||||
namespace Admin.NET.Core;
|
namespace Admin.NET.Core;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// MQTT 配置选项
|
/// MQTT 配置选项
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class MqttOptions : IConfigurableOptions
|
public sealed class MqttOptions : IConfigurableOptions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否启用
|
/// 是否启用
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool Enabled { get; set; }
|
public bool Enabled { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 端口
|
/// 端口
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Port { get; set; }
|
public int Port { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// IP地址
|
/// IP地址
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string IPAddress { get; set; }
|
public string IPAddress { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 最大连接数
|
/// 最大连接数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int ConnectionBacklog { get; set; }
|
public int ConnectionBacklog { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 服务器主动发消息时的ClientId
|
/// 服务器主动发消息时的ClientId
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string MqttServerId { get; set; }
|
public string MqttServerId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 输出日志
|
/// 输出日志
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool Logging { get; set; }
|
public bool Logging { get; set; }
|
||||||
}
|
}
|
||||||
@ -18,23 +18,23 @@ public class SysMqttService() : IDynamicApiController, ITransient
|
|||||||
/// 获取客户端列表 🔖
|
/// 获取客户端列表 🔖
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[DisplayName("获取客户端列表")]
|
[DisplayName("获取客户端列表")]
|
||||||
public async Task<IList<MqttClientStatus>> GetClients()
|
public async Task<IList<MqttClientStatus>> GetClients()
|
||||||
{
|
{
|
||||||
if (MqttHostedService.MqttServer == null)
|
if (MqttHostedService.MqttServer == null)
|
||||||
throw Oops.Oh("【MQTT】服务未启动");
|
throw Oops.Oh("【MQTT】服务未启动");
|
||||||
|
|
||||||
return await MqttHostedService.MqttServer.GetClientsAsync();
|
return await MqttHostedService.MqttServer.GetClientsAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 发布主题消息 🔖
|
/// 发布主题消息 🔖
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[DisplayName("发布主题消息")]
|
[DisplayName("发布主题消息")]
|
||||||
public async Task PublicMessage(PublicMessageInput input)
|
public async Task PublicMessage(PublicMessageInput input)
|
||||||
{
|
{
|
||||||
var mqttHostedService = App.GetRequiredService<MqttHostedService>();
|
var mqttHostedService = App.GetRequiredService<MqttHostedService>();
|
||||||
await mqttHostedService.PublicMessageAsync(input.Topic, input.Message);
|
await mqttHostedService.PublicMessageAsync(input.Topic, input.Message);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,20 +1,20 @@
|
|||||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||||
//
|
//
|
||||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||||
//
|
//
|
||||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||||
|
|
||||||
namespace Admin.NET.Core.Service;
|
namespace Admin.NET.Core.Service;
|
||||||
|
|
||||||
public class GenerateSignatureOutput
|
public class GenerateSignatureOutput
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 时间戳
|
/// 时间戳
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public long Timestamp { get; set; }
|
public long Timestamp { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 签名
|
/// 签名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Signature { get; set; }
|
public string Signature { get; set; }
|
||||||
}
|
}
|
||||||
@ -24,7 +24,7 @@ public class SysPrintService : IDynamicApiController, ITransient
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[DisplayName("获取打印模板列表")]
|
[DisplayName("获取打印模板列表")]
|
||||||
public async Task<SqlSugarPagedList<SysPrint>> Page(PagePrintInput input)
|
public async Task<SqlSugarPagedList<SysPrint>> Page(PagePrintInput input)
|
||||||
{
|
{
|
||||||
return await _sysPrintRep.AsQueryable()
|
return await _sysPrintRep.AsQueryable()
|
||||||
@ -38,7 +38,7 @@ public class SysPrintService : IDynamicApiController, ITransient
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="name"></param>
|
/// <param name="name"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[DisplayName("获取打印模板")]
|
[DisplayName("获取打印模板")]
|
||||||
public async Task<SysPrint> GetPrint(string name)
|
public async Task<SysPrint> GetPrint(string name)
|
||||||
{
|
{
|
||||||
return await _sysPrintRep.GetFirstAsync(u => u.Name == name);
|
return await _sysPrintRep.GetFirstAsync(u => u.Name == name);
|
||||||
@ -50,7 +50,7 @@ public class SysPrintService : IDynamicApiController, ITransient
|
|||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[ApiDescriptionSettings(Name = "Add"), HttpPost]
|
[ApiDescriptionSettings(Name = "Add"), HttpPost]
|
||||||
[DisplayName("增加打印模板")]
|
[DisplayName("增加打印模板")]
|
||||||
public async Task AddPrint(AddPrintInput input)
|
public async Task AddPrint(AddPrintInput input)
|
||||||
{
|
{
|
||||||
var isExist = await _sysPrintRep.IsAnyAsync(u => u.Name == input.Name);
|
var isExist = await _sysPrintRep.IsAnyAsync(u => u.Name == input.Name);
|
||||||
@ -65,7 +65,7 @@ public class SysPrintService : IDynamicApiController, ITransient
|
|||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[ApiDescriptionSettings(Name = "Update"), HttpPost]
|
[ApiDescriptionSettings(Name = "Update"), HttpPost]
|
||||||
[DisplayName("更新打印模板")]
|
[DisplayName("更新打印模板")]
|
||||||
public async Task UpdatePrint(UpdatePrintInput input)
|
public async Task UpdatePrint(UpdatePrintInput input)
|
||||||
{
|
{
|
||||||
var isExist = await _sysPrintRep.IsAnyAsync(u => u.Name == input.Name && u.Id != input.Id);
|
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<SysPrint>()).IgnoreColumns(true).ExecuteCommandAsync();
|
await _sysPrintRep.AsUpdateable(input.Adapt<SysPrint>()).IgnoreColumns(true).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 复制打印模板 🖨️
|
/// 复制打印模板 🖨️
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[ApiDescriptionSettings(Name = "Copy"), HttpPost]
|
[ApiDescriptionSettings(Name = "Copy"), HttpPost]
|
||||||
[DisplayName("复制打印模板")]
|
[DisplayName("复制打印模板")]
|
||||||
public async Task CopyPrint(DeletePrintInput input)
|
public async Task CopyPrint(DeletePrintInput input)
|
||||||
{
|
{
|
||||||
var print = await _sysPrintRep.AsQueryable().Where(u => u.Id == input.Id).FirstAsync();
|
var print = await _sysPrintRep.AsQueryable().Where(u => u.Id == input.Id).FirstAsync();
|
||||||
if (print == null)
|
if (print == null)
|
||||||
throw Oops.Bah("模板不存在");
|
throw Oops.Bah("模板不存在");
|
||||||
print.Name = print.Name + "_Copy_" + DateTime.Now.ToString("ddHHmmss");
|
print.Name = print.Name + "_Copy_" + DateTime.Now.ToString("ddHHmmss");
|
||||||
print.Id = 0;
|
print.Id = 0;
|
||||||
await AddPrint(print.Adapt<AddPrintInput>());
|
await AddPrint(print.Adapt<AddPrintInput>());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 删除打印模板 🖨️
|
/// 删除打印模板 🖨️
|
||||||
@ -97,7 +97,7 @@ public class SysPrintService : IDynamicApiController, ITransient
|
|||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[ApiDescriptionSettings(Name = "Delete"), HttpPost]
|
[ApiDescriptionSettings(Name = "Delete"), HttpPost]
|
||||||
[DisplayName("删除打印模板")]
|
[DisplayName("删除打印模板")]
|
||||||
public async Task DeletePrint(DeletePrintInput input)
|
public async Task DeletePrint(DeletePrintInput input)
|
||||||
{
|
{
|
||||||
await _sysPrintRep.DeleteByIdAsync(input.Id);
|
await _sysPrintRep.DeleteByIdAsync(input.Id);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user