Skip to content

Commit

Permalink
命名空间重新引用。
Browse files Browse the repository at this point in the history
  • Loading branch information
maikebing committed Sep 17, 2022
1 parent d9ef636 commit 3f86415
Show file tree
Hide file tree
Showing 69 changed files with 202 additions and 564 deletions.
2 changes: 1 addition & 1 deletion IoTSharp.Contracts/AlarmDto.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using IoTSharp.Data;

using System;

namespace IoTSharp.Contracts
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using IoTSharp.Data;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace IoTSharp.Dtos
namespace IoTSharp.Contracts
{
public class ApiResult
{
Expand Down
5 changes: 2 additions & 3 deletions IoTSharp.Contracts/AppSettings.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@

using IoTSharp.Data;

using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace IoTSharp
namespace IoTSharp.Contracts
{
[JsonConverter(typeof(StringEnumConverter))]
public enum TelemetryStorage
Expand Down
3 changes: 1 addition & 2 deletions IoTSharp.Contracts/AssetDto.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using IoTSharp.Data;


namespace IoTSharp.Contracts
{
public class AssetDto
Expand Down
2 changes: 1 addition & 1 deletion IoTSharp.Contracts/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Security.Claims;
using System.Threading.Tasks;

namespace IoTSharp.Data
namespace IoTSharp.Contracts
{
public static class IoTSharpClaimTypes
{
Expand Down
2 changes: 1 addition & 1 deletion IoTSharp.Contracts/MqttBrokerSetting.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Security.Authentication;
using System.Security.Cryptography.X509Certificates;

namespace IoTSharp
namespace IoTSharp.Contracts
{
public class MqttBrokerSetting
{
Expand Down
2 changes: 1 addition & 1 deletion IoTSharp.Contracts/TelemetryDataDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public class TelemetryDataDto
public string KeyName { get; set; }

public DateTime DateTime { get; set; }
public Data.DataType DataType { get; set; }
public DataType DataType { get; set; }
public object Value { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

using EFCore.Sharding;
using IoTSharp;
using IoTSharp.Contracts;
using IoTSharp.Data;
using IoTSharp.Data.MySQL;
using Microsoft.EntityFrameworkCore;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

using EFCore.Sharding;
using IoTSharp;
using IoTSharp.Contracts;
using IoTSharp.Data;
using IoTSharp.Data.Oracle;
using Microsoft.EntityFrameworkCore;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

using EFCore.Sharding;
using IoTSharp;
using IoTSharp.Contracts;
using IoTSharp.Data;
using IoTSharp.Data.PostgreSQL;
using Microsoft.EntityFrameworkCore;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

using EFCore.Sharding;
using IoTSharp;
using IoTSharp.Contracts;
using IoTSharp.Data;
using IoTSharp.Data.SqlServer;
using Microsoft.EntityFrameworkCore;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

using EFCore.Sharding;
using IoTSharp;
using IoTSharp.Contracts;
using IoTSharp.Data;
using IoTSharp.Data.Sqlite;
using Microsoft.EntityFrameworkCore;
Expand Down
4 changes: 2 additions & 2 deletions IoTSharp.Data.TimeSeries/InfluxDBStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ private async Task<List<TelemetryDataDto>> FluxToDtoAsync(Task< List<FluxTable>>
});
return dt;
}
Data.DataType InfluxTypeToIoTSharpType(string _itype)
Contracts.DataType InfluxTypeToIoTSharpType(string _itype)
{
Data.DataType data = DataType.String;
Contracts.DataType data = DataType.String;
switch (_itype)
{
case "long":
Expand Down
24 changes: 12 additions & 12 deletions IoTSharp.Data.TimeSeries/IoTDBStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,29 +116,29 @@ private dynamic GetIotSharpValue(object v,string iotDataType)
return result;

}
private IoTSharp.Data.DataType GetIoTSharpDataType(string iotDataType)
private DataType GetIoTSharpDataType(string iotDataType)
{
if (iotDataType.ToUpper() == "DOUBLE")
return Data.DataType.Double;
return DataType.Double;
else if (iotDataType.ToUpper() == "FLOAT")
{
return Data.DataType.Double;
return DataType.Double;
}
else if (iotDataType.ToUpper() == "TEXT")
{
return Data.DataType.String;
return DataType.String;
}
else if (iotDataType.ToUpper() == "INT64")
{
return Data.DataType.Long;
return DataType.Long;
}
else if (iotDataType.ToUpper() == "INT32")
{
return Data.DataType.Long;
return DataType.Long;
}
else if (iotDataType.ToUpper() == "BOOLEAN")
{
return Data.DataType.Boolean;
return DataType.Boolean;
}
else
throw new Exception($"不支持的IotDB数据类型:{iotDataType}");
Expand Down Expand Up @@ -290,22 +290,22 @@ public async Task<List<TelemetryDataDto>> GetTelemetryLatest(Guid deviceId, stri
object _value = null;
bool _hasvalue = true; switch (tdata.Type)
{
case IoTSharp.Data.DataType.Boolean:
case DataType.Boolean:
_value = tdata.Value_Boolean;
_hasvalue = tdata.Value_Boolean.HasValue;
break;
case IoTSharp.Data.DataType.String:
case DataType.String:
_value = tdata.Value_String;
break;
case IoTSharp.Data.DataType.Long:
case DataType.Long:
_value = tdata.Value_Long;
_hasvalue = tdata.Value_Long.HasValue;
break;
case IoTSharp.Data.DataType.Double:
case DataType.Double:
_value = tdata.Value_Double;
_hasvalue = tdata.Value_Double.HasValue;
break;
case IoTSharp.Data.DataType.DateTime:
case DataType.DateTime:
_value = tdata.Value_DateTime;
_hasvalue = tdata.Value_DateTime.HasValue;
break;
Expand Down
3 changes: 2 additions & 1 deletion IoTSharp.Data.TimeSeries/TimescaleDBStorage.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using IoTSharp.Data;
using IoTSharp.Contracts;
using IoTSharp.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
Expand Down
2 changes: 1 addition & 1 deletion IoTSharp.TaskActions/TelemetryArrayPullExcutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public class TelemetryData
[JsonProperty("dateTime")]
public DateTime dateTime { get; set; }
[JsonProperty("dataType")]
public Data.DataType dataType { get; set; }
public Contracts.DataType dataType { get; set; }
[JsonProperty("value")]
public object value { get; set; }

Expand Down
6 changes: 6 additions & 0 deletions IoTSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IoTSharp.Data.ClickHouse",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MQTTnet.AspNetCore.Routing.Tests", "MQTTnet.AspNetCore.Routing\Tests\MQTTnet.AspNetCore.Routing.Tests\MQTTnet.AspNetCore.Routing.Tests.csproj", "{C91178D4-A12A-4E5B-8EFC-34B01343CBDB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IoTSharp.EventBus", "IoTSharp.EventBus\IoTSharp.EventBus.csproj", "{03819A42-0429-497A-AF9F-0A63333AB0BC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -213,6 +215,10 @@ Global
{C91178D4-A12A-4E5B-8EFC-34B01343CBDB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C91178D4-A12A-4E5B-8EFC-34B01343CBDB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C91178D4-A12A-4E5B-8EFC-34B01343CBDB}.Release|Any CPU.Build.0 = Release|Any CPU
{03819A42-0429-497A-AF9F-0A63333AB0BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{03819A42-0429-497A-AF9F-0A63333AB0BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{03819A42-0429-497A-AF9F-0A63333AB0BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{03819A42-0429-497A-AF9F-0A63333AB0BC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
1 change: 1 addition & 0 deletions IoTSharp/Controllers/AccountController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using Microsoft.Extensions.Options;

using Jdenticon.AspNetCore;
using IoTSharp.Contracts;

namespace IoTSharp.Controllers
{
Expand Down
3 changes: 2 additions & 1 deletion IoTSharp/Controllers/AuthorizedKeysController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using IoTSharp.Data;
using IoTSharp.Contracts;
using IoTSharp.Data;
using IoTSharp.Dtos;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
Expand Down
1 change: 1 addition & 0 deletions IoTSharp/Controllers/CaptchaController.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Castle.Components.DictionaryAdapter;
using EasyCaching.Core;
using IoTSharp.Contracts;
using IoTSharp.Data;
using IoTSharp.Dtos;
using IoTSharp.Models;
Expand Down
3 changes: 2 additions & 1 deletion IoTSharp/Controllers/CustomersController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using IoTSharp.Controllers.Models;
using IoTSharp.Contracts;
using IoTSharp.Controllers.Models;
using IoTSharp.Data;
using IoTSharp.Dtos;
using IoTSharp.Extensions;
Expand Down
3 changes: 2 additions & 1 deletion IoTSharp/Controllers/DeviceModelController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using IoTSharp.Controllers.Models;
using IoTSharp.Contracts;
using IoTSharp.Controllers.Models;
using IoTSharp.Data;
using IoTSharp.Dtos;
using IoTSharp.Models;
Expand Down
2 changes: 2 additions & 0 deletions IoTSharp/Controllers/DevicesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using IoTSharp.Contracts;
using IoTSharp.Controllers.Models;
using IoTSharp.Data;
using IoTSharp.Data.Extensions;
using IoTSharp.Dtos;
using IoTSharp.Extensions;
using IoTSharp.FlowRuleEngine;
Expand Down Expand Up @@ -280,6 +281,7 @@ public async Task<ApiResult<DeviceIdentity>> CreateX509Identity(Guid deviceId)
[HttpGet("{deviceId}/DownloadCertificates")]
[ProducesResponseType(typeof(ApiResult), StatusCodes.Status404NotFound)]
[ProducesResponseType(typeof(ApiResult), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(ApiResult), StatusCodes.Status200OK)]
public ActionResult DownloadCertificates(Guid deviceId)
{
try
Expand Down
3 changes: 2 additions & 1 deletion IoTSharp/Controllers/DictionaryController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using IoTSharp.Controllers.Models;
using IoTSharp.Contracts;
using IoTSharp.Controllers.Models;
using IoTSharp.Data;
using IoTSharp.Dtos;
using IoTSharp.Models;
Expand Down
1 change: 1 addition & 0 deletions IoTSharp/Controllers/DictionaryGroupController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using IoTSharp.Models;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Authorization;
using IoTSharp.Contracts;

namespace IoTSharp.Controllers
{
Expand Down
3 changes: 2 additions & 1 deletion IoTSharp/Controllers/DynamicFormInfoController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using IoTSharp.Controllers.Models;
using IoTSharp.Contracts;
using IoTSharp.Controllers.Models;
using IoTSharp.Data;
using IoTSharp.Dtos;
using IoTSharp.Models;
Expand Down
3 changes: 2 additions & 1 deletion IoTSharp/Controllers/DynamicFormRemoteApiController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using IoTSharp.Data;
using IoTSharp.Contracts;
using IoTSharp.Data;
using IoTSharp.Dtos;
using IoTSharp.Models.FormFieldTypes;
using Microsoft.AspNetCore.Authorization;
Expand Down
1 change: 1 addition & 0 deletions IoTSharp/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using IoTSharp.Data;
using IoTSharp.Dtos;
using Microsoft.AspNetCore.Authorization;
using IoTSharp.Contracts;

namespace IoTSharp.Controllers
{
Expand Down
Loading

0 comments on commit 3f86415

Please sign in to comment.