mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-06-16 00:43:21 +08:00
perf: ⚡ nuget update
This commit is contained in:
parent
585f8f4e43
commit
83deb735d0
@ -22,7 +22,9 @@
|
||||
<Product>NetAdmin</Product>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<RepositoryUrl>https://github.com/nsnail/NetAdmin.git</RepositoryUrl>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<TargetFramework Condition="'$(OS)' != 'Windows_NT'">net9.0</TargetFramework>
|
||||
<TargetFramework Condition="'$(OS)' == 'Windows_NT'">net9.0-windows</TargetFramework>
|
||||
<UseWindowsForms Condition="'$(OS)' == 'Windows_NT'">true</UseWindowsForms>
|
||||
<Title>$(AssemblyName)</Title>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
|
@ -20,6 +20,7 @@ docker run -p 8080:8080 nsnail/netadmin
|
||||
## 构建步骤
|
||||
|
||||
所涉软件均推荐下载zip/tar版本,解压即用,一键删除,不会污染系统环境:
|
||||
|
||||
```shell
|
||||
# 1. 检查 dotnet sdk 版本 >=9.0.0
|
||||
dotnet --list-sdks
|
||||
|
@ -15,7 +15,7 @@
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.14.2-alpha">
|
||||
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.14.15">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
@ -23,7 +23,7 @@
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.9.0.115408">
|
||||
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.10.0.116381">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
@ -3,8 +3,8 @@
|
||||
<ItemGroup>
|
||||
<PackageReferenceFiles
|
||||
Condition="%(PackageReference.CopyToOutputDirectory) != ''"
|
||||
Include="$(NugetPackageRoot)\%(PackageReference.Identity)\%(PackageReference.Version)\%(PackageReference.CopyToOutputDirectory)" />
|
||||
Include="$(NugetPackageRoot)\%(PackageReference.Identity)\%(PackageReference.Version)\%(PackageReference.CopyToOutputDirectory)"/>
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(PackageReferenceFiles)" DestinationFolder="$(OutDir)" />
|
||||
<Copy SourceFiles="@(PackageReferenceFiles)" DestinationFolder="$(OutDir)"/>
|
||||
</Target>
|
||||
</Project>
|
@ -1,12 +1,12 @@
|
||||
<Project>
|
||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||
<Exec Command="dotnet tool restore" StdOutEncoding="utf-8" />
|
||||
<Exec Command="dotnet tool restore" StdOutEncoding="utf-8"/>
|
||||
<Exec Condition="!Exists('$(SolutionDir)/assets/res/Ln.resx')" WorkingDirectory="$(SolutionDir)/scripts"
|
||||
Command="dotnet t4 ./gen.resx.tt -o ../assets/res/Ln.resx"
|
||||
StdOutEncoding="utf-8" />
|
||||
StdOutEncoding="utf-8"/>
|
||||
<Exec Condition="!Exists('$(SolutionDir)/dist/backend/$(ProjectName)/Ln.cs')"
|
||||
WorkingDirectory="$(SolutionDir)/scripts"
|
||||
Command="dotnet t4 ./gen.cs.tt -o ../dist/backend/$(ProjectName)/Ln.cs"
|
||||
StdOutEncoding="utf-8" />
|
||||
StdOutEncoding="utf-8"/>
|
||||
</Target>
|
||||
</Project>
|
@ -2,6 +2,6 @@
|
||||
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<add key="nuget.cdn.azure.cn" value="https://nuget.cdn.azure.cn/v3/index.json" />
|
||||
<add key="nuget.cdn.azure.cn" value="https://nuget.cdn.azure.cn/v3/index.json"/>
|
||||
</packageSources>
|
||||
</configuration>
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env pwsh
|
||||
|
||||
git push origin :refs/tags/$(git tag -l "*-*")
|
||||
git tag -d $(git tag -l "*-*")
|
||||
git tag -d $( git tag -l "*-*" )
|
@ -98,8 +98,8 @@ public abstract class RepositoryService<TEntity, TPrimary, TLogger>(BasicReposit
|
||||
TEntity newValue //
|
||||
, List<string> includeFields = null //
|
||||
, List<string> excludeFields = null //
|
||||
, Expression<Func<TEntity, bool>> whereExp = null //
|
||||
, string whereSql = null //
|
||||
, Expression<Func<TEntity, bool>> whereExp = null //
|
||||
, string whereSql = null //
|
||||
, bool ignoreVersion = false)
|
||||
{
|
||||
// 默认匹配主键
|
||||
|
@ -26,7 +26,7 @@ public static class ISelectExtensions
|
||||
where T1 : class
|
||||
{
|
||||
return me
|
||||
#if DBTYPE_SQLSERVER
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
;
|
||||
@ -40,7 +40,7 @@ public static class ISelectExtensions
|
||||
where T2 : class
|
||||
{
|
||||
return me
|
||||
#if DBTYPE_SQLSERVER
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
;
|
||||
@ -55,7 +55,7 @@ public static class ISelectExtensions
|
||||
where T3 : class
|
||||
{
|
||||
return me
|
||||
#if DBTYPE_SQLSERVER
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
;
|
||||
@ -71,7 +71,7 @@ public static class ISelectExtensions
|
||||
where T4 : class
|
||||
{
|
||||
return me
|
||||
#if DBTYPE_SQLSERVER
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
;
|
||||
@ -88,7 +88,7 @@ public static class ISelectExtensions
|
||||
where T5 : class
|
||||
{
|
||||
return me
|
||||
#if DBTYPE_SQLSERVER
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
;
|
||||
@ -106,7 +106,7 @@ public static class ISelectExtensions
|
||||
where T6 : class
|
||||
{
|
||||
return me
|
||||
#if DBTYPE_SQLSERVER
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
;
|
||||
|
@ -5,7 +5,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CronExpressionDescriptor" Version="2.41.0"/>
|
||||
<PackageReference Include="Cronos" Version="0.10.0"/>
|
||||
<PackageReference Include="Cronos" Version="0.11.0"/>
|
||||
<PackageReference Include="NetAdmin.CsvHelper" Version="1.0.0"/>
|
||||
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14"/>
|
||||
</ItemGroup>
|
||||
|
@ -1,5 +1,9 @@
|
||||
using Spectre.Console;
|
||||
using Spectre.Console.Cli;
|
||||
#if WINDOWS
|
||||
using Color = Spectre.Console.Color;
|
||||
using Panel = Spectre.Console.Panel;
|
||||
#endif
|
||||
|
||||
namespace NetAdmin.Host;
|
||||
|
||||
|
@ -15,9 +15,9 @@ public static class Chars
|
||||
public const string FLG_CONTEXT_USER_ID = nameof(FLG_CONTEXT_USER_ID);
|
||||
public const string FLG_CONTEXT_USER_INFO = nameof(FLG_CONTEXT_USER_INFO);
|
||||
public const string FLG_CRON_PER_SECS = "* * * * * *";
|
||||
public const string FLG_DB_EXCEPTION_IDX = "idx_";
|
||||
public const string FLG_DB_EXCEPTION_PRIMARY_KEY_CONFLICT = "PRIMARY KEY";
|
||||
public const string FLG_DB_EXCEPTION_UNIQUE_CONSTRAINT_CONFLICT = "UNIQUE constraint";
|
||||
public const string FLG_DB_EXCEPTION_IDX = "idx_";
|
||||
public const string FLG_DB_FIELD_TYPE_NVARCHAR = "nvarchar";
|
||||
public const string FLG_DB_FIELD_TYPE_NVARCHAR_1022 = "nvarchar(1022)";
|
||||
public const string FLG_DB_FIELD_TYPE_NVARCHAR_127 = "nvarchar(127)";
|
||||
|
@ -330,7 +330,7 @@ public enum CountryCodes
|
||||
"United States", "USA", "Vereinigte Staaten von Amerika", "États-Unis", "Estados Unidos", "アメリカ合衆国", "Verenigde Staten"
|
||||
, "Соединенные Штаты Америки", "美国"
|
||||
], IsPreferred = true
|
||||
, Timezones = [
|
||||
, Timezones = [
|
||||
"America/Adak,-1000", "America/Anchorage,-0900", "America/Boise,-0700", "America/Chicago,-0600", "America/Denver,-0700"
|
||||
, "America/Detroit,-0500", "America/Indiana/Indianapolis,-0500", "America/Indiana/Knox,-0600", "America/Indiana/Marengo,-0500"
|
||||
, "America/Indiana/Petersburg,-0500", "America/Indiana/Tell_City,-0600", "America/Indiana/Vevay,-0500"
|
||||
|
@ -4,6 +4,11 @@ using SixLabors.ImageSharp.Drawing.Processing;
|
||||
using SixLabors.ImageSharp.Formats.Png;
|
||||
using SixLabors.ImageSharp.PixelFormats;
|
||||
using SixLabors.ImageSharp.Processing;
|
||||
#if WINDOWS
|
||||
using Image = SixLabors.ImageSharp.Image;
|
||||
using Point = SixLabors.ImageSharp.Point;
|
||||
using Size = SixLabors.ImageSharp.Size;
|
||||
#endif
|
||||
|
||||
namespace NetAdmin.Infrastructure.Utils;
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
using NetAdmin.Domain.Dto.Sys.Captcha;
|
||||
using SixLabors.ImageSharp;
|
||||
using Yitter.IdGenerator;
|
||||
#if WINDOWS
|
||||
using Size = SixLabors.ImageSharp.Size;
|
||||
#endif
|
||||
|
||||
namespace NetAdmin.SysComponent.Application.Services.Sys;
|
||||
|
||||
|
@ -77,7 +77,7 @@ public sealed class DicCatalogService(BasicRepository<Sys_DicCatalog, long> rpo)
|
||||
return
|
||||
#if DBTYPE_SQLSERVER
|
||||
(await UpdateReturnListAsync(req).ConfigureAwait(false)).FirstOrDefault()?.Adapt<QueryDicCatalogRsp>();
|
||||
#else
|
||||
#else
|
||||
await UpdateAsync(req).ConfigureAwait(false) > 0 ? await GetAsync(new QueryDicCatalogReq { Id = req.Id }).ConfigureAwait(false) : null;
|
||||
#endif
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ public sealed class DocCatalogService(BasicRepository<Sys_DocCatalog, long> rpo)
|
||||
return
|
||||
#if DBTYPE_SQLSERVER
|
||||
(await UpdateReturnListAsync(req).ConfigureAwait(false)).FirstOrDefault()?.Adapt<QueryDocCatalogRsp>();
|
||||
#else
|
||||
#else
|
||||
await UpdateAsync(req).ConfigureAwait(false) > 0 ? await GetAsync(new QueryDocCatalogReq { Id = req.Id }).ConfigureAwait(false) : null;
|
||||
#endif
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ public sealed class UserProfileService(BasicRepository<Sys_UserProfile, long> rp
|
||||
return
|
||||
#if DBTYPE_SQLSERVER
|
||||
(await UpdateReturnListAsync(req.Adapt<Sys_UserProfile>()).ConfigureAwait(false)).FirstOrDefault()?.Adapt<QueryUserProfileRsp>();
|
||||
#else
|
||||
#else
|
||||
await UpdateAsync(req.Adapt<Sys_UserProfile>()).ConfigureAwait(false) > 0
|
||||
? await GetAsync(new QueryUserProfileReq { Id = req.Id }).ConfigureAwait(false)
|
||||
: null;
|
||||
@ -136,13 +136,12 @@ public sealed class UserProfileService(BasicRepository<Sys_UserProfile, long> rp
|
||||
.ConfigureAwait(false);
|
||||
|
||||
return new PagedQueryRsp<QueryUserProfileRsp>(req.Page, req.PageSize, total
|
||||
, list.ConvertAll(
|
||||
x => x.a.Adapt<QueryUserProfileRsp>() with {
|
||||
NationArea = x.b.Adapt<QueryDicContentRsp>()
|
||||
, CompanyArea = x.c.Adapt<QueryDicContentRsp>()
|
||||
, HomeArea = x.d.Adapt<QueryDicContentRsp>()
|
||||
, EmergencyContactArea = x.e.Adapt<QueryDicContentRsp>()
|
||||
}));
|
||||
, list.ConvertAll(x => x.a.Adapt<QueryUserProfileRsp>() with {
|
||||
NationArea = x.b.Adapt<QueryDicContentRsp>()
|
||||
, CompanyArea = x.c.Adapt<QueryDicContentRsp>()
|
||||
, HomeArea = x.d.Adapt<QueryDicContentRsp>()
|
||||
, EmergencyContactArea = x.e.Adapt<QueryDicContentRsp>()
|
||||
}));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -4,6 +4,6 @@
|
||||
<ProjectReference Include="../NetAdmin/NetAdmin.Tests/NetAdmin.Tests.csproj"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.0-preview-25107-01"/>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.0"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
Loading…
x
Reference in New Issue
Block a user