😎1、优化MQTT相关 2、升级依赖
This commit is contained in:
parent
7e1cdeaffa
commit
1358cd397d
@ -3,12 +3,11 @@
|
||||
|
||||
// MQTT 配置
|
||||
"Mqtt": {
|
||||
"MqttServerId": "MqttServer", // 服务器主动发布时用的ClientId
|
||||
"Enabled": true, // 是否开启
|
||||
"Logging": true, // 记录文件日志
|
||||
"ConsoleOutput": true, // 输出控制台日志
|
||||
"ConnectionBacklog": 1000,
|
||||
"Port": "1883",
|
||||
"IPAddress": ""
|
||||
"Enabled": false, // 是否开启
|
||||
"Port": "1883", // 端口
|
||||
"IPAddress": "", // IP地址
|
||||
"ConnectionBacklog": 1000, // 最大连接数
|
||||
"MqttServerId": "Admin.NET.MQTT", // 服务器主动发消息时的ClientId
|
||||
"Logging": false // 记录日志
|
||||
}
|
||||
}
|
||||
@ -14,20 +14,20 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AlibabaCloud.SDK.Dysmsapi20170525" Version="3.1.1" />
|
||||
<PackageReference Include="AlipaySDKNet.Standard" Version="4.9.409" />
|
||||
<PackageReference Include="AlipaySDKNet.Standard" Version="4.9.412" />
|
||||
<PackageReference Include="AngleSharp" Version="1.2.0" />
|
||||
<PackageReference Include="AspectCore.Extensions.Reflection" Version="2.4.0" />
|
||||
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
|
||||
<PackageReference Include="BouncyCastle.Cryptography" Version="2.5.1" Aliases="BouncyCastleV2" />
|
||||
<PackageReference Include="Elastic.Clients.Elasticsearch" Version="8.17.1" />
|
||||
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.7.9" />
|
||||
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.7.9" />
|
||||
<PackageReference Include="Furion.Pure" Version="4.9.7.9" />
|
||||
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.7.10" />
|
||||
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.7.10" />
|
||||
<PackageReference Include="Furion.Pure" Version="4.9.7.10" />
|
||||
<PackageReference Include="Hardware.Info" Version="101.0.1" />
|
||||
<PackageReference Include="Hashids.net" Version="1.7.0" />
|
||||
<PackageReference Include="IPTools.China" Version="1.6.0" />
|
||||
<PackageReference Include="IPTools.International" Version="1.6.0" />
|
||||
<PackageReference Include="log4net" Version="3.0.3" />
|
||||
<PackageReference Include="log4net" Version="3.0.4" />
|
||||
<PackageReference Include="Magicodes.IE.Excel" Version="2.7.5.2" />
|
||||
<PackageReference Include="Magicodes.IE.Pdf" Version="2.7.5.2" />
|
||||
<PackageReference Include="Magicodes.IE.Word" Version="2.7.5.2" />
|
||||
@ -48,7 +48,7 @@
|
||||
<PackageReference Include="SSH.NET" Version="2024.2.0" />
|
||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.6.0.2" />
|
||||
<PackageReference Include="System.Net.Http" Version="4.3.4" />
|
||||
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1182" />
|
||||
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1184" />
|
||||
<PackageReference Include="UAParser" Version="3.1.47" />
|
||||
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
|
||||
</ItemGroup>
|
||||
|
||||
@ -6,7 +6,6 @@
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
using Furion.Logging.Extensions;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using MQTTnet;
|
||||
using MQTTnet.Protocol;
|
||||
@ -19,45 +18,30 @@ using System.Threading.Tasks;
|
||||
/// <summary>
|
||||
/// MQTT 服务
|
||||
/// </summary>
|
||||
public class MqttHostedService(IOptions<MqttOptions> mqttOptions, ISqlSugarClient db) : IHostedService, ISingleton
|
||||
public class MqttHostedService(IOptions<MqttOptions> mqttOptions) : IHostedService, ISingleton
|
||||
{
|
||||
private const string ServerClientId = "Admin.NET.MQTT";
|
||||
public static MqttServer MqttServer { get; set; }
|
||||
private readonly MqttOptions _mqttOptions = mqttOptions.Value;
|
||||
private readonly ISqlSugarClient _db = db;
|
||||
private bool _isLogging = false;
|
||||
private bool _consoleOutput = false;
|
||||
public static MqttServer MqttServer { get; set; }
|
||||
public static readonly List<MqttEventInterceptor> MqttEventInterceptors = []; // MQTT 事件拦截器集合
|
||||
|
||||
static List<MqttEventHandler> mqttEventHandlers = new List<MqttEventHandler>();
|
||||
|
||||
public static void RegistMqttEventHandler(MqttEventHandler eh, int order)
|
||||
/// <summary>
|
||||
/// 注册 MQTT 事件拦截器
|
||||
/// </summary>
|
||||
/// <param name="mqttEventInterceptor"></param>
|
||||
/// <param name="order"></param>
|
||||
public static void AddMqttEventInterceptor(MqttEventInterceptor mqttEventInterceptor, int order = 0)
|
||||
{
|
||||
eh.Order = order;
|
||||
mqttEventHandlers.Add(eh);
|
||||
mqttEventHandlers.Sort((a,b) => b.Order - a.Order);
|
||||
}
|
||||
|
||||
public async void PublicMessage(string topic, string message)
|
||||
{
|
||||
// 创建一个 MQTT 应用消息
|
||||
var applicationMessage = new MqttApplicationMessageBuilder()
|
||||
.WithTopic(topic)
|
||||
.WithPayload(message)
|
||||
.Build();
|
||||
|
||||
// 记录日志
|
||||
Log($"服务器发布主题: {topic}, 内容:{message}");
|
||||
await MqttServer.InjectApplicationMessage(new InjectedMqttApplicationMessage(applicationMessage)
|
||||
{
|
||||
SenderClientId = _mqttOptions.MqttServerId
|
||||
});
|
||||
mqttEventInterceptor.Order = order;
|
||||
MqttEventInterceptors.Add(mqttEventInterceptor);
|
||||
MqttEventInterceptors.Sort((a, b) => b.Order - a.Order);
|
||||
}
|
||||
|
||||
public async Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
if (!_mqttOptions.Enabled) return;
|
||||
_isLogging = _mqttOptions.Logging;
|
||||
_consoleOutput = _mqttOptions.ConsoleOutput;
|
||||
|
||||
// 注册 MQTT 自定义客户端验证事件拦截器
|
||||
AddMqttEventInterceptor(new DefaultMqttEventInterceptor());
|
||||
|
||||
var options = new MqttServerOptionsBuilder()
|
||||
.WithDefaultEndpoint() // 默认地址127.0.0.1
|
||||
@ -102,7 +86,7 @@ public class MqttHostedService(IOptions<MqttOptions> mqttOptions, ISqlSugarClien
|
||||
private async Task MqttServer_StoppedAsync(EventArgs arg)
|
||||
{
|
||||
Console.WriteLine($"【MQTT】服务已关闭...... {DateTime.Now}");
|
||||
foreach (var eh in mqttEventHandlers)
|
||||
foreach (var eh in MqttEventInterceptors)
|
||||
{
|
||||
await eh.StoppedAsync(arg);
|
||||
}
|
||||
@ -115,7 +99,7 @@ public class MqttHostedService(IOptions<MqttOptions> mqttOptions, ISqlSugarClien
|
||||
/// <returns></returns>
|
||||
private async Task MqttServer_ValidatingConnectionAsync(ValidatingConnectionEventArgs arg)
|
||||
{
|
||||
foreach (var eh in mqttEventHandlers)
|
||||
foreach (var eh in MqttEventInterceptors)
|
||||
{
|
||||
await eh.ValidatingConnectionAsync(arg);
|
||||
if (arg.ReasonCode != MqttConnectReasonCode.Success)
|
||||
@ -130,11 +114,12 @@ public class MqttHostedService(IOptions<MqttOptions> mqttOptions, ISqlSugarClien
|
||||
/// <returns></returns>
|
||||
private async Task MqttServer_ClientConnectedAsync(ClientConnectedEventArgs arg)
|
||||
{
|
||||
Log($"客户端连接:客户端ID=【{arg.ClientId}】已连接:用户名=【{arg.UserName}】地址=【{arg.RemoteEndPoint}】 {DateTime.Now}");
|
||||
foreach (var eh in mqttEventHandlers)
|
||||
foreach (var eh in MqttEventInterceptors)
|
||||
{
|
||||
await eh.ClientConnectedAsync(arg);
|
||||
}
|
||||
|
||||
Logging($"客户端连接:客户端ID=【{arg.ClientId}】已连接:用户名=【{arg.UserName}】地址=【{arg.RemoteEndPoint}】 {DateTime.Now}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -145,11 +130,12 @@ public class MqttHostedService(IOptions<MqttOptions> mqttOptions, ISqlSugarClien
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
private async Task MqttServer_ClientDisconnectedAsync(ClientDisconnectedEventArgs arg)
|
||||
{
|
||||
Log($"客户端断开:客户端ID=【{arg.ClientId}】已断开:用户名=【{arg.UserName}】地址=【{arg.RemoteEndPoint}】 {DateTime.Now}");
|
||||
foreach (var eh in mqttEventHandlers)
|
||||
foreach (var eh in MqttEventInterceptors)
|
||||
{
|
||||
await eh.ClientDisconnectedAsync(arg);
|
||||
}
|
||||
|
||||
Logging($"客户端断开:客户端ID=【{arg.ClientId}】已断开:用户名=【{arg.UserName}】地址=【{arg.RemoteEndPoint}】 {DateTime.Now}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -159,11 +145,12 @@ public class MqttHostedService(IOptions<MqttOptions> mqttOptions, ISqlSugarClien
|
||||
/// <returns></returns>
|
||||
private async Task MqttServer_ClientSubscribedTopicAsync(ClientSubscribedTopicEventArgs arg)
|
||||
{
|
||||
Log($"订阅主题:客户端ID=【{arg.ClientId}】订阅主题=【{arg.TopicFilter}】 {DateTime.Now}");
|
||||
foreach (var eh in mqttEventHandlers)
|
||||
foreach (var eh in MqttEventInterceptors)
|
||||
{
|
||||
await eh.ClientSubscribedTopicAsync(arg);
|
||||
}
|
||||
|
||||
Logging($"订阅主题:客户端ID=【{arg.ClientId}】订阅主题=【{arg.TopicFilter}】 {DateTime.Now}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -173,15 +160,16 @@ public class MqttHostedService(IOptions<MqttOptions> mqttOptions, ISqlSugarClien
|
||||
/// <returns></returns>
|
||||
private async Task MqttServer_ClientUnsubscribedTopicAsync(ClientUnsubscribedTopicEventArgs arg)
|
||||
{
|
||||
Log($"取消订阅:客户端ID=【{arg.ClientId}】取消订阅主题=【{arg.TopicFilter}】 {DateTime.Now}");
|
||||
foreach (var eh in mqttEventHandlers)
|
||||
foreach (var eh in MqttEventInterceptors)
|
||||
{
|
||||
await eh.ClientUnsubscribedTopicAsync(arg);
|
||||
}
|
||||
|
||||
Logging($"取消订阅:客户端ID=【{arg.ClientId}】取消订阅主题=【{arg.TopicFilter}】 {DateTime.Now}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 拦截接收消息
|
||||
/// 拦截发布的消息事件
|
||||
/// </summary>
|
||||
/// <param name="arg"></param>
|
||||
/// <returns></returns>
|
||||
@ -190,25 +178,48 @@ public class MqttHostedService(IOptions<MqttOptions> mqttOptions, ISqlSugarClien
|
||||
if (string.Equals(arg.ClientId, _mqttOptions.MqttServerId))
|
||||
return;
|
||||
|
||||
Log($"拦截消息:客户端ID=【{arg.ClientId}】 Topic主题=【{arg.ApplicationMessage.Topic}】 消息=【{Encoding.UTF8.GetString(arg.ApplicationMessage.Payload)}】 qos等级=【{arg.ApplicationMessage.QualityOfServiceLevel}】 {DateTime.Now}");
|
||||
foreach (var eh in mqttEventHandlers)
|
||||
foreach (var eh in MqttEventInterceptors)
|
||||
{
|
||||
await eh.InterceptingPublishAsync(arg);
|
||||
}
|
||||
|
||||
Logging($"拦截消息:客户端ID=【{arg.ClientId}】 Topic主题=【{arg.ApplicationMessage.Topic}】 消息=【{Encoding.UTF8.GetString(arg.ApplicationMessage.Payload)}】 qos等级=【{arg.ApplicationMessage.QualityOfServiceLevel}】 {DateTime.Now}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 消息未被消费
|
||||
/// 未被消费的消息事件
|
||||
/// </summary>
|
||||
/// <param name="arg"></param>
|
||||
/// <returns></returns>
|
||||
private async Task MqttServer_ApplicationMessageNotConsumedAsync(ApplicationMessageNotConsumedEventArgs arg)
|
||||
{
|
||||
Console.WriteLine($"接收消息:发送端ID=【{arg.SenderId}】 Topic主题=【{arg.ApplicationMessage.Topic}】 消息=【{Encoding.UTF8.GetString(arg.ApplicationMessage.Payload)}】 qos等级=【{arg.ApplicationMessage.QualityOfServiceLevel}】 {DateTime.Now}");
|
||||
foreach (var eh in mqttEventHandlers)
|
||||
foreach (var eh in MqttEventInterceptors)
|
||||
{
|
||||
await eh.ApplicationMessageNotConsumedAsync(arg);
|
||||
}
|
||||
|
||||
Logging($"接收消息:发送端ID=【{arg.SenderId}】 Topic主题=【{arg.ApplicationMessage.Topic}】 消息=【{Encoding.UTF8.GetString(arg.ApplicationMessage.Payload)}】 qos等级=【{arg.ApplicationMessage.QualityOfServiceLevel}】 {DateTime.Now}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发布主题消息
|
||||
/// </summary>
|
||||
/// <param name="topic"></param>
|
||||
/// <param name="message"></param>
|
||||
public async Task PublicMessageAsync(string topic, string message)
|
||||
{
|
||||
var applicationMessage = new MqttApplicationMessageBuilder()
|
||||
.WithTopic(topic)
|
||||
.WithPayload(message)
|
||||
.Build();
|
||||
|
||||
await MqttServer.InjectApplicationMessage(new InjectedMqttApplicationMessage(applicationMessage)
|
||||
{
|
||||
SenderClientId = _mqttOptions.MqttServerId,
|
||||
SenderUserName = _mqttOptions.MqttServerId,
|
||||
});
|
||||
|
||||
Logging($"服务器发布主题:{topic}, 内容:{message}");
|
||||
}
|
||||
|
||||
public Task StopAsync(CancellationToken cancellationToken)
|
||||
@ -216,11 +227,13 @@ public class MqttHostedService(IOptions<MqttOptions> mqttOptions, ISqlSugarClien
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
protected void Log(string msg)
|
||||
/// <summary>
|
||||
/// 输出日志
|
||||
/// </summary>
|
||||
/// <param name="msg"></param>
|
||||
protected void Logging(string msg)
|
||||
{
|
||||
if (_consoleOutput)
|
||||
Console.WriteLine(msg);
|
||||
if (_isLogging)
|
||||
msg.LogDebug();
|
||||
if (!_mqttOptions.Logging) return;
|
||||
LoggingWriter.LogInformation(msg);
|
||||
}
|
||||
}
|
||||
@ -6,38 +6,42 @@
|
||||
|
||||
using MQTTnet.Protocol;
|
||||
using MQTTnet.Server;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
public class MqttEventHandlerForAdminNet : MqttEventHandler
|
||||
|
||||
/// <summary>
|
||||
/// 默认 MQTT 事件拦截器
|
||||
/// </summary>
|
||||
public class DefaultMqttEventInterceptor : MqttEventInterceptor
|
||||
{
|
||||
public override async Task ValidatingConnectionAsync(ValidatingConnectionEventArgs arg)
|
||||
public new int Order = int.MinValue;
|
||||
|
||||
public override Task ValidatingConnectionAsync(ValidatingConnectionEventArgs arg)
|
||||
{
|
||||
ISqlSugarClient _db = App.GetRequiredService<ISqlSugarClient>();
|
||||
var _db = App.GetRequiredService<ISqlSugarClient>();
|
||||
// 验证账号
|
||||
var user = _db.Queryable<SysUser>().First(u => u.Account == arg.UserName);
|
||||
if (user == null)
|
||||
{
|
||||
arg.ReasonCode = MqttConnectReasonCode.BadUserNameOrPassword;
|
||||
Log($"客户端验证:客户端ID=【{arg.ClientId}】用户名不存在 {DateTime.Now} ");
|
||||
return;
|
||||
Logging($"客户端验证:客户端ID=【{arg.ClientId}】用户名不存在 {DateTime.Now} ");
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
// 验证密码
|
||||
var password = arg.Password;
|
||||
if (CryptogramUtil.CryptoType == CryptogramEnum.MD5.ToString())
|
||||
{
|
||||
if (user.Password.Equals(MD5Encryption.Encrypt(password))) return;
|
||||
if (user.Password.Equals(MD5Encryption.Encrypt(password)))
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CryptogramUtil.Decrypt(user.Password).Equals(password)) return;
|
||||
if (CryptogramUtil.Decrypt(user.Password).Equals(password))
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
arg.ReasonCode = MqttConnectReasonCode.BadUserNameOrPassword;
|
||||
Log($"客户端验证:客户端ID=【{arg.ClientId}】用户名或密码验证错误 {DateTime.Now} ");
|
||||
Logging($"客户端验证:客户端ID=【{arg.ClientId}】用户名或密码验证错误 {DateTime.Now} ");
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
@ -5,86 +5,116 @@
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
using MQTTnet.Server;
|
||||
using MQTTnet;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using MQTTnet.Protocol;
|
||||
using Furion.Logging.Extensions;
|
||||
using Furion.HttpRemote;
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Mqtt事件拦截器
|
||||
/// MQTT 事件拦截器
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 为了让底层的 Mqtt 代码与业务层代码分离,应该不同的业务继函 MqttEventHandler 类,实现自己的代码后
|
||||
/// 在 Startup.cs 的 Configure 函数中,调用 MqttHostedService 对象的 RegistMqttEventHandler 函数,来注册自己的事件处理器
|
||||
/// “业务相关的代码千万不要写在 MqttHostedService 中”
|
||||
/// </remarks>
|
||||
|
||||
public class MqttEventHandler
|
||||
public class MqttEventInterceptor
|
||||
{
|
||||
/// <summary>
|
||||
/// 排序,数据越大越先执行
|
||||
/// 数值越大越先执行
|
||||
/// </summary>
|
||||
public int Order = 0;
|
||||
|
||||
protected void Log(string msg)
|
||||
{
|
||||
var mqttOptions = App.GetOptions<MqttOptions>();
|
||||
if (mqttOptions.ConsoleOutput)
|
||||
Console.WriteLine(msg);
|
||||
if (mqttOptions.Logging)
|
||||
msg.LogDebug();
|
||||
}
|
||||
|
||||
public virtual async Task ValidatingConnectionAsync(ValidatingConnectionEventArgs arg)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 启动后事件
|
||||
/// </summary>
|
||||
/// <param name="arg"></param>
|
||||
/// <returns></returns>
|
||||
public virtual async Task StartedAsync(EventArgs arg)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual async Task StoppedAsync(EventArgs arg)
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 客户端发布的数据
|
||||
/// 关闭后事件
|
||||
/// </summary>
|
||||
/// <param name="arg"></param>
|
||||
/// <returns></returns>
|
||||
public virtual async Task StoppedAsync(EventArgs arg)
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 客户端验证事件
|
||||
/// </summary>
|
||||
/// <param name="arg"></param>
|
||||
/// <returns></returns>
|
||||
public virtual async Task ValidatingConnectionAsync(ValidatingConnectionEventArgs arg)
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 客户端连接事件
|
||||
/// </summary>
|
||||
/// <param name="arg"></param>
|
||||
/// <returns></returns>
|
||||
public virtual async Task ClientConnectedAsync(ClientConnectedEventArgs arg)
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 客户端断开事件
|
||||
/// </summary>
|
||||
/// <param name="arg"></param>
|
||||
/// <returns></returns>
|
||||
public virtual async Task ClientDisconnectedAsync(ClientDisconnectedEventArgs arg)
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 订阅主题事件
|
||||
/// </summary>
|
||||
/// <param name="arg"></param>
|
||||
/// <returns></returns>
|
||||
public virtual async Task ClientSubscribedTopicAsync(ClientSubscribedTopicEventArgs arg)
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 取消订阅事件
|
||||
/// </summary>
|
||||
/// <param name="arg"></param>
|
||||
/// <returns></returns>
|
||||
public virtual async Task ClientUnsubscribedTopicAsync(ClientUnsubscribedTopicEventArgs arg)
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 拦截发布的消息事件
|
||||
/// </summary>
|
||||
/// <param name="arg"></param>
|
||||
/// <returns></returns>
|
||||
public virtual async Task InterceptingPublishAsync(InterceptingPublishEventArgs arg)
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 没有客户端接收的数据
|
||||
/// 未被消费的消息事件
|
||||
/// </summary>
|
||||
/// <param name="arg"></param>
|
||||
/// <returns></returns>
|
||||
public virtual async Task ApplicationMessageNotConsumedAsync(ApplicationMessageNotConsumedEventArgs arg)
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
public virtual async Task ClientSubscribedTopicAsync(ClientSubscribedTopicEventArgs arg)
|
||||
{
|
||||
}
|
||||
public virtual async Task ClientUnsubscribedTopicAsync(ClientUnsubscribedTopicEventArgs arg)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual async Task ClientDisconnectedAsync(ClientDisconnectedEventArgs arg)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual async Task ClientConnectedAsync(ClientConnectedEventArgs arg)
|
||||
/// <summary>
|
||||
/// 输出日志事件
|
||||
/// </summary>
|
||||
/// <param name="msg"></param>
|
||||
protected static void Logging(string msg)
|
||||
{
|
||||
if (!App.GetOptions<MqttOptions>().Logging) return;
|
||||
LoggingWriter.LogInformation(msg);
|
||||
}
|
||||
}
|
||||
@ -11,31 +11,11 @@ namespace Admin.NET.Core;
|
||||
/// </summary>
|
||||
public sealed class MqttOptions : IConfigurableOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// 服务器主动发布时用的ClientId
|
||||
/// </summary>
|
||||
public string MqttServerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
public bool Enabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 输出文件日志
|
||||
/// </summary>
|
||||
public bool Logging { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 控制台输出
|
||||
/// </summary>
|
||||
public bool ConsoleOutput { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ConnectionBacklog
|
||||
/// </summary>
|
||||
public int ConnectionBacklog { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 端口
|
||||
/// </summary>
|
||||
@ -45,4 +25,19 @@ public sealed class MqttOptions : IConfigurableOptions
|
||||
/// IP地址
|
||||
/// </summary>
|
||||
public string IPAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最大连接数
|
||||
/// </summary>
|
||||
public int ConnectionBacklog { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务器主动发消息时的ClientId
|
||||
/// </summary>
|
||||
public string MqttServerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 输出日志
|
||||
/// </summary>
|
||||
public bool Logging { get; set; }
|
||||
}
|
||||
@ -4,16 +4,20 @@
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 发布主题消息
|
||||
/// </summary>
|
||||
public class PublicMessageInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 主题名称
|
||||
/// </summary>
|
||||
public string Topic { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 消息内容
|
||||
/// </summary>
|
||||
public string Message { get; set; }
|
||||
}
|
||||
@ -28,15 +28,14 @@ public class SysMqttService() : IDynamicApiController, ITransient
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发布主题 🔖
|
||||
/// 发布主题消息 🔖
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
[DisplayName("发布主题")]
|
||||
[DisplayName("发布主题消息")]
|
||||
public async Task PublicMessage(PublicMessageInput input)
|
||||
{
|
||||
MqttHostedService mqttHostedService = App.GetRequiredService<MqttHostedService>();
|
||||
mqttHostedService.PublicMessage(input.Topic, input.Message);
|
||||
var mqttHostedService = App.GetRequiredService<MqttHostedService>();
|
||||
await mqttHostedService.PublicMessageAsync(input.Topic, input.Message);
|
||||
}
|
||||
}
|
||||
@ -22,7 +22,6 @@ using Microsoft.AspNetCore.ResponseCompression;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Options;
|
||||
using MQTTnet.AspNetCore;
|
||||
using Newtonsoft.Json;
|
||||
using OnceMi.AspNetCore.OSS;
|
||||
@ -108,7 +107,8 @@ public class Startup : AppStartup
|
||||
// setting.MetadataPropertyHandling = MetadataPropertyHandling.Ignore; // 解决DateTimeOffset异常
|
||||
// setting.DateParseHandling = DateParseHandling.None; // 解决DateTimeOffset异常
|
||||
// setting.Converters.Add(new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }); // 解决DateTimeOffset异常
|
||||
};
|
||||
}
|
||||
;
|
||||
|
||||
services.AddControllersWithViews()
|
||||
.AddAppLocalization()
|
||||
@ -412,29 +412,22 @@ public class Startup : AppStartup
|
||||
}
|
||||
});
|
||||
|
||||
IOptions<MqttOptions> mqttOptions = App.GetRequiredService<IOptions<MqttOptions>>();
|
||||
var mqttOptions = App.GetConfig<MqttOptions>("Mqtt", true);
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
// 注册集线器
|
||||
endpoints.MapHubs();
|
||||
|
||||
// 注册路由
|
||||
endpoints.MapControllerRoute(
|
||||
name: "default",
|
||||
pattern: "{controller=Home}/{action=Index}/{id?}");
|
||||
if (mqttOptions.Value.Enabled)
|
||||
// 注册 MQTT 支持 WebSocket
|
||||
if (mqttOptions.Enabled)
|
||||
{
|
||||
endpoints.MapConnectionHandler<MqttConnectionHandler>(
|
||||
"/mqtt",
|
||||
endpoints.MapConnectionHandler<MqttConnectionHandler>("/mqtt",
|
||||
httpConnectionDispatcherOptions => httpConnectionDispatcherOptions.WebSockets.SubProtocolSelector =
|
||||
protocolList => protocolList.FirstOrDefault() ?? string.Empty);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if (mqttOptions.Value.Enabled)
|
||||
{
|
||||
// [以下是验证的示例] 注册自己业务的 Mqtt 处理器,如果有不同的认证方式,要把以下这句注释掉
|
||||
//MqttHostedService.RegistMqttEventHandler(new MqttEventHandlerForAdminNet(), int.MaxValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2,7 +2,7 @@
|
||||
"name": "admin.net.pro",
|
||||
"type": "module",
|
||||
"version": "2.4.33",
|
||||
"lastBuildTime": "2025.02.20",
|
||||
"lastBuildTime": "2025.02.23",
|
||||
"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
|
||||
"author": "zuohuaijun",
|
||||
"license": "MIT",
|
||||
@ -18,8 +18,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@element-plus/icons-vue": "^2.3.1",
|
||||
"@logicflow/core": "^2.0.10",
|
||||
"@logicflow/extension": "^2.0.14",
|
||||
"@logicflow/core": "^2.0.11",
|
||||
"@logicflow/extension": "^2.0.15",
|
||||
"@microsoft/signalr": "^8.0.7",
|
||||
"@vue-office/docx": "^1.6.2",
|
||||
"@vue-office/excel": "^1.7.14",
|
||||
@ -36,7 +36,7 @@
|
||||
"echarts": "^5.6.0",
|
||||
"echarts-gl": "^2.0.9",
|
||||
"echarts-wordcloud": "^2.1.0",
|
||||
"element-plus": "^2.9.4",
|
||||
"element-plus": "^2.9.5",
|
||||
"exceljs": "^4.4.0",
|
||||
"ezuikit-js": "^8.1.6",
|
||||
"gcoord": "^1.0.7",
|
||||
@ -45,7 +45,7 @@
|
||||
"jsplumb": "^2.15.6",
|
||||
"jwchat": "^2.0.3",
|
||||
"lodash-es": "^4.17.21",
|
||||
"md-editor-v3": "^5.2.3",
|
||||
"md-editor-v3": "^5.3.2",
|
||||
"mitt": "^3.0.1",
|
||||
"monaco-editor": "^0.52.2",
|
||||
"mqtt": "^5.10.3",
|
||||
@ -74,7 +74,7 @@
|
||||
"vue-router": "^4.5.0",
|
||||
"vue-signature-pad": "^3.0.2",
|
||||
"vue3-tree-org": "^4.2.2",
|
||||
"vxe-pc-ui": "^4.3.91",
|
||||
"vxe-pc-ui": "^4.3.95",
|
||||
"vxe-table": "^4.10.0",
|
||||
"vxe-table-plugin-element": "^4.0.4",
|
||||
"vxe-table-plugin-export-xlsx": "^4.0.7",
|
||||
@ -94,11 +94,11 @@
|
||||
"@vitejs/plugin-vue-jsx": "^4.1.1",
|
||||
"@vue/compiler-sfc": "^3.5.13",
|
||||
"code-inspector-plugin": "^0.20.0",
|
||||
"eslint": "^9.20.1",
|
||||
"eslint": "^9.21.0",
|
||||
"eslint-plugin-vue": "^9.32.0",
|
||||
"globals": "^15.15.0",
|
||||
"globals": "^16.0.0",
|
||||
"less": "^4.2.2",
|
||||
"prettier": "^3.5.1",
|
||||
"prettier": "^3.5.2",
|
||||
"rollup-plugin-visualizer": "^5.14.0",
|
||||
"sass": "^1.85.0",
|
||||
"terser": "^5.39.0",
|
||||
|
||||
@ -38,6 +38,7 @@ export * from './apis/sys-log-op-api';
|
||||
export * from './apis/sys-log-vis-api';
|
||||
export * from './apis/sys-menu-api';
|
||||
export * from './apis/sys-message-api';
|
||||
export * from './apis/sys-mqtt-api';
|
||||
export * from './apis/sys-notice-api';
|
||||
export * from './apis/sys-oauth-api';
|
||||
export * from './apis/sys-oauth-user-api';
|
||||
|
||||
@ -77,6 +77,49 @@ export const SysEnumApiAxiosParamCreator = function (configuration?: Configurati
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 枚举转字典
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiSysEnumEnumToDictPost: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/api/sysEnum/enumToDict`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication Bearer required
|
||||
// http bearer authentication required
|
||||
if (configuration && configuration.accessToken) {
|
||||
const accessToken = typeof configuration.accessToken === 'function'
|
||||
? await configuration.accessToken()
|
||||
: await configuration.accessToken;
|
||||
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
||||
}
|
||||
|
||||
const query = new URLSearchParams(localVarUrlObj.search);
|
||||
for (const key in localVarQueryParameter) {
|
||||
query.set(key, localVarQueryParameter[key]);
|
||||
}
|
||||
for (const key in options.params) {
|
||||
query.set(key, options.params[key]);
|
||||
}
|
||||
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
|
||||
return {
|
||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取所有枚举类型 🔖
|
||||
@ -143,6 +186,19 @@ export const SysEnumApiFp = function(configuration?: Configuration) {
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 枚举转字典
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysEnumEnumToDictPost(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
||||
const localVarAxiosArgs = await SysEnumApiAxiosParamCreator(configuration).apiSysEnumEnumToDictPost(options);
|
||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取所有枚举类型 🔖
|
||||
@ -175,6 +231,15 @@ export const SysEnumApiFactory = function (configuration?: Configuration, basePa
|
||||
async apiSysEnumEnumDataListGet(enumName: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultListEnumEntity>> {
|
||||
return SysEnumApiFp(configuration).apiSysEnumEnumDataListGet(enumName, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 枚举转字典
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysEnumEnumToDictPost(options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
||||
return SysEnumApiFp(configuration).apiSysEnumEnumToDictPost(options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取所有枚举类型 🔖
|
||||
@ -205,6 +270,16 @@ export class SysEnumApi extends BaseAPI {
|
||||
public async apiSysEnumEnumDataListGet(enumName: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultListEnumEntity>> {
|
||||
return SysEnumApiFp(this.configuration).apiSysEnumEnumDataListGet(enumName, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 枚举转字典
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof SysEnumApi
|
||||
*/
|
||||
public async apiSysEnumEnumToDictPost(options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
||||
return SysEnumApiFp(this.configuration).apiSysEnumEnumToDictPost(options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 获取所有枚举类型 🔖
|
||||
|
||||
214
Web/src/api-services/apis/sys-mqtt-api.ts
Normal file
214
Web/src/api-services/apis/sys-mqtt-api.ts
Normal file
@ -0,0 +1,214 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Admin.NET 通用权限开发平台
|
||||
* 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
|
||||
import { Configuration } from '../configuration';
|
||||
// Some imports not used depending on template conditions
|
||||
// @ts-ignore
|
||||
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
|
||||
import { AdminNETResultIListMqttClientStatus } from '../models';
|
||||
import { PublicMessageInput } from '../models';
|
||||
/**
|
||||
* SysMqttApi - axios parameter creator
|
||||
* @export
|
||||
*/
|
||||
export const SysMqttApiAxiosParamCreator = function (configuration?: Configuration) {
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @summary 获取客户端列表 🔖
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiSysMqttClientsGet: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/api/sysMqtt/clients`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication Bearer required
|
||||
// http bearer authentication required
|
||||
if (configuration && configuration.accessToken) {
|
||||
const accessToken = typeof configuration.accessToken === 'function'
|
||||
? await configuration.accessToken()
|
||||
: await configuration.accessToken;
|
||||
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
||||
}
|
||||
|
||||
const query = new URLSearchParams(localVarUrlObj.search);
|
||||
for (const key in localVarQueryParameter) {
|
||||
query.set(key, localVarQueryParameter[key]);
|
||||
}
|
||||
for (const key in options.params) {
|
||||
query.set(key, options.params[key]);
|
||||
}
|
||||
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
|
||||
return {
|
||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 发布主题消息 🔖
|
||||
* @param {PublicMessageInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiSysMqttPublicMessagePost: async (body?: PublicMessageInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/api/sysMqtt/publicMessage`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication Bearer required
|
||||
// http bearer authentication required
|
||||
if (configuration && configuration.accessToken) {
|
||||
const accessToken = typeof configuration.accessToken === 'function'
|
||||
? await configuration.accessToken()
|
||||
: await configuration.accessToken;
|
||||
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
||||
}
|
||||
|
||||
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
|
||||
|
||||
const query = new URLSearchParams(localVarUrlObj.search);
|
||||
for (const key in localVarQueryParameter) {
|
||||
query.set(key, localVarQueryParameter[key]);
|
||||
}
|
||||
for (const key in options.params) {
|
||||
query.set(key, options.params[key]);
|
||||
}
|
||||
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
||||
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
||||
|
||||
return {
|
||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* SysMqttApi - functional programming interface
|
||||
* @export
|
||||
*/
|
||||
export const SysMqttApiFp = function(configuration?: Configuration) {
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @summary 获取客户端列表 🔖
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysMqttClientsGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminNETResultIListMqttClientStatus>>> {
|
||||
const localVarAxiosArgs = await SysMqttApiAxiosParamCreator(configuration).apiSysMqttClientsGet(options);
|
||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 发布主题消息 🔖
|
||||
* @param {PublicMessageInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysMqttPublicMessagePost(body?: PublicMessageInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
||||
const localVarAxiosArgs = await SysMqttApiAxiosParamCreator(configuration).apiSysMqttPublicMessagePost(body, options);
|
||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* SysMqttApi - factory interface
|
||||
* @export
|
||||
*/
|
||||
export const SysMqttApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @summary 获取客户端列表 🔖
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysMqttClientsGet(options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultIListMqttClientStatus>> {
|
||||
return SysMqttApiFp(configuration).apiSysMqttClientsGet(options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 发布主题消息 🔖
|
||||
* @param {PublicMessageInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysMqttPublicMessagePost(body?: PublicMessageInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
||||
return SysMqttApiFp(configuration).apiSysMqttPublicMessagePost(body, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* SysMqttApi - object-oriented interface
|
||||
* @export
|
||||
* @class SysMqttApi
|
||||
* @extends {BaseAPI}
|
||||
*/
|
||||
export class SysMqttApi extends BaseAPI {
|
||||
/**
|
||||
*
|
||||
* @summary 获取客户端列表 🔖
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof SysMqttApi
|
||||
*/
|
||||
public async apiSysMqttClientsGet(options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultIListMqttClientStatus>> {
|
||||
return SysMqttApiFp(this.configuration).apiSysMqttClientsGet(options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 发布主题消息 🔖
|
||||
* @param {PublicMessageInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof SysMqttApi
|
||||
*/
|
||||
public async apiSysMqttPublicMessagePost(body?: PublicMessageInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
||||
return SysMqttApiFp(this.configuration).apiSysMqttPublicMessagePost(body, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
}
|
||||
@ -74,6 +74,49 @@ export const SysOnlineUserApiAxiosParamCreator = function (configuration?: Confi
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 清理在线用户(开启单设备登录时只留相同账号最后登录的)
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiSysOnlineUserOnlinePost: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/api/sysOnlineUser/online`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication Bearer required
|
||||
// http bearer authentication required
|
||||
if (configuration && configuration.accessToken) {
|
||||
const accessToken = typeof configuration.accessToken === 'function'
|
||||
? await configuration.accessToken()
|
||||
: await configuration.accessToken;
|
||||
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
||||
}
|
||||
|
||||
const query = new URLSearchParams(localVarUrlObj.search);
|
||||
for (const key in localVarQueryParameter) {
|
||||
query.set(key, localVarQueryParameter[key]);
|
||||
}
|
||||
for (const key in options.params) {
|
||||
query.set(key, options.params[key]);
|
||||
}
|
||||
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
|
||||
return {
|
||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取在线用户分页列表 🔖
|
||||
@ -145,6 +188,19 @@ export const SysOnlineUserApiFp = function(configuration?: Configuration) {
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 清理在线用户(开启单设备登录时只留相同账号最后登录的)
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysOnlineUserOnlinePost(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
||||
const localVarAxiosArgs = await SysOnlineUserApiAxiosParamCreator(configuration).apiSysOnlineUserOnlinePost(options);
|
||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取在线用户分页列表 🔖
|
||||
@ -178,6 +234,15 @@ export const SysOnlineUserApiFactory = function (configuration?: Configuration,
|
||||
async apiSysOnlineUserForceOfflinePost(body?: SysOnlineUser, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
||||
return SysOnlineUserApiFp(configuration).apiSysOnlineUserForceOfflinePost(body, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 清理在线用户(开启单设备登录时只留相同账号最后登录的)
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysOnlineUserOnlinePost(options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
||||
return SysOnlineUserApiFp(configuration).apiSysOnlineUserOnlinePost(options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取在线用户分页列表 🔖
|
||||
@ -209,6 +274,16 @@ export class SysOnlineUserApi extends BaseAPI {
|
||||
public async apiSysOnlineUserForceOfflinePost(body?: SysOnlineUser, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
||||
return SysOnlineUserApiFp(this.configuration).apiSysOnlineUserForceOfflinePost(body, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 清理在线用户(开启单设备登录时只留相同账号最后登录的)
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof SysOnlineUserApi
|
||||
*/
|
||||
public async apiSysOnlineUserOnlinePost(options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
||||
return SysOnlineUserApiFp(this.configuration).apiSysOnlineUserOnlinePost(options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 获取在线用户分页列表 🔖
|
||||
|
||||
53
Web/src/api-services/models/address-family.ts
Normal file
53
Web/src/api-services/models/address-family.ts
Normal file
@ -0,0 +1,53 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Admin.NET 通用权限开发平台
|
||||
* 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum AddressFamily {
|
||||
NUMBER_0 = 0,
|
||||
NUMBER_1 = 1,
|
||||
NUMBER_2 = 2,
|
||||
NUMBER_3 = 3,
|
||||
NUMBER_4 = 4,
|
||||
NUMBER_5 = 5,
|
||||
NUMBER_6 = 6,
|
||||
NUMBER_7 = 7,
|
||||
NUMBER_8 = 8,
|
||||
NUMBER_9 = 9,
|
||||
NUMBER_10 = 10,
|
||||
NUMBER_11 = 11,
|
||||
NUMBER_12 = 12,
|
||||
NUMBER_13 = 13,
|
||||
NUMBER_14 = 14,
|
||||
NUMBER_15 = 15,
|
||||
NUMBER_16 = 16,
|
||||
NUMBER_17 = 17,
|
||||
NUMBER_18 = 18,
|
||||
NUMBER_19 = 19,
|
||||
NUMBER_21 = 21,
|
||||
NUMBER_22 = 22,
|
||||
NUMBER_23 = 23,
|
||||
NUMBER_24 = 24,
|
||||
NUMBER_25 = 25,
|
||||
NUMBER_26 = 26,
|
||||
NUMBER_28 = 28,
|
||||
NUMBER_29 = 29,
|
||||
NUMBER_65536 = 65536,
|
||||
NUMBER_65537 = 65537,
|
||||
NUMBER_MINUS_1 = -1
|
||||
}
|
||||
|
||||
@ -0,0 +1,71 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Admin.NET 通用权限开发平台
|
||||
* 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { MqttClientStatus } from './mqtt-client-status';
|
||||
/**
|
||||
* 全局返回结果
|
||||
*
|
||||
* @export
|
||||
* @interface AdminNETResultIListMqttClientStatus
|
||||
*/
|
||||
export interface AdminNETResultIListMqttClientStatus {
|
||||
|
||||
/**
|
||||
* 状态码
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof AdminNETResultIListMqttClientStatus
|
||||
*/
|
||||
code?: number;
|
||||
|
||||
/**
|
||||
* 类型success、warning、error
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AdminNETResultIListMqttClientStatus
|
||||
*/
|
||||
type?: string | null;
|
||||
|
||||
/**
|
||||
* 错误信息
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AdminNETResultIListMqttClientStatus
|
||||
*/
|
||||
message?: string | null;
|
||||
|
||||
/**
|
||||
* 数据
|
||||
*
|
||||
* @type {Array<MqttClientStatus>}
|
||||
* @memberof AdminNETResultIListMqttClientStatus
|
||||
*/
|
||||
result?: Array<MqttClientStatus> | null;
|
||||
|
||||
/**
|
||||
* 附加数据
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof AdminNETResultIListMqttClientStatus
|
||||
*/
|
||||
extras?: any | null;
|
||||
|
||||
/**
|
||||
* 时间
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof AdminNETResultIListMqttClientStatus
|
||||
*/
|
||||
time?: Date;
|
||||
}
|
||||
29
Web/src/api-services/models/end-point.ts
Normal file
29
Web/src/api-services/models/end-point.ts
Normal file
@ -0,0 +1,29 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Admin.NET 通用权限开发平台
|
||||
* 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { AddressFamily } from './address-family';
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @export
|
||||
* @interface EndPoint
|
||||
*/
|
||||
export interface EndPoint {
|
||||
|
||||
/**
|
||||
* @type {AddressFamily}
|
||||
* @memberof EndPoint
|
||||
*/
|
||||
addressFamily?: AddressFamily;
|
||||
}
|
||||
@ -21,6 +21,7 @@ export * from './add-sys-ldap-input';
|
||||
export * from './add-tenant-input';
|
||||
export * from './add-upgrade-input';
|
||||
export * from './add-user-input';
|
||||
export * from './address-family';
|
||||
export * from './admin-netresult-boolean';
|
||||
export * from './admin-netresult-captcha-output';
|
||||
export * from './admin-netresult-create-pay-transaction-native-output';
|
||||
@ -34,6 +35,7 @@ export * from './admin-netresult-grant-role-output';
|
||||
export * from './admin-netresult-iaction-result';
|
||||
export * from './admin-netresult-idisposable';
|
||||
export * from './admin-netresult-ienumerable-entity-info';
|
||||
export * from './admin-netresult-ilist-mqtt-client-status';
|
||||
export * from './admin-netresult-int32';
|
||||
export * from './admin-netresult-int64';
|
||||
export * from './admin-netresult-jobject';
|
||||
@ -210,6 +212,7 @@ export * from './delete-user-input';
|
||||
export * from './dict-data-input';
|
||||
export * from './dict-type-input';
|
||||
export * from './digit-shapes';
|
||||
export * from './end-point';
|
||||
export * from './entity-column-info';
|
||||
export * from './entity-info';
|
||||
export * from './enum-entity';
|
||||
@ -276,6 +279,9 @@ export * from './method-impl-attributes';
|
||||
export * from './method-info';
|
||||
export * from './module';
|
||||
export * from './module-handle';
|
||||
export * from './mqtt-client-status';
|
||||
export * from './mqtt-protocol-version';
|
||||
export * from './mqtt-session-status';
|
||||
export * from './navigate';
|
||||
export * from './notice-input';
|
||||
export * from './notice-status-enum';
|
||||
@ -322,6 +328,7 @@ export * from './print-type-enum';
|
||||
export * from './promotion';
|
||||
export * from './property-attributes';
|
||||
export * from './property-info';
|
||||
export * from './public-message-input';
|
||||
export * from './query-region-input';
|
||||
export * from './refund-request-input';
|
||||
export * from './reset-pwd-user-input';
|
||||
|
||||
115
Web/src/api-services/models/mqtt-client-status.ts
Normal file
115
Web/src/api-services/models/mqtt-client-status.ts
Normal file
@ -0,0 +1,115 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Admin.NET 通用权限开发平台
|
||||
* 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { EndPoint } from './end-point';
|
||||
import { MqttProtocolVersion } from './mqtt-protocol-version';
|
||||
import { MqttSessionStatus } from './mqtt-session-status';
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @export
|
||||
* @interface MqttClientStatus
|
||||
*/
|
||||
export interface MqttClientStatus {
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
* @memberof MqttClientStatus
|
||||
*/
|
||||
bytesReceived?: number;
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
* @memberof MqttClientStatus
|
||||
*/
|
||||
bytesSent?: number;
|
||||
|
||||
/**
|
||||
* @type {Date}
|
||||
* @memberof MqttClientStatus
|
||||
*/
|
||||
connectedTimestamp?: Date;
|
||||
|
||||
/**
|
||||
* @type {EndPoint}
|
||||
* @memberof MqttClientStatus
|
||||
*/
|
||||
remoteEndPoint?: EndPoint;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
* @memberof MqttClientStatus
|
||||
*/
|
||||
endpoint?: string | null;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
* @memberof MqttClientStatus
|
||||
*/
|
||||
id?: string | null;
|
||||
|
||||
/**
|
||||
* @type {Date}
|
||||
* @memberof MqttClientStatus
|
||||
*/
|
||||
lastNonKeepAlivePacketReceivedTimestamp?: Date;
|
||||
|
||||
/**
|
||||
* @type {Date}
|
||||
* @memberof MqttClientStatus
|
||||
*/
|
||||
lastPacketReceivedTimestamp?: Date;
|
||||
|
||||
/**
|
||||
* @type {Date}
|
||||
* @memberof MqttClientStatus
|
||||
*/
|
||||
lastPacketSentTimestamp?: Date;
|
||||
|
||||
/**
|
||||
* @type {MqttProtocolVersion}
|
||||
* @memberof MqttClientStatus
|
||||
*/
|
||||
protocolVersion?: MqttProtocolVersion;
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
* @memberof MqttClientStatus
|
||||
*/
|
||||
receivedApplicationMessagesCount?: number;
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
* @memberof MqttClientStatus
|
||||
*/
|
||||
receivedPacketsCount?: number;
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
* @memberof MqttClientStatus
|
||||
*/
|
||||
sentApplicationMessagesCount?: number;
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
* @memberof MqttClientStatus
|
||||
*/
|
||||
sentPacketsCount?: number;
|
||||
|
||||
/**
|
||||
* @type {MqttSessionStatus}
|
||||
* @memberof MqttClientStatus
|
||||
*/
|
||||
session?: MqttSessionStatus;
|
||||
}
|
||||
26
Web/src/api-services/models/mqtt-protocol-version.ts
Normal file
26
Web/src/api-services/models/mqtt-protocol-version.ts
Normal file
@ -0,0 +1,26 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Admin.NET 通用权限开发平台
|
||||
* 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum MqttProtocolVersion {
|
||||
NUMBER_0 = 0,
|
||||
NUMBER_3 = 3,
|
||||
NUMBER_4 = 4,
|
||||
NUMBER_5 = 5
|
||||
}
|
||||
|
||||
58
Web/src/api-services/models/mqtt-session-status.ts
Normal file
58
Web/src/api-services/models/mqtt-session-status.ts
Normal file
@ -0,0 +1,58 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Admin.NET 通用权限开发平台
|
||||
* 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @export
|
||||
* @interface MqttSessionStatus
|
||||
*/
|
||||
export interface MqttSessionStatus {
|
||||
|
||||
/**
|
||||
* @type {Date}
|
||||
* @memberof MqttSessionStatus
|
||||
*/
|
||||
createdTimestamp?: Date;
|
||||
|
||||
/**
|
||||
* @type {Date}
|
||||
* @memberof MqttSessionStatus
|
||||
*/
|
||||
disconnectedTimestamp?: Date | null;
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
* @memberof MqttSessionStatus
|
||||
*/
|
||||
expiryInterval?: number;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
* @memberof MqttSessionStatus
|
||||
*/
|
||||
id?: string | null;
|
||||
|
||||
/**
|
||||
* @type {{ [key: string]: any; }}
|
||||
* @memberof MqttSessionStatus
|
||||
*/
|
||||
items?: { [key: string]: any; } | null;
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
* @memberof MqttSessionStatus
|
||||
*/
|
||||
pendingApplicationMessagesCount?: number;
|
||||
}
|
||||
38
Web/src/api-services/models/public-message-input.ts
Normal file
38
Web/src/api-services/models/public-message-input.ts
Normal file
@ -0,0 +1,38 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Admin.NET 通用权限开发平台
|
||||
* 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/**
|
||||
* 发布主题消息
|
||||
*
|
||||
* @export
|
||||
* @interface PublicMessageInput
|
||||
*/
|
||||
export interface PublicMessageInput {
|
||||
|
||||
/**
|
||||
* 主题名称
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof PublicMessageInput
|
||||
*/
|
||||
topic?: string | null;
|
||||
|
||||
/**
|
||||
* 消息内容
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof PublicMessageInput
|
||||
*/
|
||||
message?: string | null;
|
||||
}
|
||||
@ -140,6 +140,14 @@ export interface SysFile {
|
||||
*/
|
||||
suffix?: string | null;
|
||||
|
||||
/**
|
||||
* MIME类型
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof SysFile
|
||||
*/
|
||||
contentType?: string | null;
|
||||
|
||||
/**
|
||||
* 存储路径
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user