补缺失依懒
This commit is contained in:
parent
e3f9975657
commit
102b336a85
@ -13,14 +13,7 @@ namespace Admin.NET.Core.Service;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiDescriptionSettings(Order = 90, Description = "MQTT 服务")]
|
[ApiDescriptionSettings(Order = 90, Description = "MQTT 服务")]
|
||||||
public class SysMqttService() : IDynamicApiController, ITransient
|
public class SysMqttService() : IDynamicApiController, ITransient
|
||||||
{
|
{
|
||||||
|
|
||||||
MqttHostedService _mqttHostedService;
|
|
||||||
public SysMqttService(MqttHostedService mqttProvider)
|
|
||||||
{
|
|
||||||
_mqttHostedService = mqttProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取客户端列表 🔖
|
/// 获取客户端列表 🔖
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -35,14 +28,15 @@ public class SysMqttService() : IDynamicApiController, ITransient
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 发布消息 🔖
|
/// 发布主题 🔖
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[DisplayName("发布消息")]
|
[DisplayName("发布主题")]
|
||||||
public async Task PublicMessage(PublicMessageInput input)
|
public async Task PublicMessage(PublicMessageInput input)
|
||||||
{
|
{
|
||||||
_mqttHostedService.PublicMessage(input.Topic, input.Message);
|
MqttHostedService mqttHostedService = App.GetRequiredService<MqttHostedService>();
|
||||||
|
mqttHostedService.PublicMessage(input.Topic, input.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="IGeekFan.AspNetCore.Knife4jUI" Version="0.0.16" />
|
<PackageReference Include="IGeekFan.AspNetCore.Knife4jUI" Version="0.0.16" />
|
||||||
|
<PackageReference Include="MQTTnet.AspNetCore" Version="5.0.1.1416" />
|
||||||
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="9.0.2" />
|
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="9.0.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user