更新依赖库

This commit is contained in:
2248356998 qq.com
2025-07-15 03:56:46 +08:00
parent f11b7f7ab4
commit 2960c13ef1
7 changed files with 21 additions and 19 deletions

View File

@@ -1,9 +1,9 @@
<Project>
<PropertyGroup>
<PluginVersion>10.9.37</PluginVersion>
<ProPluginVersion>10.9.37</ProPluginVersion>
<DefaultVersion>10.9.37</DefaultVersion>
<PluginVersion>10.9.38</PluginVersion>
<ProPluginVersion>10.9.38</ProPluginVersion>
<DefaultVersion>10.9.38</DefaultVersion>
<AuthenticationVersion>2.9.18</AuthenticationVersion>
<SourceGeneratorVersion>10.9.18</SourceGeneratorVersion>
<NET8Version>8.0.18</NET8Version>

View File

@@ -10,8 +10,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="$(NET9Version)" />
<PackageReference Include="TouchSocket" Version="3.1.12" />
<PackageReference Include="TouchSocket.SerialPorts" Version="3.1.12" />
<PackageReference Include="TouchSocket" Version="3.1.13" />
<PackageReference Include="TouchSocket.SerialPorts" Version="3.1.13" />
</ItemGroup>
<ItemGroup>

View File

@@ -12,6 +12,7 @@ using System.Reflection;
using ThingsGateway.Common.Extension.Generic;
using ThingsGateway.NewLife.Extension;
using ThingsGateway.NewLife.Json.Extension;
using ThingsGateway.NewLife.Reflection;
namespace ThingsGateway.Gateway.Application;
@@ -92,7 +93,7 @@ public static class DynamicModelExtension
// 获取动态对象集合的类型
var type = value.GetType().GetGenericArguments().FirstOrDefault() ?? throw new ArgumentNullException(nameof(value));
var namesStr = Newtonsoft.Json.JsonConvert.SerializeObject(names);
var namesStr = names.ToSystemTextJsonString(false);
// 构建缓存键,包括属性名和类型信息
var cacheKey = $"{nameof(GetProperties)}-{namesStr}-{type.FullName}-{type.TypeHandle.Value}";
@@ -100,18 +101,19 @@ public static class DynamicModelExtension
var result = App.CacheService.GetOrAdd(cacheKey, a =>
{
// 获取动态对象类型中指定名称的属性信息
var properties = type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.GetProperty)
.Where(pi => names.Contains(pi.Name)) // 筛选出指定属性名的属性信息
.Where(pi => pi != null) // 过滤空属性信息
.AsEnumerable();
var allProperties = type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.GetProperty)
.ToDictionary(pi => pi.Name, pi => pi);
// 检查是否找到了所有指定名称的属性,如果没有找到,则抛出异常
if (names.Length != properties.Count())
var properties = names.Select(name =>
{
throw new InvalidOperationException($"Couldn't find properties on type{type.Name}{Environment.NewLine}names{namesStr}");
}
if (!allProperties.TryGetValue(name, out var pi))
throw new InvalidOperationException($"Couldn't find property '{name}' on type: {type.Name}");
return properties.ToArray(); // 返回属性信息集合
return pi;
}).ToArray();
return properties; // 返回属性信息集合
}, 3600); // 缓存有效期为3600秒
return result; // 返回属性信息集合

View File

@@ -10,8 +10,8 @@
<PackageReference Include="Riok.Mapperly" Version="4.2.1" ExcludeAssets="runtime" PrivateAssets="all" />
<PackageReference Include="Rougamo.Fody" Version="5.0.1" />
<PackageReference Include="System.Linq.Async" Version="6.0.3" />
<PackageReference Include="TouchSocket.Dmtp" Version="3.1.12" />
<PackageReference Include="TouchSocket.WebApi.Swagger" Version="3.1.12" />
<PackageReference Include="TouchSocket.Dmtp" Version="3.1.13" />
<PackageReference Include="TouchSocket.WebApi.Swagger" Version="3.1.13" />
<PackageReference Include="ThingsGateway.Authentication" Version="$(AuthenticationVersion)" />
<!--<ProjectReference Include="..\..\PluginPro\ThingsGateway.Authentication\ThingsGateway.Authentication.csproj" />-->

View File

@@ -51,7 +51,7 @@ public class SiemensS7Test
});
var task2 = Task.Run(async () =>
{
await Task.Delay(100).ConfigureAwait(false);
await Task.Delay(1000).ConfigureAwait(false);
bytes[12] = (byte)(((IClientChannel)(siemensS7Master.Channel)).WaitHandlePool.GetValue("m_currentSign").ToInt() - 1);
foreach (var item in bytes)
{

View File

@@ -12,7 +12,7 @@
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.1">
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

View File

@@ -16,7 +16,7 @@
<ItemGroup>
<PackageReference Include="TouchSocket.Dmtp" Version="3.1.12" />
<PackageReference Include="TouchSocket.Dmtp" Version="3.1.13" />
<PackageReference Include="Riok.Mapperly" Version="4.2.1" ExcludeAssets="runtime" PrivateAssets="all" />
</ItemGroup>