未验证 提交 cc4b14b7 编写于 作者: 麦壳饼's avatar 麦壳饼 提交者: GitHub

Merge pull request #564 from IoTSharp/dotnet6

upgrade to  .Net  6.0 
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="5.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Core" Version="5.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.12" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.12">
<PackageReference Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="6.0.2" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Core" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="5.0.12" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="5.0.12" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="6.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\IoTSharp.Data\IoTSharp.Data.csproj" />
......
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.MySql" Version="5.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.UI.MySql.Storage" Version="5.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.12">
<PackageReference Include="AspNetCore.HealthChecks.MySql" Version="6.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Core" Version="6.0.2" />
<PackageReference Include="AspNetCore.HealthChecks.UI.MySql.Storage" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="5.0.12" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="5.0.2" />
<PackageReference Include="EFCore.Sharding.MySql" Version="5.0.21" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="6.0.1" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.0" />
<PackageReference Include="EFCore.Sharding.MySql" Version="5.0.25" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql.NetTopologySuite" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
......
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.Oracle" Version="5.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="5.0.1" />
<PackageReference Include="EFCore.Sharding.Oracle" Version="5.0.21" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.12" />
<PackageReference Include="Oracle.EntityFrameworkCore" Version="5.21.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.12">
<PackageReference Include="AspNetCore.HealthChecks.Oracle" Version="6.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Core" Version="6.0.2" />
<PackageReference Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="6.0.2" />
<PackageReference Include="EFCore.Sharding.Oracle" Version="5.0.25" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.1" />
<PackageReference Include="Oracle.EntityFrameworkCore" Version="6.21.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
......
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.NpgSql" Version="5.0.2" />
<PackageReference Include="AspNetCore.HealthChecks.UI.PostgreSQL.Storage" Version="5.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Core" Version="5.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.12" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.12">
<PackageReference Include="AspNetCore.HealthChecks.NpgSql" Version="6.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.UI.PostgreSQL.Storage" Version="6.0.2" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Core" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="5.0.12" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.10" />
<PackageReference Include="EFCore.Sharding.PostgreSql" Version="5.0.21" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="6.0.1" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.2" />
<PackageReference Include="EFCore.Sharding.PostgreSql" Version="5.0.25" />
</ItemGroup>
<ItemGroup>
......
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="5.0.3" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Core" Version="5.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.UI.SqlServer.Storage" Version="5.0.1" />
<PackageReference Include="EFCore.Sharding.SqlServer" Version="5.0.21" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.12" />
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="6.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Core" Version="6.0.2" />
<PackageReference Include="AspNetCore.HealthChecks.UI.SqlServer.Storage" Version="6.0.2" />
<PackageReference Include="EFCore.Sharding.SqlServer" Version="5.0.25" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.1" />
</ItemGroup>
<ItemGroup>
......
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.Sqlite" Version="5.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Sqlite.Storage" Version="5.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Core" Version="5.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.12" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.12">
<PackageReference Include="AspNetCore.HealthChecks.Sqlite" Version="6.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Sqlite.Storage" Version="6.0.2" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Core" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.12" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="5.0.12" />
<PackageReference Include="EFCore.Sharding.SQLite" Version="5.0.21" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="6.0.1" />
<PackageReference Include="EFCore.Sharding.SQLite" Version="5.0.25" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\IoTSharp.Data\IoTSharp.Data.csproj" />
......
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.12" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.12" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="EFCore.Sharding" Version="5.0.21" />
<PackageReference Include="EFCore.Sharding" Version="5.0.25" />
</ItemGroup>
......
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CLanguage" Version="0.16.36" />
......@@ -11,12 +11,12 @@
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.0.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.0.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0" />
<PackageReference Include="IronPython" Version="3.4.0-alpha1" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
<PackageReference Include="NeoLua" Version="1.3.14" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
......
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net452;net5.0</TargetFrameworks>
<TargetFrameworks>net452;net5.0;net6.0</TargetFrameworks>
<RootNamespace>IoTSharp.Sdk.Http</RootNamespace>
<Product>IoTSharp</Product>
<Company>IoTSharp</Company>
......
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net452;netstandard2.0;netstandard2.1;net5.0</TargetFrameworks>
<TargetFrameworks>net452;netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks>
<Version>1.0.1</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
......
......@@ -20,11 +20,11 @@ namespace IoTSharp.TaskAction
}
public override TaskActionOutput Execute(TaskActionInput _input)
public override Task<TaskActionOutput> ExecuteAsync(TaskActionInput _input)
{
var msg = _input.DynamicInput;
var playload = System.Text.Encoding.Default.GetString( Convert.FromBase64String(msg.Payload));
return new TaskActionOutput() { Output=playload, DeviceId=_input.DeviceId};
return Task.FromResult( new TaskActionOutput() { Output=playload, DeviceId=_input.DeviceId});
}
}
}
......@@ -20,20 +20,20 @@ namespace IoTSharp.TaskAction
}
public override TaskActionOutput Execute(TaskActionInput input)
public override async Task<TaskActionOutput> ExecuteAsync(TaskActionInput input)
{
var config = JsonConvert.DeserializeObject<ModelExecutorConfig>(input.ExecutorConfig);
string contentType = "application/json";
var restclient = new RestClient(config.BaseUrl);
var request = new RestRequest(config.Url + (input.DeviceId == Guid.Empty ? "" : "/" + input.DeviceId), Method.POST);
var request = new RestRequest(config.Url + (input.DeviceId == Guid.Empty ? "" : "/" + input.DeviceId), Method.Post);
request.AddHeader("X-Access-Token",
config.Token);
request.RequestFormat = DataFormat.Json;
request.AddHeader("Content-Type", contentType);
request.AddHeader("cache-control", "no-cache");
request.AddJsonBody(JsonConvert.SerializeObject(new{ sosType="1", sosContent= input.Input, usingUserId= "" }));
var response = restclient.Execute(request);
var response = await restclient.ExecuteAsync(request);
if (response.StatusCode == HttpStatusCode.OK)
{
var result = JsonConvert.DeserializeObject<DeviceActionResult>(response.Content);
......
......@@ -2,13 +2,13 @@
using Newtonsoft.Json.Converters;
using System;
using System.Dynamic;
using System.Threading.Tasks;
namespace IoTSharp.TaskAction
{
public abstract class ITaskAction
{
public abstract TaskActionOutput Execute(TaskActionInput _input);
public abstract Task<TaskActionOutput> ExecuteAsync(TaskActionInput _input);
public IServiceProvider ServiceProvider { get; set; }
......
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="RestSharp" Version="106.13.0" />
<PackageReference Include="RestSharp" Version="107.0.0-preview.11" />
</ItemGroup>
<ItemGroup>
......
......@@ -25,18 +25,18 @@ namespace IoTSharp.TaskAction
}
public override TaskActionOutput Execute(TaskActionInput input)
public override Task<TaskActionOutput> ExecuteAsync(TaskActionInput input)
{
try
{
// var cache = this.ServiceProvider.GetService(typeof(IMemoryCache)) as IMemoryCache;
return SendData(input);
return SendData(input);
}
catch (Exception ex)
{
return new TaskActionOutput() { ExecutionInfo = ex.Message, ExecutionStatus = false, };
return Task.FromResult( new TaskActionOutput() { ExecutionInfo = ex.Message, ExecutionStatus = false });
}
}
......@@ -50,7 +50,7 @@ namespace IoTSharp.TaskAction
}
private TaskActionOutput SendData(TaskActionInput input)
private async Task<TaskActionOutput> SendData(TaskActionInput input)
{
try
{
......@@ -64,13 +64,13 @@ namespace IoTSharp.TaskAction
var dd = o.Properties().Select(c => new ParamObject { keyName = c.Name, value = JPropertyToObject(c.Value.First as JProperty) }).ToList();
string contentType = "application/json";
var restclient = new RestClient(config.BaseUrl);
var request = new RestRequest(config.Url + (input.DeviceId == Guid.Empty ? "" : "/" + input.DeviceId), Method.POST);
var request = new RestRequest(config.Url + (input.DeviceId == Guid.Empty ? "" : "/" + input.DeviceId), Method.Post);
request.AddHeader("X-Access-Token",
config.Token);
request.RequestFormat = DataFormat.Json;
request.AddHeader("cache-control", "no-cache");
request.AddJsonBody(JsonConvert.SerializeObject(dd));
var response = restclient.Execute(request);
var response = await restclient.ExecuteAsync(request);
if (response.StatusCode == HttpStatusCode.OK)
{
var result = JsonConvert.DeserializeObject<MessagePullResult>(response.Content);
......@@ -98,13 +98,13 @@ namespace IoTSharp.TaskAction
var dd = o.Properties().Select(c => new ParamObject { keyName = c.Name, value = JPropertyToObject(c) }).ToList();
string contentType = "application/json";
var restclient = new RestClient(config.BaseUrl);
var request = new RestRequest(config.Url + (input.DeviceId == Guid.Empty ? "" : "/" + input.DeviceId), Method.POST);
var request = new RestRequest(config.Url + (input.DeviceId == Guid.Empty ? "" : "/" + input.DeviceId), Method.Post);
request.AddHeader("X-Access-Token",
config.Token);
request.RequestFormat = DataFormat.Json;
request.AddHeader("cache-control", "no-cache");
request.AddJsonBody(JsonConvert.SerializeObject(dd));
var response = restclient.Execute(request);
var response = await restclient.ExecuteAsync(request);
if (response.StatusCode == HttpStatusCode.OK)
{
var result = JsonConvert.DeserializeObject<MessagePullResult>(response.Content);
......
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<IsPackable>false</IsPackable>
</PropertyGroup>
......@@ -13,9 +13,9 @@
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.7" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.7" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
</ItemGroup>
<ItemGroup>
......

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28803.156
# Visual Studio Version 17
VisualStudioVersion = 17.0.32014.148
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D5C97089-F896-436D-8E99-27B2E43BC65F}"
ProjectSection(SolutionItems) = preProject
......@@ -10,7 +10,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
buildimage.cmd = buildimage.cmd
buildimageqhse.cmd = buildimageqhse.cmd
LICENSE = LICENSE
package.json = package.json
README.md = README.md
README.zh.md = README.zh.md
roadmap.md = roadmap.md
......
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base
MAINTAINER Yanhong Ma 2020
RUN echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free" > /etc/apt/sources.list && \
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free" >> /etc/apt/sources.list && \
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free" >> /etc/apt/sources.list && \
FROM mcr.microsoft.com/dotnet/aspnet:6.0-bullseye-slim AS base
MAINTAINER Yanhong Ma 2022 <mysticboy@live.com>
RUN echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free" > /etc/apt/sources.list && \
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free" >> /etc/apt/sources.list && \
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian-security jessie/updates main contrib non-free" >> /etc/apt/sources.list && \
apt-get -y -q update && apt-get install -y -q apt-utils libgdiplus libc6-dev lsof net-tools wget sqlite3 python3 bashtop iputils-ping inetutils-tools libssl-dev libssl1.0.0 curl && \
apt-get -y -q update && apt-get install -y -q apt-utils libgdiplus libc6-dev lsof net-tools wget sqlite3 python3 iputils-ping inetutils-tools libssl-dev libssl1.0.0 curl && \
apt-get autoremove -y && apt-get clean && apt-get autoclean && rm /var/cache/apt/* -rf && \
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
#RUN curl -o TDengine-client.tar.gz "https://www.taosdata.com/download/download-gettingStarted.php?pkg=tdengine_linux&pkgName=TDengine-client-2.0.12.0-Linux-x64.tar.gz" && \
......@@ -27,12 +26,11 @@ EXPOSE 5684
EXPOSE 8080
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build
FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim AS build
RUN echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free" > /etc/apt/sources.list && \
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free" >> /etc/apt/sources.list && \
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free" >> /etc/apt/sources.list && \
RUN echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free" > /etc/apt/sources.list && \
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free" >> /etc/apt/sources.list && \
apt-get -y -q update && apt-get install -y -q git libssl-dev curl gnupg libcurl4 gcc g++ make gnupg2 build-essential wget && \
apt-get autoremove -y && apt-get clean && apt-get autoclean && rm /var/cache/apt/* -rf
......
......@@ -276,7 +276,7 @@ namespace IoTSharp.FlowRuleEngine
{
try
{
var result = executor.Execute(new TaskActionInput()
var result = await executor.ExecuteAsync(new TaskActionInput()
{
Input = taskoperation.Data,
DeviceId = deviceId,
......@@ -601,7 +601,7 @@ namespace IoTSharp.FlowRuleEngine
{
try
{
var result = executor.Execute(new TaskActionInput()
var result = await executor.ExecuteAsync(new TaskActionInput()
{
Input = data,
ExecutorConfig = flow.NodeProcessParams,
......@@ -609,7 +609,7 @@ namespace IoTSharp.FlowRuleEngine
});
obj = result.DynamicOutput;
obj = result.DynamicOutput;
}
catch (Exception ex)
{
......
......@@ -23,7 +23,7 @@ namespace IoTSharp.Handlers
_queue = queue;
}
public override TaskActionOutput Execute(TaskActionInput param)
public override Task<TaskActionOutput> ExecuteAsync(TaskActionInput param)
{
var result = new TaskActionOutput() { DynamicOutput = new { code = ApiCode.Success, msg = "OK" } };
try
......@@ -38,7 +38,7 @@ namespace IoTSharp.Handlers
{
result.DynamicOutput = new { code = ApiCode.Exception, msg = ex.Message };
}
return result;
return Task.FromResult( result);
}
}
}
......@@ -23,7 +23,7 @@ namespace IoTSharp.Handlers
_queue = queue;
}
public override TaskActionOutput Execute(TaskActionInput param)
public override Task<TaskActionOutput> ExecuteAsync(TaskActionInput param)
{
var result = new TaskActionOutput() { DynamicOutput = new { code = ApiCode.Success,msg="OK" } };
try
......@@ -38,7 +38,7 @@ namespace IoTSharp.Handlers
{
result.DynamicOutput = new { code = ApiCode.Exception, msg = ex.Message };
}
return result;
return Task.FromResult(result);
}
}
}
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
<IsPackable>false</IsPackable>
......@@ -49,24 +49,24 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.Kafka" Version="5.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.MongoDb" Version="5.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.Network" Version="5.0.4" />
<PackageReference Include="AspNetCore.HealthChecks.Rabbitmq" Version="5.0.2" />
<PackageReference Include="AspNetCore.HealthChecks.Redis" Version="5.0.2" />
<PackageReference Include="AspNetCore.HealthChecks.System" Version="5.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.UI" Version="5.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="5.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.Uris" Version="5.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.Kafka" Version="6.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.MongoDb" Version="6.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.Network" Version="5.0.4" />
<PackageReference Include="AspNetCore.HealthChecks.Rabbitmq" Version="6.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.Redis" Version="6.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.System" Version="6.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.UI" Version="6.0.2" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="6.0.2" />
<PackageReference Include="AspNetCore.HealthChecks.Uris" Version="6.0.2" />
<PackageReference Include="AspNetCore.HealthChecks.Network" Version="6.0.1" />
<PackageReference Include="CAP.Extensions" Version="1.0.32" />
<PackageReference Include="DotNetCore.CAP" Version="5.2.0" />
<PackageReference Include="DotNetCore.CAP.Dashboard" Version="5.2.0" />
<PackageReference Include="DotNetCore.CAP.InMemoryStorage" Version="5.2.0" />
<PackageReference Include="DotNetCore.CAP.Kafka" Version="5.2.0" />
<PackageReference Include="DotNetCore.CAP.MongoDB" Version="5.2.0" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" Version="5.2.0" />
<PackageReference Include="DotNetCore.CAP.PostgreSql" Version="5.2.0" />
<PackageReference Include="DotNetCore.CAP" Version="6.0.0" />
<PackageReference Include="DotNetCore.CAP.Dashboard" Version="6.0.0" />
<PackageReference Include="DotNetCore.CAP.InMemoryStorage" Version="6.0.0" />
<PackageReference Include="DotNetCore.CAP.Kafka" Version="6.0.0" />
<PackageReference Include="DotNetCore.CAP.MongoDB" Version="6.0.0" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" Version="6.0.0" />
<PackageReference Include="DotNetCore.CAP.PostgreSql" Version="6.0.0" />
<PackageReference Include="EasyCaching.Core" Version="1.4.1" />
<PackageReference Include="EasyCaching.InMemory" Version="1.4.1" />
<PackageReference Include="EasyCaching.LiteDB" Version="1.4.1" />
......@@ -84,53 +84,57 @@
<PackageReference Include="Maikebing.Data.Taos" Version="2.0.357" />
<PackageReference Include="Maikebing.HealthChecks.Taos" Version="2.0.357" />
<PackageReference Include="MaiKeBing.HostedService.ZeroMQ" Version="1.0.32" />
<PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="5.0.12" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.0.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Features" Version="4.0.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.0.1" />
<PackageReference Include="Microsoft.Extensions.Options" Version="5.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.11.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.2" />
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic.Features" Version="4.0.1" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.0.1" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.0.1" />
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.14.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.1" />
<PackageReference Include="MQTTnet" Version="3.1.1" />
<PackageReference Include="MQTTnet.AspNetCore" Version="3.1.1" />
<PackageReference Include="MQTTnet.AspNetCoreEx" Version="3.1.2" />
<PackageReference Include="MQTTnet.Extensions.Rpc" Version="3.1.1" />
<PackageReference Include="NetMQ" Version="4.0.1.6" />
<PackageReference Include="NSwag.AspNetCore" Version="13.14.8" />
<PackageReference Include="NSwag.AspNetCore" Version="13.15.5" />
<PackageReference Include="PinusDB" Version="1.0.10" />
<PackageReference Include="PinusDB.HealthChecks" Version="1.0.10" />
<PackageReference Include="ProxyKit" Version="2.3.4" />
<PackageReference Include="Quartz.Serialization.Json" Version="3.3.3" />
<PackageReference Include="RestSharp" Version="106.13.0" />
<PackageReference Include="RestSharp" Version="107.0.0-preview.11" />
<PackageReference Include="Rin" Version="2.6.0" />
<PackageReference Include="Rin.Mvc" Version="2.6.0" />
<PackageReference Include="RulesEngine" Version="3.4.0" />
<PackageReference Include="RulesEngine" Version="3.5.0" />
<PackageReference Include="Savorboard.CAP.InMemoryMessageQueue" Version="5.1.1" />
<PackageReference Include="Silkier" Version="1.0.424" />
<PackageReference Include="Silkier.AspNetCore" Version="1.0.424" />
<PackageReference Include="Silkier.EFCore" Version="1.0.424" />
<PackageReference Include="SilkierQuartz" Version="5.0.309" />
<PackageReference Include="SilkierQuartz.Plugins.RecentHistory" Version="5.0.309" />
<PackageReference Include="System.CodeDom" Version="5.0.0" />
<PackageReference Include="System.CodeDom" Version="6.0.0" />
<PackageReference Include="System.Collections" Version="4.3.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.14.1" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.15.0" />
<PackageReference Include="System.ServiceModel.Primitives" Version="4.9.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.12" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="5.0.12" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.WindowsServices" Version="5.0.12" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.12" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="5.0.1" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.WindowsServices" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="6.0.0" />
<PackageReference Include="MQTTnet.Extensions.ManagedClient" Version="3.1.1" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="5.0.12" />
<PackageReference Include="Microsoft.AspNetCore.ApiAuthorization.IdentityServer" Version="5.0.12" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="5.0.12" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.12" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="5.0.12" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.12" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.12" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.ApiAuthorization.IdentityServer" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.12">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
......
docker build -t registry.uixe.net/uixe/iotsharp . -f IoTSharp/Dockerfile
docker push registry.uixe.net/uixe/iotsharp
docker image prune -f
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册