From 8d5df6b4e9d86c7bd749a8b29f93bd3ae5529700 Mon Sep 17 00:00:00 2001 From: MysticBoy Date: Fri, 11 Feb 2022 23:24:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E6=96=B0=E7=9A=84mqttnet4.0?= =?UTF-8?q?=20=E7=89=88=E6=9C=AC=EF=BC=8C=E5=8D=87=E7=BA=A7=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IoTSharp.Data.InMemory.csproj | 8 ++--- .../IoTSharp.Data.MySQL.csproj | 6 ++-- .../IoTSharp.Data.Oracle.csproj | 4 +-- .../IoTSharp.Data.PostgreSQL.csproj | 6 ++-- .../IoTSharp.Data.SqlServer.csproj | 2 +- .../IoTSharp.Data.Sqlite.csproj | 8 ++--- IoTSharp.Data/IoTSharp.Data.csproj | 4 +-- .../IoTSharp.Sdk.MQTT.csproj | 2 +- IoTSharp/Clients/RpcClient.cs | 4 +-- IoTSharp/Controllers/DevicesController.cs | 4 +-- IoTSharp/IoTSharp.csproj | 36 +++++++++---------- appsettings.Development.json | 2 +- docker-compose.yml | 16 ++++----- launchSettings.json | 15 ++++---- 14 files changed, 60 insertions(+), 57 deletions(-) diff --git a/IoTSharp.Data.InMemory/IoTSharp.Data.InMemory.csproj b/IoTSharp.Data.InMemory/IoTSharp.Data.InMemory.csproj index b90bff71..20fb5b5e 100644 --- a/IoTSharp.Data.InMemory/IoTSharp.Data.InMemory.csproj +++ b/IoTSharp.Data.InMemory/IoTSharp.Data.InMemory.csproj @@ -6,13 +6,13 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/IoTSharp.Data.MySQL/IoTSharp.Data.MySQL.csproj b/IoTSharp.Data.MySQL/IoTSharp.Data.MySQL.csproj index 25369d22..a1861359 100644 --- a/IoTSharp.Data.MySQL/IoTSharp.Data.MySQL.csproj +++ b/IoTSharp.Data.MySQL/IoTSharp.Data.MySQL.csproj @@ -8,12 +8,12 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/IoTSharp.Data.Oracle/IoTSharp.Data.Oracle.csproj b/IoTSharp.Data.Oracle/IoTSharp.Data.Oracle.csproj index 46f24abd..c2a1ab83 100644 --- a/IoTSharp.Data.Oracle/IoTSharp.Data.Oracle.csproj +++ b/IoTSharp.Data.Oracle/IoTSharp.Data.Oracle.csproj @@ -9,9 +9,9 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/IoTSharp.Data.PostgreSQL/IoTSharp.Data.PostgreSQL.csproj b/IoTSharp.Data.PostgreSQL/IoTSharp.Data.PostgreSQL.csproj index cac4a1ae..608dea40 100644 --- a/IoTSharp.Data.PostgreSQL/IoTSharp.Data.PostgreSQL.csproj +++ b/IoTSharp.Data.PostgreSQL/IoTSharp.Data.PostgreSQL.csproj @@ -8,12 +8,12 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/IoTSharp.Data.SqlServer/IoTSharp.Data.SqlServer.csproj b/IoTSharp.Data.SqlServer/IoTSharp.Data.SqlServer.csproj index 3383c432..97631f1b 100644 --- a/IoTSharp.Data.SqlServer/IoTSharp.Data.SqlServer.csproj +++ b/IoTSharp.Data.SqlServer/IoTSharp.Data.SqlServer.csproj @@ -9,7 +9,7 @@ - + diff --git a/IoTSharp.Data.Sqlite/IoTSharp.Data.Sqlite.csproj b/IoTSharp.Data.Sqlite/IoTSharp.Data.Sqlite.csproj index e8a746b2..9994b6ca 100644 --- a/IoTSharp.Data.Sqlite/IoTSharp.Data.Sqlite.csproj +++ b/IoTSharp.Data.Sqlite/IoTSharp.Data.Sqlite.csproj @@ -7,13 +7,13 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/IoTSharp.Data/IoTSharp.Data.csproj b/IoTSharp.Data/IoTSharp.Data.csproj index 17116512..4618c64e 100644 --- a/IoTSharp.Data/IoTSharp.Data.csproj +++ b/IoTSharp.Data/IoTSharp.Data.csproj @@ -6,8 +6,8 @@ - - + + diff --git a/IoTSharp.SDKs/IoTSharp.Sdk.MQTT/IoTSharp.Sdk.MQTT.csproj b/IoTSharp.SDKs/IoTSharp.Sdk.MQTT/IoTSharp.Sdk.MQTT.csproj index c4e9469f..7a7fead7 100644 --- a/IoTSharp.SDKs/IoTSharp.Sdk.MQTT/IoTSharp.Sdk.MQTT.csproj +++ b/IoTSharp.SDKs/IoTSharp.Sdk.MQTT/IoTSharp.Sdk.MQTT.csproj @@ -15,7 +15,7 @@ - + diff --git a/IoTSharp/Clients/RpcClient.cs b/IoTSharp/Clients/RpcClient.cs index 0af2d754..b834991a 100644 --- a/IoTSharp/Clients/RpcClient.cs +++ b/IoTSharp/Clients/RpcClient.cs @@ -21,7 +21,7 @@ namespace IoTSharp.Extensions private readonly ConcurrentDictionary> _waitingCalls = new ConcurrentDictionary>(); private readonly MqttClient _mqttClient; private readonly ILogger _logger; - private IMqttClientOptions _mqtt; + private MqttClientOptions _mqtt; private bool disposedValue; public RpcClient(MqttClient mqttClient, ILogger logger) @@ -33,7 +33,7 @@ namespace IoTSharp.Extensions - public RpcClient(IMqttClientOptions mqtt, Microsoft.Extensions.Logging.ILogger _logger) :this (new MQTTnet.MqttFactory().CreateMqttClient(), _logger) + public RpcClient(MqttClientOptions mqtt, Microsoft.Extensions.Logging.ILogger _logger) :this (new MQTTnet.MqttFactory().CreateMqttClient(), _logger) { _mqtt = mqtt; diff --git a/IoTSharp/Controllers/DevicesController.cs b/IoTSharp/Controllers/DevicesController.cs index b420d0a5..c4027229 100644 --- a/IoTSharp/Controllers/DevicesController.cs +++ b/IoTSharp/Controllers/DevicesController.cs @@ -42,7 +42,7 @@ namespace IoTSharp.Controllers public class DevicesController : ControllerBase { private readonly ApplicationDbContext _context; - private readonly IMqttClientOptions _mqtt; + private readonly MqttClientOptions _mqtt; private readonly UserManager _userManager; private readonly SignInManager _signInManager; private readonly ILogger _logger; @@ -52,7 +52,7 @@ namespace IoTSharp.Controllers private readonly ICapPublisher _queue; public DevicesController(UserManager userManager, - SignInManager signInManager, ILogger logger, MqttServer serverEx, ApplicationDbContext context, IMqttClientOptions mqtt, IStorage storage, IOptions options, ICapPublisher queue) + SignInManager signInManager, ILogger logger, MqttServer serverEx, ApplicationDbContext context, MqttClientOptions mqtt, IStorage storage, IOptions options, ICapPublisher queue) { _context = context; _mqtt = mqtt; diff --git a/IoTSharp/IoTSharp.csproj b/IoTSharp/IoTSharp.csproj index 7c55544c..d2bde231 100644 --- a/IoTSharp/IoTSharp.csproj +++ b/IoTSharp/IoTSharp.csproj @@ -88,15 +88,15 @@ - - - - + + + + - + @@ -116,23 +116,23 @@ - + - - - + + + - - - - - - - - + + + + + + + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/appsettings.Development.json b/appsettings.Development.json index 06f9a8df..27e80a28 100644 --- a/appsettings.Development.json +++ b/appsettings.Development.json @@ -13,7 +13,7 @@ "ConnectionStrings": { "IoTSharp": "Server=pgsql;Database=IoTSharp;Username=postgres;Password=future;Pooling=true;MaxPoolSize=1024;", "EventBusStore": "mongodb://root:kissme@mongodb:27017", - "TelemetryStorage": "http://influx:8086/?org=iotsharp&bucket=iotsharp-bucket&token=iotsharp-token&&latest=-72h", + "TelemetryStorage": "http://influx:8086/?org=iotsharp&bucket=iotsharp-bucket&token=koMHcRQ9PJVPIIb6zFyLt-06EkM_oy1jut08bH7f0BwC85LUO6zxgihKZUayHzyetapJEkxrlO0KwJ278dKpnA==&&latest=-72h", "EventBusMQ": "amqp://root:kissme@rabbitmq:5672" }, "JwtKey": "kissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissme", diff --git a/docker-compose.yml b/docker-compose.yml index 50ef2485..839b20d4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -116,14 +116,14 @@ services: networks: - iotsharp-network - influxdb_cli: - links: - - influx - image: quay.io/influxdb/influxdb:v2.0.4 - entrypoint: influx setup --bucket iotsharp-bucket -t iotsharp-token -o iotsharp --username=root --password=1-q2-w3-e4-r5-t --host=http://influx:8086 -f - restart: on-failure:20 - depends_on: - - influx + #influxdb_cli: + # links: + # - influx + # image: quay.io/influxdb/influxdb:v2.0.4 + # entrypoint: influx setup --bucket iotsharp-bucket -t koMHcRQ9PJVPIIb6zFyLt-06EkM_oy1jut08bH7f0BwC85LUO6zxgihKZUayHzyetapJEkxrlO0KwJ278dKpnA== -o iotsharp --username=root --password=1-q2-w3-e4-r5-t --host=http://influx:8086 -f + # restart: on-failure:20 + # depends_on: + # - influx networks: iotsharp-network: diff --git a/launchSettings.json b/launchSettings.json index 8965fd0e..a272ff19 100644 --- a/launchSettings.json +++ b/launchSettings.json @@ -2,15 +2,18 @@ "profiles": { "Docker Compose": { "commandName": "DockerCompose", + "composeLaunchAction": "LaunchBrowser", "composeLaunchServiceName": "iotsharp", + "composeLaunchUrl": "{Scheme}://localhost:{ServicePort}", + "commandVersion": "1.0", "serviceActions": { "iotsharp": "StartDebugging", "pgadmin": "StartWithoutDebugging", - "pgsql": "StartWithoutDebugging" - }, - "composeLaunchAction": "LaunchBrowser", - "commandVersion": "1.0", - "composeLaunchUrl": "{Scheme}://localhost:{ServicePort}" + "pgsql": "StartWithoutDebugging", + "influx": "StartWithoutDebugging", + "mongodb": "StartWithoutDebugging", + "rabbitmq": "StartWithoutDebugging" + } } } -} +} \ No newline at end of file -- GitLab