diff --git a/Directory.Build.props b/Directory.Build.props
index daa6b1e1..838f9045 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -22,7 +22,9 @@
NetAdmin
git
https://github.com/nsnail/NetAdmin.git
- net9.0
+ net9.0
+ net9.0-windows
+ true
$(AssemblyName)
diff --git a/README.md b/README.md
index d48f4cd5..1d73c239 100644
--- a/README.md
+++ b/README.md
@@ -20,6 +20,7 @@ docker run -p 8080:8080 nsnail/netadmin
## 构建步骤
所涉软件均推荐下载zip/tar版本,解压即用,一键删除,不会污染系统环境:
+
```shell
# 1. 检查 dotnet sdk 版本 >=9.0.0
dotnet --list-sdks
diff --git a/build/code.quality.props b/build/code.quality.props
index 186dce60..cb044e42 100644
--- a/build/code.quality.props
+++ b/build/code.quality.props
@@ -15,7 +15,7 @@
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
@@ -23,7 +23,7 @@
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/build/copy.pkg.xml.comment.files.targets b/build/copy.pkg.xml.comment.files.targets
index 5f7a4f5d..93db426c 100644
--- a/build/copy.pkg.xml.comment.files.targets
+++ b/build/copy.pkg.xml.comment.files.targets
@@ -3,8 +3,8 @@
+ Include="$(NugetPackageRoot)\%(PackageReference.Identity)\%(PackageReference.Version)\%(PackageReference.CopyToOutputDirectory)"/>
-
+
\ No newline at end of file
diff --git a/build/prebuild.targets b/build/prebuild.targets
index 85f82d72..ab8f8f3c 100644
--- a/build/prebuild.targets
+++ b/build/prebuild.targets
@@ -1,12 +1,12 @@
-
+
+ StdOutEncoding="utf-8"/>
+ StdOutEncoding="utf-8"/>
\ No newline at end of file
diff --git a/nuget.config b/nuget.config
index b9d3b44f..3af4cd70 100644
--- a/nuget.config
+++ b/nuget.config
@@ -2,6 +2,6 @@
-
+
\ No newline at end of file
diff --git a/scripts/4.git.del.obsolete.tags.ps1 b/scripts/4.git.del.obsolete.tags.ps1
index 07be9670..7ad23355 100644
--- a/scripts/4.git.del.obsolete.tags.ps1
+++ b/scripts/4.git.del.obsolete.tags.ps1
@@ -1,4 +1,4 @@
#!/usr/bin/env pwsh
git push origin :refs/tags/$(git tag -l "*-*")
-git tag -d $(git tag -l "*-*")
\ No newline at end of file
+git tag -d $( git tag -l "*-*" )
\ No newline at end of file
diff --git a/src/backend/NetAdmin/NetAdmin.Application/Services/RepositoryService.cs b/src/backend/NetAdmin/NetAdmin.Application/Services/RepositoryService.cs
index 6e4b59c8..298af343 100644
--- a/src/backend/NetAdmin/NetAdmin.Application/Services/RepositoryService.cs
+++ b/src/backend/NetAdmin/NetAdmin.Application/Services/RepositoryService.cs
@@ -98,8 +98,8 @@ public abstract class RepositoryService(BasicReposit
TEntity newValue //
, List includeFields = null //
, List excludeFields = null //
- , Expression> whereExp = null //
- , string whereSql = null //
+ , Expression> whereExp = null //
+ , string whereSql = null //
, bool ignoreVersion = false)
{
// 默认匹配主键
diff --git a/src/backend/NetAdmin/NetAdmin.Domain/Extensions/ISelectExtensions.cs b/src/backend/NetAdmin/NetAdmin.Domain/Extensions/ISelectExtensions.cs
index 4b803557..99ffe554 100644
--- a/src/backend/NetAdmin/NetAdmin.Domain/Extensions/ISelectExtensions.cs
+++ b/src/backend/NetAdmin/NetAdmin.Domain/Extensions/ISelectExtensions.cs
@@ -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
;
diff --git a/src/backend/NetAdmin/NetAdmin.Domain/NetAdmin.Domain.csproj b/src/backend/NetAdmin/NetAdmin.Domain/NetAdmin.Domain.csproj
index fc5eb45d..72489a64 100644
--- a/src/backend/NetAdmin/NetAdmin.Domain/NetAdmin.Domain.csproj
+++ b/src/backend/NetAdmin/NetAdmin.Domain/NetAdmin.Domain.csproj
@@ -5,7 +5,7 @@
-
+
diff --git a/src/backend/NetAdmin/NetAdmin.Host/Startup.cs b/src/backend/NetAdmin/NetAdmin.Host/Startup.cs
index 1e1c1fec..0761a8ff 100644
--- a/src/backend/NetAdmin/NetAdmin.Host/Startup.cs
+++ b/src/backend/NetAdmin/NetAdmin.Host/Startup.cs
@@ -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;
diff --git a/src/backend/NetAdmin/NetAdmin.Infrastructure/Constant/Chars.cs b/src/backend/NetAdmin/NetAdmin.Infrastructure/Constant/Chars.cs
index 6610707a..2bcd6ad6 100644
--- a/src/backend/NetAdmin/NetAdmin.Infrastructure/Constant/Chars.cs
+++ b/src/backend/NetAdmin/NetAdmin.Infrastructure/Constant/Chars.cs
@@ -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)";
diff --git a/src/backend/NetAdmin/NetAdmin.Infrastructure/Enums/CountryCodes.cs b/src/backend/NetAdmin/NetAdmin.Infrastructure/Enums/CountryCodes.cs
index ae50ecb5..f5a5cc0c 100644
--- a/src/backend/NetAdmin/NetAdmin.Infrastructure/Enums/CountryCodes.cs
+++ b/src/backend/NetAdmin/NetAdmin.Infrastructure/Enums/CountryCodes.cs
@@ -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"
diff --git a/src/backend/NetAdmin/NetAdmin.Infrastructure/Utils/CaptchaImageHelper.cs b/src/backend/NetAdmin/NetAdmin.Infrastructure/Utils/CaptchaImageHelper.cs
index 1a1b38d9..82dfbc0c 100644
--- a/src/backend/NetAdmin/NetAdmin.Infrastructure/Utils/CaptchaImageHelper.cs
+++ b/src/backend/NetAdmin/NetAdmin.Infrastructure/Utils/CaptchaImageHelper.cs
@@ -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;
diff --git a/src/backend/NetAdmin/NetAdmin.SysComponent.Application/Services/Sys/CaptchaService.cs b/src/backend/NetAdmin/NetAdmin.SysComponent.Application/Services/Sys/CaptchaService.cs
index c46e2729..760b1509 100644
--- a/src/backend/NetAdmin/NetAdmin.SysComponent.Application/Services/Sys/CaptchaService.cs
+++ b/src/backend/NetAdmin/NetAdmin.SysComponent.Application/Services/Sys/CaptchaService.cs
@@ -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;
diff --git a/src/backend/NetAdmin/NetAdmin.SysComponent.Application/Services/Sys/DicCatalogService.cs b/src/backend/NetAdmin/NetAdmin.SysComponent.Application/Services/Sys/DicCatalogService.cs
index 1d59611e..a917057d 100644
--- a/src/backend/NetAdmin/NetAdmin.SysComponent.Application/Services/Sys/DicCatalogService.cs
+++ b/src/backend/NetAdmin/NetAdmin.SysComponent.Application/Services/Sys/DicCatalogService.cs
@@ -77,7 +77,7 @@ public sealed class DicCatalogService(BasicRepository rpo)
return
#if DBTYPE_SQLSERVER
(await UpdateReturnListAsync(req).ConfigureAwait(false)).FirstOrDefault()?.Adapt();
- #else
+ #else
await UpdateAsync(req).ConfigureAwait(false) > 0 ? await GetAsync(new QueryDicCatalogReq { Id = req.Id }).ConfigureAwait(false) : null;
#endif
}
diff --git a/src/backend/NetAdmin/NetAdmin.SysComponent.Application/Services/Sys/DocCatalogService.cs b/src/backend/NetAdmin/NetAdmin.SysComponent.Application/Services/Sys/DocCatalogService.cs
index 652b5204..8993274a 100644
--- a/src/backend/NetAdmin/NetAdmin.SysComponent.Application/Services/Sys/DocCatalogService.cs
+++ b/src/backend/NetAdmin/NetAdmin.SysComponent.Application/Services/Sys/DocCatalogService.cs
@@ -78,7 +78,7 @@ public sealed class DocCatalogService(BasicRepository rpo)
return
#if DBTYPE_SQLSERVER
(await UpdateReturnListAsync(req).ConfigureAwait(false)).FirstOrDefault()?.Adapt();
- #else
+ #else
await UpdateAsync(req).ConfigureAwait(false) > 0 ? await GetAsync(new QueryDocCatalogReq { Id = req.Id }).ConfigureAwait(false) : null;
#endif
}
diff --git a/src/backend/NetAdmin/NetAdmin.SysComponent.Application/Services/Sys/UserProfileService.cs b/src/backend/NetAdmin/NetAdmin.SysComponent.Application/Services/Sys/UserProfileService.cs
index b6a2a838..e6764bca 100644
--- a/src/backend/NetAdmin/NetAdmin.SysComponent.Application/Services/Sys/UserProfileService.cs
+++ b/src/backend/NetAdmin/NetAdmin.SysComponent.Application/Services/Sys/UserProfileService.cs
@@ -87,7 +87,7 @@ public sealed class UserProfileService(BasicRepository rp
return
#if DBTYPE_SQLSERVER
(await UpdateReturnListAsync(req.Adapt()).ConfigureAwait(false)).FirstOrDefault()?.Adapt();
- #else
+ #else
await UpdateAsync(req.Adapt()).ConfigureAwait(false) > 0
? await GetAsync(new QueryUserProfileReq { Id = req.Id }).ConfigureAwait(false)
: null;
@@ -136,13 +136,12 @@ public sealed class UserProfileService(BasicRepository rp
.ConfigureAwait(false);
return new PagedQueryRsp(req.Page, req.PageSize, total
- , list.ConvertAll(
- x => x.a.Adapt() with {
- NationArea = x.b.Adapt()
- , CompanyArea = x.c.Adapt()
- , HomeArea = x.d.Adapt()
- , EmergencyContactArea = x.e.Adapt()
- }));
+ , list.ConvertAll(x => x.a.Adapt() with {
+ NationArea = x.b.Adapt()
+ , CompanyArea = x.c.Adapt()
+ , HomeArea = x.d.Adapt()
+ , EmergencyContactArea = x.e.Adapt()
+ }));
}
///
diff --git a/src/backend/UnitTests/UnitTests.csproj b/src/backend/UnitTests/UnitTests.csproj
index cea0b2c7..9bb92db1 100644
--- a/src/backend/UnitTests/UnitTests.csproj
+++ b/src/backend/UnitTests/UnitTests.csproj
@@ -4,6 +4,6 @@
-
+
\ No newline at end of file