gwbvipvip 11 місяці тому
джерело
коміт
2983d54d1f
8 змінених файлів з 42 додано та 2 видалено
  1. BIN
     
  2. BIN
     
  3. BIN
     
  4. BIN
     
  5. +1
    -1
      BPA.KitChen.GroupMeal.Application/Service/OneCard/Gate/GateService.cs
  6. +1
    -0
      BPA.KitChen.GroupMeal.Core/BPA.KitChen.GroupMeal.Core.csproj
  7. +32
    -0
      BPA.KitChen.GroupMeal/Program.cs
  8. +8
    -1
      BPA.KitChen.GroupMeal/appsettings.json




+ 1
- 1
BPA.KitChen.GroupMeal.Application/Service/OneCard/Gate/GateService.cs Переглянути файл

@@ -144,7 +144,7 @@ namespace BPA.KitChen.GroupMeal.Application.Service.OneCard.Gate
// model.FoodName = item.Goods_Name;
//}
var key = $"GateFood";
// ServiceQueryPush.QueryPush.PushMQ("add", key, MQEnum.Push);
ServiceQueryPush.QueryPush.PushMQ("add", key, MQEnum.Push);
return await db.Insertable(bPA_GateFoods)
.CallEntityMethod(m => m.Create()).ExecuteCommandAsync() > 0;



+ 1
- 0
BPA.KitChen.GroupMeal.Core/BPA.KitChen.GroupMeal.Core.csproj Переглянути файл

@@ -7,6 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BPA.MQTTClient" Version="1.0.11" />
<PackageReference Include="EasyNetQ" Version="7.8.0" />
<PackageReference Include="Furion" Version="4.9.1.15" />
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.1.15" />


+ 32
- 0
BPA.KitChen.GroupMeal/Program.cs Переглянути файл

@@ -1,7 +1,10 @@
using BPA.KitChen.GroupMeal.Core.Common;
using BPA.KitChen.GroupMeal.Handlers;
using BPA.KitChen.GroupMeal.SqlSugar;
using BPA.MQTTClient;
using Furion;
using MQTTnet.Client.Connecting;
using MQTTnet.Client.Disconnecting;
using Newtonsoft.Json.Linq;
using SqlSugar;
using XExten.Advance.LinqFramework;
@@ -10,8 +13,37 @@ var builder = WebApplication.CreateBuilder(args).Inject();

//JWT¼øȨ
builder.Services.AddJwt<JwtHandler>(enableGlobalAuthorize: true);
builder.Services.AddMqttClientHostedService(op =>
{
op.Port = int.Parse(App.Configuration["dev1_brokerHostSettings:Port"]);
op.Server = App.Configuration["dev1_brokerHostSettings:Host"];
op.UserName = App.Configuration["MqttClientSettings:UserName"];
op.Password = App.Configuration["MqttClientSettings:Password"];
op.mqttClientConnectedHandlerDelegate = new MqttClientConnectedHandlerDelegate(async e =>
{
Console.WriteLine("MQTTÁ¬½Ó³É¹¦");
});
op.mqttClientDisconnectedHandlerDelegate = new MqttClientDisconnectedHandlerDelegate(async e =>
{
Console.WriteLine("MQTT¶Ï¿ªÁ¬½Ó");
await Task.Delay(TimeSpan.FromSeconds(5));
try
{
//var options = op.Server.GetService<IMqttClientOptions>();
//await op.Server.GetService<IMqttClient>().ConnectAsync(options);
}
catch (global::System.Exception)
{


}
});
op.MqttApplicationMessageReceivedHandler = new MQTTnet.Client.Receiving.MqttApplicationMessageReceivedHandlerDelegate(async e =>
{

});
});


CosConfig.cosInfoOptions = new CosInfoOptions(App.Configuration["cos_config:AppId"],
App.Configuration["cos_config:Region"], App.Configuration["cos_config:Bucket"],


+ 8
- 1
BPA.KitChen.GroupMeal/appsettings.json Переглянути файл

@@ -24,7 +24,14 @@
"SecretId": "AKIDa4KQIvKUP6bw4ye6JI3a8lCPN7cswnV3",
"SecretKey": "ObaLtCH9nCNPFrFQO7ex2sTqyxlLgnfJ"
},

"dev1_brokerHostSettings": {
"Port": 1883,
"Host": "10.2.1.21"
},
"MqttClientSettings": {
"UserName": "emqx_u_block",
"Password": "emqx_p_admin8765490789"
},
"SAAS_Manage": "http://10.2.1.26:21995/saasbase/",
"DBConnectionStr": "server=10.2.1.21;Port=3306;Database=bpa_kitchen_groupmeal;Uid=root;Pwd=cygadmin;",
"AllowedHosts": "*"


Завантаження…
Відмінити
Зберегти