22 Commits

Author SHA1 Message Date
tk
81ea13fa9d chore(release): 2.2.1 2024-12-04 16:36:12 +08:00
tk
4eecc0b4ce fix: 🐛 version lock
[skip ci]
2024-12-04 16:35:20 +08:00
tk
01058ba728 fix: 🐛 version 条件重复指定 2024-12-03 11:05:27 +08:00
a6f6a8f0a3 perf: nuget update 2024-11-29 22:42:47 +08:00
4f12b5064d Update README.md 2024-11-29 22:21:30 +08:00
2acf88cad1 style: 💄 code format 2024-11-29 22:13:01 +08:00
tk
180119019c chore: 🔨 sys_Menu.json
[skip ci]
2024-11-29 18:22:07 +08:00
tk
f5203782aa chore: 🔨 iSelect 扩展方法增强
[skip ci]
2024-11-29 17:44:13 +08:00
tk
4874a58eee perf: nuget update 2024-11-29 17:40:19 +08:00
tk
b4ca6d5626 style: 💄 解决方案文件段落整理
[skip ci]
2024-11-29 11:16:26 +08:00
tk
63d7a3ed4a refactor: ♻️ iSelect 扩展方法
[skip ci]
2024-11-29 11:08:37 +08:00
ef2a0c3280 fix: 🐛 editUser 2024-11-29 09:28:05 +08:00
c69655e353 build: 📦 refs update
[skip ci]
2024-11-29 00:35:42 +08:00
f0e1155ee8 build: 📦 修复项目引用路径问题
[skip ci]
2024-11-29 00:30:10 +08:00
03745ff767 build: 📦 更新子模块
[skip ci]
2024-11-28 23:24:03 +08:00
ee94d47551 refactor: ♻️ freeSql 重编译版本
[skip ci]
2024-11-28 23:18:25 +08:00
155deedd15 refactor: ♻️ 减少一些条件编译语句 (#229)
[skip ci]

Co-authored-by: tk <fiyne1a@dingtalk.com>
2024-11-28 15:51:09 +08:00
a0a04590c9 build: 📦 rename.csx (#228)
[skip ci]

Co-authored-by: tk <fiyne1a@dingtalk.com>
2024-11-28 10:27:47 +08:00
c88c8d293d fix: 🐛 按钮文字提示 (#227)
Co-authored-by: tk <fiyne1a@dingtalk.com>
2024-11-27 18:38:52 +08:00
7501138e31 chore: 🔨 界面优化 (#226)
Co-authored-by: tk <fiyne1a@dingtalk.com>
2024-11-27 17:58:38 +08:00
cb75d19202 Merge pull request #225 from nsnail/release
chore(release): 2.2.0
2024-11-27 16:54:46 +08:00
tk
e8a2d27c00 chore(release): 2.2.0 2024-11-27 16:54:27 +08:00
132 changed files with 709 additions and 946 deletions

View File

@ -0,0 +1 @@
drone workflows

6
.gitmodules vendored
View File

@ -4,6 +4,6 @@
[submodule "refs/ns-ext"] [submodule "refs/ns-ext"]
path = refs/ns-ext path = refs/ns-ext
url = https://github.com/nsnail/ns-ext.git url = https://github.com/nsnail/ns-ext.git
[submodule "refs/FreeSql"] [submodule "refs/NetAdmin.FreeSql"]
path = refs/FreeSql path = refs/NetAdmin.FreeSql
url = https://github.com/nsnail/FreeSql.git url = https://github.com/nsnail/NetAdmin.FreeSql.git

View File

@ -2,6 +2,46 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
### [2.2.1](https://github.com/nsnail/NetAdmin/compare/v2.1.0...v2.2.1) (2024-12-04)
### Features
* ✨ 菜单复制 ([#214](https://github.com/nsnail/NetAdmin/issues/214)) ([81d9b0b](https://github.com/nsnail/NetAdmin/commit/81d9b0b3bb280661ceffa61aa6e9d612fb7ec52c))
* ✨ 文档管理 ([#221](https://github.com/nsnail/NetAdmin/issues/221)) ([7ed3040](https://github.com/nsnail/NetAdmin/commit/7ed30406c9f721a12f0b756ec8884a1882242b93))
* ✨ select-filter badge icon ([#217](https://github.com/nsnail/NetAdmin/issues/217)) ([4d857f1](https://github.com/nsnail/NetAdmin/commit/4d857f1861b1256980e7cc59e2ab6a5f7d966da2))
### Bug Fixes
* 🐛 按钮文字提示 ([#227](https://github.com/nsnail/NetAdmin/issues/227)) ([c88c8d2](https://github.com/nsnail/NetAdmin/commit/c88c8d293d44f2707f3b5232e6a40a141af9981c))
* 🐛 导出界面报错 ([#213](https://github.com/nsnail/NetAdmin/issues/213)) ([ef2f0de](https://github.com/nsnail/NetAdmin/commit/ef2f0de095e314f34bec21c0a2ccdb51423a163b))
* 🐛 导出文件的responseType ([#205](https://github.com/nsnail/NetAdmin/issues/205)) ([841a419](https://github.com/nsnail/NetAdmin/commit/841a4195e77aa96e3c6c72626c1add3f71a310aa))
* 🐛 请求日志批量插入,漏写了登录日志 ([#210](https://github.com/nsnail/NetAdmin/issues/210)) ([6c71c74](https://github.com/nsnail/NetAdmin/commit/6c71c74a27617c7d0530a5f6eaff650ecfd4eaec))
* 🐛 用户选择器报错 ([#220](https://github.com/nsnail/NetAdmin/issues/220)) ([71bfdaa](https://github.com/nsnail/NetAdmin/commit/71bfdaafa8176cf686b03244ee758de058080a71))
* 🐛 editUser ([ef2a0c3](https://github.com/nsnail/NetAdmin/commit/ef2a0c3280532ac24889279e4780a1b1a2561a6b))
* 🐛 idd ([#208](https://github.com/nsnail/NetAdmin/issues/208)) ([4e9f605](https://github.com/nsnail/NetAdmin/commit/4e9f605ea2cc6fe394068cfea5638e51920b9096))
* 🐛 version 条件重复指定 ([01058ba](https://github.com/nsnail/NetAdmin/commit/01058ba7288bcc645f66de2f78e1d659d55333cf))
* 🐛 version lock ([4eecc0b](https://github.com/nsnail/NetAdmin/commit/4eecc0b4ce09f620f83109949e4c2b67b7f8ba90))
## [2.2.0](https://github.com/nsnail/NetAdmin/compare/v2.1.0...v2.2.0) (2024-11-27)
### Features
* ✨ 菜单复制 ([#214](https://github.com/nsnail/NetAdmin/issues/214)) ([81d9b0b](https://github.com/nsnail/NetAdmin/commit/81d9b0b3bb280661ceffa61aa6e9d612fb7ec52c))
* ✨ 文档管理 ([#221](https://github.com/nsnail/NetAdmin/issues/221)) ([7ed3040](https://github.com/nsnail/NetAdmin/commit/7ed30406c9f721a12f0b756ec8884a1882242b93))
* ✨ select-filter badge icon ([#217](https://github.com/nsnail/NetAdmin/issues/217)) ([4d857f1](https://github.com/nsnail/NetAdmin/commit/4d857f1861b1256980e7cc59e2ab6a5f7d966da2))
### Bug Fixes
* 🐛 导出界面报错 ([#213](https://github.com/nsnail/NetAdmin/issues/213)) ([ef2f0de](https://github.com/nsnail/NetAdmin/commit/ef2f0de095e314f34bec21c0a2ccdb51423a163b))
* 🐛 导出文件的responseType ([#205](https://github.com/nsnail/NetAdmin/issues/205)) ([841a419](https://github.com/nsnail/NetAdmin/commit/841a4195e77aa96e3c6c72626c1add3f71a310aa))
* 🐛 请求日志批量插入,漏写了登录日志 ([#210](https://github.com/nsnail/NetAdmin/issues/210)) ([6c71c74](https://github.com/nsnail/NetAdmin/commit/6c71c74a27617c7d0530a5f6eaff650ecfd4eaec))
* 🐛 用户选择器报错 ([#220](https://github.com/nsnail/NetAdmin/issues/220)) ([71bfdaa](https://github.com/nsnail/NetAdmin/commit/71bfdaafa8176cf686b03244ee758de058080a71))
* 🐛 idd ([#208](https://github.com/nsnail/NetAdmin/issues/208)) ([4e9f605](https://github.com/nsnail/NetAdmin/commit/4e9f605ea2cc6fe394068cfea5638e51920b9096))
## [2.1.0](https://github.com/nsnail/NetAdmin/compare/v2.0.0...v2.1.0) (2024-11-15) ## [2.1.0](https://github.com/nsnail/NetAdmin/compare/v2.0.0...v2.1.0) (2024-11-15)

View File

@ -10,8 +10,8 @@
<Authors>nsnail</Authors> <Authors>nsnail</Authors>
<BaseIntermediateOutputPath>$(SolutionDir)/dist/backend/$(MSBuildProjectName)/obj</BaseIntermediateOutputPath> <BaseIntermediateOutputPath>$(SolutionDir)/dist/backend/$(MSBuildProjectName)/obj</BaseIntermediateOutputPath>
<BaseOutputPath>$(SolutionDir)/dist/backend/$(MSBuildProjectName)/bin</BaseOutputPath> <BaseOutputPath>$(SolutionDir)/dist/backend/$(MSBuildProjectName)/bin</BaseOutputPath>
<Copyright>© 2006-2023 nsnail</Copyright> <Copyright>© 2006-2024 nsnail</Copyright>
<Description>通用后台权限管理系统、快速开发框架基于C#12/.NET9、Vue3/Vite、Element Plus等现代技术构建具有十分整洁、优雅的编码规范</Description> <Description>通用后台权限管理系统、快速开发框架基于C#13/.NET9、Vue3/Vite、ElementPlus等现代技术构建具有十分整洁、优雅的编码规范</Description>
<EnableBaseIntermediateOutputPathMismatchWarning>false</EnableBaseIntermediateOutputPathMismatchWarning> <EnableBaseIntermediateOutputPathMismatchWarning>false</EnableBaseIntermediateOutputPathMismatchWarning>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>

View File

@ -1,12 +1,42 @@
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17 # Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59 VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{C84EB5A0-37AD-4B17-A51E-E36888C4441E}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".drone", ".drone", "{3E408077-E73E-45CE-A53A-EF5F9DAE4B46}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "backend", "backend", "{4DAF9366-855F-46BB-AE4C-660C92FA0697}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{BB5BB244-E7D2-4368-8C18-C1C0ED1E12D1}"
ProjectSection(SolutionItems) = preProject
README.md = .drone/workflows/README.md
EndProjectSection
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{1129FE25-466B-4F4F-85FC-3752664245E1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{3C6F049E-3EE8-4D66-9AFF-E8A369032487}"
ProjectSection(SolutionItems) = preProject
nightly-build.yml = .github/workflows/nightly-build.yml
README.md = .github/workflows/README.md
release.yml = .github/workflows/release.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{8E4C93BA-9493-4892-80C4-5E174C504829}"
ProjectSection(SolutionItems) = preProject
code.quality.props = build/code.quality.props
copy.pkg.xml.comment.files.targets = build/copy.pkg.xml.comment.files.targets
minver.targets = build/minver.targets
prebuild.targets = build/prebuild.targets
stylecop.analyzers.ruleset = build/stylecop.analyzers.ruleset
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docker", "docker", "{E80A1018-C354-4A26-9029-8847BB9DA864}"
ProjectSection(SolutionItems) = preProject
README.md = docker/README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "meta", "meta", "{5198A03D-0CAC-4828-A807-34A693F73859}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "meta", "meta", "{5198A03D-0CAC-4828-A807-34A693F73859}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
.commitlintrc.js = .commitlintrc.js .commitlintrc.js = .commitlintrc.js
@ -26,12 +56,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "meta", "meta", "{5198A03D-0
README.md = README.md README.md = README.md
EndProjectSection EndProjectSection
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{BB0B25C9-0901-4923-913F-00F9A6B352A5}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{BB0B25C9-0901-4923-913F-00F9A6B352A5}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
1.git.pull.request.ps1 = scripts/1.git.pull.request.ps1 1.git.pull.request.ps1 = scripts/1.git.pull.request.ps1
2.git.release.ps1 = scripts/2.git.release.ps1 2.git.release.ps1 = scripts/2.git.release.ps1
3.git.recreate.branch.ps1 = scripts/3.git.recreate.branch.ps1 3.git.recreate.branch.ps1 = scripts/3.git.recreate.branch.ps1
4.git.del.obsolete.tags.ps1 = scripts/4.git.del.obsolete.tags.ps1 4.git.del.obsolete.tags.ps1 = scripts/4.git.del.obsolete.tags.ps1
5.git.update.submodule.ps1 = scripts/5.git.update.submodule.ps1
clean.ln.csx = scripts/clean.ln.csx clean.ln.csx = scripts/clean.ln.csx
code.clean.csx = scripts/code.clean.csx code.clean.csx = scripts/code.clean.csx
code.clean.ps1 = scripts/code.clean.ps1 code.clean.ps1 = scripts/code.clean.ps1
@ -49,23 +81,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{BB0B
wait.server.stop.sh = scripts/wait.server.stop.sh wait.server.stop.sh = scripts/wait.server.stop.sh
EndProjectSection EndProjectSection
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{1129FE25-466B-4F4F-85FC-3752664245E1}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{C84EB5A0-37AD-4B17-A51E-E36888C4441E}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{3C6F049E-3EE8-4D66-9AFF-E8A369032487}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "backend", "backend", "{4DAF9366-855F-46BB-AE4C-660C92FA0697}"
ProjectSection(SolutionItems) = preProject
nightly-build.yml = .github/workflows/nightly-build.yml
README.md = .github/workflows/README.md
release.yml = .github/workflows/release.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{8E4C93BA-9493-4892-80C4-5E174C504829}"
ProjectSection(SolutionItems) = preProject
code.quality.props = build/code.quality.props
copy.pkg.xml.comment.files.targets = build/copy.pkg.xml.comment.files.targets
minver.targets = build/minver.targets
prebuild.targets = build/prebuild.targets
stylecop.analyzers.ruleset = build/stylecop.analyzers.ruleset
EndProjectSection
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetAdmin.Infrastructure", "src\backend\NetAdmin\NetAdmin.Infrastructure\NetAdmin.Infrastructure.csproj", "{1E62C322-EE42-4699-A6F1-791C53EFA62D}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetAdmin.Infrastructure", "src\backend\NetAdmin\NetAdmin.Infrastructure\NetAdmin.Infrastructure.csproj", "{1E62C322-EE42-4699-A6F1-791C53EFA62D}"
EndProject EndProject
@ -103,23 +122,19 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "src\backend\Un
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetAdmin.Tests", "src\backend\NetAdmin\NetAdmin.Tests\NetAdmin.Tests.csproj", "{00604162-C444-478B-B773-3AB23C856CA7}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetAdmin.Tests", "src\backend\NetAdmin\NetAdmin.Tests\NetAdmin.Tests.csproj", "{00604162-C444-478B-B773-3AB23C856CA7}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docker", "docker", "{E80A1018-C354-4A26-9029-8847BB9DA864}"
ProjectSection(SolutionItems) = preProject
README.md = docker/README.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YourSolution.AdmServer.Domain", "src\backend\YourSolution.AdmServer.Domain\YourSolution.AdmServer.Domain.csproj", "{932520DF-D312-415A-A128-1117F8221D68}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YourSolution.AdmServer.Domain", "src\backend\YourSolution.AdmServer.Domain\YourSolution.AdmServer.Domain.csproj", "{932520DF-D312-415A-A128-1117F8221D68}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YourSolution.AdmServer.Infrastructure", "src\backend\YourSolution.AdmServer.Infrastructure\YourSolution.AdmServer.Infrastructure.csproj", "{C3DE6F6A-D1FC-4B8E-9033-980FBEBBD2BA}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YourSolution.AdmServer.Infrastructure", "src\backend\YourSolution.AdmServer.Infrastructure\YourSolution.AdmServer.Infrastructure.csproj", "{C3DE6F6A-D1FC-4B8E-9033-980FBEBBD2BA}"
EndProject EndProject
##Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gurion", "refs\Gurion\src\Gurion\Gurion.csproj", "{CCD098FE-4F95-4FA4-8CC0-9A6DE921FBAE}"#refs ##Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gurion", "refs\Gurion\src\Gurion\Gurion.csproj", "{CCD098FE-4F95-4FA4-8CC0-9A6DE921FBAE}"#refs
##EndProject#refs ##EndProject#refs
##Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FreeSql", "refs\FreeSql\FreeSql\FreeSql.csproj", "{3C65DA42-877D-46FF-B754-C12214302A29}"#refs ##Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FreeSql", "refs\NetAdmin.FreeSql\src\FreeSql\FreeSql.csproj", "{3C65DA42-877D-46FF-B754-C12214302A29}"#refs
##EndProject#refs ##EndProject#refs
##Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FreeSql.Provider.Sqlite", "refs\FreeSql\Providers\FreeSql.Provider.Sqlite\FreeSql.Provider.Sqlite.csproj", "{CF5EFA63-4631-4A64-B4F3-98A7DD532F68}"#refs ##Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FreeSql.Provider.Sqlite", "refs\NetAdmin.FreeSql\src\FreeSql.Provider.Sqlite\FreeSql.Provider.Sqlite.csproj", "{CF5EFA63-4631-4A64-B4F3-98A7DD532F68}"#refs
##EndProject#refs ##EndProject#refs
##Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FreeSql.DbContext", "refs\FreeSql\FreeSql.DbContext\FreeSql.DbContext.csproj", "{FE03DF27-EC56-48DB-81B0-F99947259A7C}"#refs ##Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FreeSql.DbContext", "refs\NetAdmin.FreeSql\src\FreeSql.DbContext\FreeSql.DbContext.csproj", "{FE03DF27-EC56-48DB-81B0-F99947259A7C}"#refs
##EndProject#refs ##EndProject#refs
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -229,5 +244,6 @@ Global
{932520DF-D312-415A-A128-1117F8221D68} = {12AE5B4B-CB1A-498E-83B8-04E201E31D86} {932520DF-D312-415A-A128-1117F8221D68} = {12AE5B4B-CB1A-498E-83B8-04E201E31D86}
{C3DE6F6A-D1FC-4B8E-9033-980FBEBBD2BA} = {12AE5B4B-CB1A-498E-83B8-04E201E31D86} {C3DE6F6A-D1FC-4B8E-9033-980FBEBBD2BA} = {12AE5B4B-CB1A-498E-83B8-04E201E31D86}
{3C6F049E-3EE8-4D66-9AFF-E8A369032487} = {1129FE25-466B-4F4F-85FC-3752664245E1} {3C6F049E-3EE8-4D66-9AFF-E8A369032487} = {1129FE25-466B-4F4F-85FC-3752664245E1}
{BB5BB244-E7D2-4368-8C18-C1C0ED1E12D1} = {3E408077-E73E-45CE-A53A-EF5F9DAE4B46}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@ -1,6 +1,6 @@
# NetAdmin # NetAdmin
通用后台权限管理系统、快速开发框架基于C#12/.NET9、Vue3/Vite、Element Plus等现代技术构建具有十分整洁、优雅的编码规范 通用后台权限管理系统、快速开发框架基于C#13/.NET9、Vue3/Vite、ElementPlus等现代技术构建具有十分整洁、优雅的编码规范
[![.NET](https://github.com/nsnail/NetAdmin/actions/workflows/nightly-build.yml/badge.svg)](https://github.com/nsnail/NetAdmin/actions/workflows/nightly-build.yml) [![.NET](https://github.com/nsnail/NetAdmin/actions/workflows/nightly-build.yml/badge.svg)](https://github.com/nsnail/NetAdmin/actions/workflows/nightly-build.yml)
[![MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/nsnail/NetAdmin/blob/main/LICENSE) [![MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/nsnail/NetAdmin/blob/main/LICENSE)
@ -28,15 +28,14 @@ dotnet --list-sdks
git clone https://github.com/nsnail/NetAdmin.git && cd ./NetAdmin git clone https://github.com/nsnail/NetAdmin.git && cd ./NetAdmin
# 3. 确认本机 redis 处于运行状态 # 3. 确认本机 redis 处于运行状态
redis-server # 启动 redis-server # 启动服务器
redis-cli # 连接测试 redis-cli # 连接测试
# 下载 redis for windowshttps://github.com/redis-windows/redis-windows/releases # 下载 redis for windowshttps://github.com/redis-windows/redis-windows/releases
# 下载 redis for linux/machttps://redis.io/download # 下载 redis for linux/machttps://redis.io/download
# 4. 运行后端 WebApi # 4. 运行后端 WebApi
dotnet run --project ./src/backend/YourSolution.AdmServer.Host/YourSolution.AdmServer.Host.csproj --urls http://[::]:5010 -is dotnet run --project ./src/backend/YourSolution.AdmServer.Host/YourSolution.AdmServer.Host.csproj --urls http://[::]:5010 -is
# -i 插入种子数据 # -i 插入种子数据-s 同步数据库结构
# -s 同步数据库结构
# 浏览器访问 http://localhost:5010 将看到SwaggerKnife4jUI界面 # 浏览器访问 http://localhost:5010 将看到SwaggerKnife4jUI界面
# 5. 检查 nodejs 版本 >=20 # 5. 检查 nodejs 版本 >=20

View File

@ -219,7 +219,7 @@
"ParentId": 373838105399301, "ParentId": 373838105399301,
"Icon": "el-icon-eleme-filled", "Icon": "el-icon-eleme-filled",
"Name": "dev/element", "Name": "dev/element",
"Path": "http://element-plus.org/zh-CN/component/overview.html", "Path": "https://element-plus.org/zh-CN/component/overview.html",
"Sort": 99, "Sort": 99,
"Title": "Element", "Title": "Element",
"Type": 3, "Type": 3,

View File

@ -1,10 +1,10 @@
[ [
{ {
"Content": "<p>尊敬的用户:</p>\n<p style=\"padding-left: 40px;\">欢迎您使用 NetAdmin 后台管理系统NetAdmin 是一款通用后台权限管理系统和快速开发框架,它基于 C#12/.NET9、Vue3/Vite、Element Plus 等现代技术构建,具有十分整洁、优雅的编码规范。</p>\n<p style=\"padding-left: 40px;\">NetAdmin 致力于为企业提供高效、安全、易用的解决方案,帮助您快速构建出符合业务需求的应用程序。系统提供了丰富的功能模块,包括用户管理、权限管理、日志管理、文件上传等,可以满足您日常管理的需求。</p>\n<p style=\"padding-left: 40px;\">在使用 NetAdmin 的过程中,我们真诚地希望您能够遵守以下规定:</p>\n<p style=\"padding-left: 80px;\">1. 不得利用 NetAdmin 进行非法活动或者侵犯他人权益;</p>\n<p style=\"padding-left: 80px;\">2. 不得对 NetAdmin 系统进行恶意攻击或者破坏;</p>\n<p style=\"padding-left: 80px;\">3. 不得将 NetAdmin 系统的任何部分用于商业目的或者未经授权的访问。</p>\n<p style=\"padding-left: 80px;\">4. 为了更好地为您提供服务NetAdmin 将不断进行优化和升级,同时也欢迎您提出宝贵的意见和建议。如果您在使用过程中遇到任何问题,可以通过官方网站或者技术支持团队进行咨询和解决。</p>\n<p style=\"padding-left: 40px;\">再次感谢您对 NetAdmin 的信任和支持我们相信在您的使用过程中NetAdmin 一定会成为您的得力助手,为您的事业发展提供强有力的支持!</p>\n<p style=\"text-align: right;\">NetAdmin 开发团队</p>", "Content": "<p>尊敬的用户:</p>\n<p style=\"padding-left: 40px;\">欢迎您使用 NetAdmin 后台管理系统NetAdmin 是一款通用后台权限管理系统和快速开发框架,它基于 C#13/.NET9、Vue3/Vite、ElementPlus 等现代技术构建,具有十分整洁、优雅的编码规范。</p>\n<p style=\"padding-left: 40px;\">NetAdmin 致力于为企业提供高效、安全、易用的解决方案,帮助您快速构建出符合业务需求的应用程序。系统提供了丰富的功能模块,包括用户管理、权限管理、日志管理、文件上传等,可以满足您日常管理的需求。</p>\n<p style=\"padding-left: 40px;\">在使用 NetAdmin 的过程中,我们真诚地希望您能够遵守以下规定:</p>\n<p style=\"padding-left: 80px;\">1. 不得利用 NetAdmin 进行非法活动或者侵犯他人权益;</p>\n<p style=\"padding-left: 80px;\">2. 不得对 NetAdmin 系统进行恶意攻击或者破坏;</p>\n<p style=\"padding-left: 80px;\">3. 不得将 NetAdmin 系统的任何部分用于商业目的或者未经授权的访问。</p>\n<p style=\"padding-left: 80px;\">4. 为了更好地为您提供服务NetAdmin 将不断进行优化和升级,同时也欢迎您提出宝贵的意见和建议。如果您在使用过程中遇到任何问题,可以通过官方网站或者技术支持团队进行咨询和解决。</p>\n<p style=\"padding-left: 40px;\">再次感谢您对 NetAdmin 的信任和支持我们相信在您的使用过程中NetAdmin 一定会成为您的得力助手,为您的事业发展提供强有力的支持!</p>\n<p style=\"text-align: right;\">NetAdmin 开发团队</p>",
"CreatedUserId": 370942943322181, "CreatedUserId": 370942943322181,
"CreatedUserName": "root", "CreatedUserName": "root",
"MsgType": 2, "MsgType": 2,
"Summary": "尊敬的用户:\n欢迎您使用 NetAdmin 后台管理系统NetAdmin 是一款通用后台权限管理系统和快速开发框架,它基于 C#12/.NET9、Vue3/Vite、Element Plus 等现代", "Summary": "尊敬的用户:\n欢迎您使用 NetAdmin 后台管理系统NetAdmin 是一款通用后台权限管理系统和快速开发框架,它基于 C#13/.NET9、Vue3/Vite、ElementPlus 等现代",
"Title": "欢迎使用 NetAdmin 后台管理系统", "Title": "欢迎使用 NetAdmin 后台管理系统",
} }
] ]

View File

@ -23,7 +23,7 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.32.0.97167"> <PackageReference Include="SonarAnalyzer.CSharp" Version="10.3.0.106239">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

View File

@ -1,5 +1,5 @@
{ {
"version": "2.1.0", "version": "2.2.1",
"devDependencies": { "devDependencies": {
"cz-git": "^1.11.0", "cz-git": "^1.11.0",
"commitizen": "^4.3.1", "commitizen": "^4.3.1",

Submodule refs/FreeSql deleted from 6ea7ac8e50

1
refs/NetAdmin.FreeSql Submodule

Submodule refs/NetAdmin.FreeSql added at c851ae3da2

View File

@ -0,0 +1,3 @@
git submodule update --progress --init --recursive --force --remote -- "../refs/Gurion"
git submodule update --progress --init --recursive --force --remote -- "../refs/NetAdmin.FreeSql"
git submodule update --progress --init --recursive --force --remote -- "../refs/ns-ext"

View File

@ -5,8 +5,7 @@ Console.WriteLine("请输入原始名称NetAdmin");
var oldName = Console.ReadLine().NullOrEmpty("NetAdmin"); var oldName = Console.ReadLine().NullOrEmpty("NetAdmin");
Console.WriteLine("请输入替换名称:"); Console.WriteLine("请输入替换名称:");
var newName = Console.ReadLine(); var newName = Console.ReadLine();
foreach (var path in Directory.EnumerateDirectories("../", $"*{oldName}*", foreach (var path in Directory.EnumerateDirectories("../", $"*{oldName}*", SearchOption.AllDirectories).Where(x => !x.Contains(".git")))
SearchOption.AllDirectories))
{ {
Console.Write($"{path} --> "); Console.Write($"{path} --> ");
var newPath = path.Replace(oldName, newName); var newPath = path.Replace(oldName, newName);
@ -16,7 +15,7 @@ foreach (var path in Directory.EnumerateDirectories("../", $"*{oldName}*",
Console.WriteLine(); Console.WriteLine();
foreach (var path in Directory.EnumerateFiles("../", $"*.*", SearchOption.AllDirectories)) foreach (var path in Directory.EnumerateFiles("../", $"*.*", SearchOption.AllDirectories).Where(x => !x.Contains(".git")))
{ {
File.WriteAllText(path, File.ReadAllText(path).Replace(oldName, newName)); File.WriteAllText(path, File.ReadAllText(path).Replace(oldName, newName));
var newPath = path.Replace(oldName, newName); var newPath = path.Replace(oldName, newName);

View File

@ -45,6 +45,20 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
""" """
); );
content = Regex.Replace(
content,
"Project\\(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\"\\) = \"workflows\", \"workflows\", \"{BB5BB244-E7D2-4368-8C18-C1C0ED1E12D1}\"(?:.|\n)*?EndProject",
$$"""
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{BB5BB244-E7D2-4368-8C18-C1C0ED1E12D1}"
ProjectSection(SolutionItems) = preProject
{{string.Join('\n',
Directory.GetFiles(@"../.drone/workflows", "*")
.Select(x=>$" {Path.GetFileName(x)} = .drone/workflows/{Path.GetFileName(x)}")
)}}
EndProject
"""
);
content = Regex.Replace( content = Regex.Replace(
content, content,
"Project\\(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\"\\) = \"scripts\", \"scripts\", \"{BB0B25C9-0901-4923-913F-00F9A6B352A5}\"(?:.|\n)*?EndProject", "Project\\(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\"\\) = \"scripts\", \"scripts\", \"{BB0B25C9-0901-4923-913F-00F9A6B352A5}\"(?:.|\n)*?EndProject",

View File

@ -50,11 +50,7 @@ public abstract class RepositoryService<TEntity, TPrimary, TLogger>(BasicReposit
Func<QueryReq<TQuery>, ISelect<TEntity>> selector, QueryReq<TQuery> query, string fileName, Expression<Func<TEntity, object>> listExp = null) Func<QueryReq<TQuery>, ISelect<TEntity>> selector, QueryReq<TQuery> query, string fileName, Expression<Func<TEntity, object>> listExp = null)
where TQuery : DataAbstraction, new() where TQuery : DataAbstraction, new()
{ {
var select = selector(query) var select = selector(query).WithNoLockNoWait().Take(Numbers.MAX_LIMIT_EXPORT);
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Take(Numbers.MAX_LIMIT_EXPORT);
object list = listExp == null ? await select.ToListAsync().ConfigureAwait(false) : await select.ToListAsync(listExp).ConfigureAwait(false); object list = listExp == null ? await select.ToListAsync().ConfigureAwait(false) : await select.ToListAsync(listExp).ConfigureAwait(false);
@ -73,8 +69,8 @@ public abstract class RepositoryService<TEntity, TPrimary, TLogger>(BasicReposit
/// <returns>更新行数</returns> /// <returns>更新行数</returns>
protected Task<int> UpdateAsync( // protected Task<int> UpdateAsync( //
TEntity newValue // TEntity newValue //
, IEnumerable<string> includeFields // , List<string> includeFields = null //
, string[] excludeFields = null // , List<string> excludeFields = null //
, Expression<Func<TEntity, bool>> whereExp = null // , Expression<Func<TEntity, bool>> whereExp = null //
, string whereSql = null // , string whereSql = null //
, bool ignoreVersion = false) , bool ignoreVersion = false)
@ -98,8 +94,8 @@ public abstract class RepositoryService<TEntity, TPrimary, TLogger>(BasicReposit
/// <returns>更新后的实体列表</returns> /// <returns>更新后的实体列表</returns>
protected Task<List<TEntity>> UpdateReturnListAsync( // protected Task<List<TEntity>> UpdateReturnListAsync( //
TEntity newValue // TEntity newValue //
, IEnumerable<string> includeFields // , List<string> includeFields = null //
, string[] excludeFields = null // , List<string> excludeFields = null //
, Expression<Func<TEntity, bool>> whereExp = null // , Expression<Func<TEntity, bool>> whereExp = null //
, string whereSql = null // , string whereSql = null //
, bool ignoreVersion = false) , bool ignoreVersion = false)
@ -136,22 +132,22 @@ public abstract class RepositoryService<TEntity, TPrimary, TLogger>(BasicReposit
return new FileStreamResult(stream, Chars.FLG_HTTP_HEADER_VALUE_APPLICATION_OCTET_STREAM); return new FileStreamResult(stream, Chars.FLG_HTTP_HEADER_VALUE_APPLICATION_OCTET_STREAM);
} }
private IUpdate<TEntity> BuildUpdate( // private IUpdate<TEntity> BuildUpdate(TEntity entity, List<string> includeFields, List<string> excludeFields, bool ignoreVersion)
TEntity entity //
, IEnumerable<string> includeFields //
, string[] excludeFields = null //
, bool ignoreVersion = false)
{ {
var updateExp = includeFields == null IUpdate<TEntity> updateExp;
? Rpo.UpdateDiy.SetSource(entity) if (includeFields.NullOrEmpty()) {
: Rpo.UpdateDiy.SetDto(includeFields!.ToDictionary( updateExp = Rpo.UpdateDiy.SetSource(entity);
x => x, x => typeof(TEntity).GetProperty(x, BindingFlags.Public | BindingFlags.Instance)!.GetValue(entity))); if (!excludeFields.NullOrEmpty()) {
if (excludeFields != null) { updateExp = updateExp.IgnoreColumns(excludeFields.ToArray());
updateExp = updateExp.IgnoreColumns(excludeFields);
} }
}
else {
updateExp = Rpo.UpdateDiy.SetDto(includeFields!.ToDictionary(
x => x
, x => typeof(TEntity).GetProperty(x, BindingFlags.Public | BindingFlags.Instance)!.GetValue(entity)));
if (!ignoreVersion && entity is IFieldVersion ver) { if (!ignoreVersion && entity is IFieldVersion ver) {
updateExp = updateExp.Where($"{nameof(IFieldVersion.Version)} = @version", new { version = ver.Version }); updateExp = updateExp.Where($"{nameof(IFieldVersion.Version)} = {ver.Version}");
}
} }
return updateExp; return updateExp;

View File

@ -28,11 +28,7 @@ public sealed class ExampleService(BasicRepository<Tpl_Example, long> rpo) //
public Task<long> CountAsync(QueryReq<QueryExampleReq> req) public Task<long> CountAsync(QueryReq<QueryExampleReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().CountAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -54,11 +50,7 @@ public sealed class ExampleService(BasicRepository<Tpl_Example, long> rpo) //
public Task<bool> ExistAsync(QueryReq<QueryExampleReq> req) public Task<bool> ExistAsync(QueryReq<QueryExampleReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().AnyAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -80,14 +72,7 @@ public sealed class ExampleService(BasicRepository<Tpl_Example, long> rpo) //
public async Task<PagedQueryRsp<QueryExampleRsp>> PagedQueryAsync(PagedQueryReq<QueryExampleReq> req) public async Task<PagedQueryRsp<QueryExampleRsp>> PagedQueryAsync(PagedQueryReq<QueryExampleReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var list = await QueryInternal(req) var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
.Page(req.Page, req.PageSize)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Count(out var total)
.ToListAsync()
.ConfigureAwait(false);
return new PagedQueryRsp<QueryExampleRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryExampleRsp>>()); return new PagedQueryRsp<QueryExampleRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryExampleRsp>>());
} }
@ -96,13 +81,7 @@ public sealed class ExampleService(BasicRepository<Tpl_Example, long> rpo) //
public async Task<IEnumerable<QueryExampleRsp>> QueryAsync(QueryReq<QueryExampleReq> req) public async Task<IEnumerable<QueryExampleRsp>> QueryAsync(QueryReq<QueryExampleReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req) var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Take(req.Count)
.ToListAsync()
.ConfigureAwait(false);
return ret.Adapt<IEnumerable<QueryExampleRsp>>(); return ret.Adapt<IEnumerable<QueryExampleRsp>>();
} }

View File

@ -11,11 +11,7 @@ public record Sys_DocContent : VersionEntity, IFieldEnabled, IFieldOwner
/// <summary> /// <summary>
/// 文档正文 /// 文档正文
/// </summary> /// </summary>
#if DBTYPE_SQLSERVER [Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)]
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
#else
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
#endif
[CsvIgnore] [CsvIgnore]
[JsonIgnore] [JsonIgnore]
public virtual string Body { get; init; } public virtual string Body { get; init; }

View File

@ -59,10 +59,10 @@ public record Sys_Job : VersionEntity, IFieldEnabled, IFieldSummary
/// <summary> /// <summary>
/// 上次执行状态 /// 上次执行状态
/// </summary> /// </summary>
[Column] [Column(DbType = Chars.FLG_DB_FIELD_TYPE_SMALL_INT)]
[CsvIgnore] [CsvIgnore]
[JsonIgnore] [JsonIgnore]
public HttpStatusCode? LastStatusCode { get; init; } public int? LastStatusCode { get; init; }
/// <summary> /// <summary>
/// 下次执行时间 /// 下次执行时间
@ -99,11 +99,7 @@ public record Sys_Job : VersionEntity, IFieldEnabled, IFieldSummary
/// <summary> /// <summary>
/// 请求体 /// 请求体
/// </summary> /// </summary>
#if DBTYPE_SQLSERVER [Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)]
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
#else
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
#endif
[CsvIgnore] [CsvIgnore]
[JsonIgnore] [JsonIgnore]
public virtual string RequestBody { get; init; } public virtual string RequestBody { get; init; }
@ -111,11 +107,7 @@ public record Sys_Job : VersionEntity, IFieldEnabled, IFieldSummary
/// <summary> /// <summary>
/// 请求头 /// 请求头
/// </summary> /// </summary>
#if DBTYPE_SQLSERVER [Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)]
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
#else
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
#endif
[CsvIgnore] [CsvIgnore]
[JsonIgnore] [JsonIgnore]
public virtual string RequestHeader { get; init; } public virtual string RequestHeader { get; init; }
@ -123,11 +115,7 @@ public record Sys_Job : VersionEntity, IFieldEnabled, IFieldSummary
/// <summary> /// <summary>
/// 请求的网络地址 /// 请求的网络地址
/// </summary> /// </summary>
#if DBTYPE_SQLSERVER [Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)]
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
#else
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
#endif
[CsvIgnore] [CsvIgnore]
[JsonIgnore] [JsonIgnore]
public virtual string RequestUrl { get; init; } public virtual string RequestUrl { get; init; }
@ -143,11 +131,7 @@ public record Sys_Job : VersionEntity, IFieldEnabled, IFieldSummary
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>
#if DBTYPE_SQLSERVER
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
#else
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)] [Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
#endif
[CsvIgnore] [CsvIgnore]
[JsonIgnore] [JsonIgnore]
public virtual string Summary { get; init; } public virtual string Summary { get; init; }

View File

@ -53,11 +53,7 @@ public record Sys_JobRecord : LiteImmutableEntity
/// <summary> /// <summary>
/// 请求体 /// 请求体
/// </summary> /// </summary>
#if DBTYPE_SQLSERVER [Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)]
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
#else
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
#endif
[CsvIgnore] [CsvIgnore]
[JsonIgnore] [JsonIgnore]
public virtual string RequestBody { get; init; } public virtual string RequestBody { get; init; }
@ -65,11 +61,7 @@ public record Sys_JobRecord : LiteImmutableEntity
/// <summary> /// <summary>
/// 请求头 /// 请求头
/// </summary> /// </summary>
#if DBTYPE_SQLSERVER [Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)]
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
#else
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
#endif
[CsvIgnore] [CsvIgnore]
[JsonIgnore] [JsonIgnore]
public virtual string RequestHeader { get; init; } public virtual string RequestHeader { get; init; }
@ -85,11 +77,7 @@ public record Sys_JobRecord : LiteImmutableEntity
/// <summary> /// <summary>
/// 响应体 /// 响应体
/// </summary> /// </summary>
#if DBTYPE_SQLSERVER [Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)]
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
#else
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
#endif
[CsvIgnore] [CsvIgnore]
[JsonIgnore] [JsonIgnore]
public virtual string ResponseBody { get; init; } public virtual string ResponseBody { get; init; }
@ -97,11 +85,7 @@ public record Sys_JobRecord : LiteImmutableEntity
/// <summary> /// <summary>
/// 响应头 /// 响应头
/// </summary> /// </summary>
#if DBTYPE_SQLSERVER [Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)]
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
#else
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
#endif
[CsvIgnore] [CsvIgnore]
[JsonIgnore] [JsonIgnore]
public virtual string ResponseHeader { get; init; } public virtual string ResponseHeader { get; init; }

View File

@ -28,11 +28,7 @@ public record Sys_LoginLog : SimpleEntity, IFieldCreatedTime, IFieldOwner, IFiel
/// <summary> /// <summary>
/// 创建者客户端用户代理 /// 创建者客户端用户代理
/// </summary> /// </summary>
#if DBTYPE_SQLSERVER
[Column(Position = -1, DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_1022)] [Column(Position = -1, DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_1022)]
#else
[Column(Position = -1, DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
#endif
[CsvIgnore] [CsvIgnore]
[JsonIgnore] [JsonIgnore]
public virtual string CreatedUserAgent { get; init; } public virtual string CreatedUserAgent { get; init; }
@ -96,11 +92,7 @@ public record Sys_LoginLog : SimpleEntity, IFieldCreatedTime, IFieldOwner, IFiel
/// <summary> /// <summary>
/// 请求内容 /// 请求内容
/// </summary> /// </summary>
#if DBTYPE_SQLSERVER [Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)]
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
#else
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
#endif
[CsvIgnore] [CsvIgnore]
[JsonIgnore] [JsonIgnore]
public virtual string RequestBody { get; protected init; } public virtual string RequestBody { get; protected init; }
@ -108,11 +100,7 @@ public record Sys_LoginLog : SimpleEntity, IFieldCreatedTime, IFieldOwner, IFiel
/// <summary> /// <summary>
/// 请求头信息 /// 请求头信息
/// </summary> /// </summary>
#if DBTYPE_SQLSERVER [Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)]
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
#else
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
#endif
[CsvIgnore] [CsvIgnore]
[JsonIgnore] [JsonIgnore]
public virtual string RequestHeaders { get; protected init; } public virtual string RequestHeaders { get; protected init; }
@ -128,11 +116,7 @@ public record Sys_LoginLog : SimpleEntity, IFieldCreatedTime, IFieldOwner, IFiel
/// <summary> /// <summary>
/// 响应内容 /// 响应内容
/// </summary> /// </summary>
#if DBTYPE_SQLSERVER [Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)]
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
#else
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
#endif
[CsvIgnore] [CsvIgnore]
[JsonIgnore] [JsonIgnore]
public virtual string ResponseBody { get; protected init; } public virtual string ResponseBody { get; protected init; }
@ -140,11 +124,7 @@ public record Sys_LoginLog : SimpleEntity, IFieldCreatedTime, IFieldOwner, IFiel
/// <summary> /// <summary>
/// 响应头 /// 响应头
/// </summary> /// </summary>
#if DBTYPE_SQLSERVER [Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)]
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
#else
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
#endif
[CsvIgnore] [CsvIgnore]
[JsonIgnore] [JsonIgnore]
public virtual string ResponseHeaders { get; protected init; } public virtual string ResponseHeaders { get; protected init; }

View File

@ -18,11 +18,7 @@ public record Sys_RequestLogDetail : SimpleEntity, IFieldCreatedTime, IFieldCrea
/// <summary> /// <summary>
/// 创建者客户端用户代理 /// 创建者客户端用户代理
/// </summary> /// </summary>
#if DBTYPE_SQLSERVER
[Column(Position = -1, DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_1022)] [Column(Position = -1, DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_1022)]
#else
[Column(Position = -1, DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
#endif
[CsvIgnore] [CsvIgnore]
[JsonIgnore] [JsonIgnore]
public virtual string CreatedUserAgent { get; init; } public virtual string CreatedUserAgent { get; init; }
@ -38,11 +34,7 @@ public record Sys_RequestLogDetail : SimpleEntity, IFieldCreatedTime, IFieldCrea
/// <summary> /// <summary>
/// 异常信息 /// 异常信息
/// </summary> /// </summary>
#if DBTYPE_SQLSERVER [Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)]
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
#else
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
#endif
[CsvIgnore] [CsvIgnore]
[JsonIgnore] [JsonIgnore]
public virtual string Exception { get; init; } public virtual string Exception { get; init; }
@ -50,11 +42,7 @@ public record Sys_RequestLogDetail : SimpleEntity, IFieldCreatedTime, IFieldCrea
/// <summary> /// <summary>
/// 请求内容 /// 请求内容
/// </summary> /// </summary>
#if DBTYPE_SQLSERVER [Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)]
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
#else
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
#endif
[CsvIgnore] [CsvIgnore]
[JsonIgnore] [JsonIgnore]
public virtual string RequestBody { get; init; } public virtual string RequestBody { get; init; }
@ -70,11 +58,7 @@ public record Sys_RequestLogDetail : SimpleEntity, IFieldCreatedTime, IFieldCrea
/// <summary> /// <summary>
/// 请求头信息 /// 请求头信息
/// </summary> /// </summary>
#if DBTYPE_SQLSERVER [Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)]
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
#else
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
#endif
[CsvIgnore] [CsvIgnore]
[JsonIgnore] [JsonIgnore]
public virtual string RequestHeaders { get; init; } public virtual string RequestHeaders { get; init; }
@ -90,11 +74,7 @@ public record Sys_RequestLogDetail : SimpleEntity, IFieldCreatedTime, IFieldCrea
/// <summary> /// <summary>
/// 响应内容 /// 响应内容
/// </summary> /// </summary>
#if DBTYPE_SQLSERVER [Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)]
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
#else
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
#endif
[CsvIgnore] [CsvIgnore]
[JsonIgnore] [JsonIgnore]
public virtual string ResponseBody { get; init; } public virtual string ResponseBody { get; init; }
@ -110,11 +90,7 @@ public record Sys_RequestLogDetail : SimpleEntity, IFieldCreatedTime, IFieldCrea
/// <summary> /// <summary>
/// 响应头 /// 响应头
/// </summary> /// </summary>
#if DBTYPE_SQLSERVER [Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)]
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
#else
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
#endif
[CsvIgnore] [CsvIgnore]
[JsonIgnore] [JsonIgnore]
public virtual string ResponseHeaders { get; init; } public virtual string ResponseHeaders { get; init; }

View File

@ -21,11 +21,7 @@ public record Sys_Role : VersionEntity, IFieldSort, IFieldEnabled, IFieldSummary
/// <summary> /// <summary>
/// 仪表板布局 /// 仪表板布局
/// </summary> /// </summary>
#if DBTYPE_SQLSERVER [Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)]
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
#else
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
#endif
[CsvIgnore] [CsvIgnore]
[JsonIgnore] [JsonIgnore]
public virtual string DashboardLayout { get; set; } public virtual string DashboardLayout { get; set; }

View File

@ -12,11 +12,7 @@ public record Sys_SiteMsg : VersionEntity, IRegister, IFieldSummary
/// <summary> /// <summary>
/// 消息内容 /// 消息内容
/// </summary> /// </summary>
#if DBTYPE_SQLSERVER [Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)]
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
#else
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
#endif
[CsvIgnore] [CsvIgnore]
[JsonIgnore] [JsonIgnore]
public virtual string Content { get; init; } public virtual string Content { get; init; }

View File

@ -11,11 +11,7 @@ public record Sys_UserProfile : VersionEntity, IRegister
/// <summary> /// <summary>
/// 应用配置 /// 应用配置
/// </summary> /// </summary>
#if DBTYPE_SQLSERVER [Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)]
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
#else
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
#endif
[CsvIgnore] [CsvIgnore]
[JsonIgnore] [JsonIgnore]
public virtual string AppConfig { get; set; } public virtual string AppConfig { get; set; }

View File

@ -20,13 +20,11 @@ public record QueryJobRsp : Sys_Job
/// <inheritdoc cref="Sys_Job.LastStatusCode" /> /// <inheritdoc cref="Sys_Job.LastStatusCode" />
[JsonInclude] [JsonInclude]
public new virtual string LastStatusCode => public new virtual string LastStatusCode =>
#pragma warning disable IDE0072
base.LastStatusCode switch { base.LastStatusCode switch {
#pragma warning restore IDE0072
null => null null => null
, _ => (int)base.LastStatusCode.Value == Numbers.HTTP_STATUS_BIZ_FAIL , _ => base.LastStatusCode.Value == Numbers.HTTP_STATUS_BIZ_FAIL
? nameof(ErrorCodes.Unhandled).ToLowerCamelCase() ? nameof(ErrorCodes.Unhandled).ToLowerCamelCase()
: base.LastStatusCode.Value.ToString().ToLowerCamelCase() : ((HttpStatusCode)base.LastStatusCode.Value).ToString().ToLowerCamelCase()
}; };
/// <inheritdoc cref="IFieldCreatedTime.CreatedTime" /> /// <inheritdoc cref="IFieldCreatedTime.CreatedTime" />

View File

@ -6,7 +6,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="CronExpressionDescriptor" Version="2.36.0"/> <PackageReference Include="CronExpressionDescriptor" Version="2.36.0"/>
<PackageReference Include="Cronos" Version="0.8.4"/> <PackageReference Include="Cronos" Version="0.8.4"/>
<PackageReference Include="CsvHelper.NS" Version="33.0.2-ns2"/> <PackageReference Include="NetAdmin.CsvHelper" Version="1.0.0"/>
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14"/> <PackageReference Include="Yitter.IdGenerator" Version="1.0.14"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -1,5 +1,5 @@
#if DEBUG #if DEBUG
using IGeekFan.AspNetCore.Knife4jUI; using NetAdmin.ApiSkin;
#else #else
using Prometheus; using Prometheus;
@ -32,9 +32,9 @@ public static class IApplicationBuilderExtensions
/// <summary> /// <summary>
/// 使用 api skin knife4j-vue /// 使用 api skin knife4j-vue
/// </summary> /// </summary>
public static IApplicationBuilder UseOpenApiSkin(this IApplicationBuilder me) public static IApplicationBuilder UseApiSkin(this IApplicationBuilder me)
{ {
return me.UseKnife4UI(options => { return me.UseApiSkin(options => {
options.RoutePrefix = string.Empty; // 配置 Knife4UI 路由地址 options.RoutePrefix = string.Empty; // 配置 Knife4UI 路由地址
foreach (var groupInfo in SpecificationDocumentBuilder.GetOpenApiGroups()) { foreach (var groupInfo in SpecificationDocumentBuilder.GetOpenApiGroups()) {
options.SwaggerEndpoint(groupInfo.RouteTemplate, groupInfo.Title); options.SwaggerEndpoint(groupInfo.RouteTemplate, groupInfo.Title);

View File

@ -4,8 +4,8 @@
<ProjectReference Include="../NetAdmin.Cache/NetAdmin.Cache.csproj"/> <ProjectReference Include="../NetAdmin.Cache/NetAdmin.Cache.csproj"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="IGeekFan.AspNetCore.Knife4jUI.NS" Condition="'$(Configuration)' == 'Debug'" Version="0.0.15-ns3"/> <PackageReference Include="NetAdmin.ApiSkin" Condition="'$(Configuration)' == 'Debug'" Version="1.0.0"/>
<PackageReference Include="Spectre.Console.Cli.NS" Version="0.45.1-preview.0.179"/> <PackageReference Include="NetAdmin.Spectre.Console.Cli" Version="1.0.0"/>
<PackageReference Include="prometheus-net.AspNetCore" Condition="'$(Configuration)' != 'Debug'" Version="8.2.1"/> <PackageReference Include="prometheus-net.AspNetCore" Condition="'$(Configuration)' != 'Debug'" Version="8.2.1"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -41,7 +41,6 @@ public static class Chars
public const string FLG_DB_FIELD_TYPE_VARCHAR_510 = "varchar(510)"; public const string FLG_DB_FIELD_TYPE_VARCHAR_510 = "varchar(510)";
public const string FLG_DB_FIELD_TYPE_VARCHAR_63 = "varchar(63)"; public const string FLG_DB_FIELD_TYPE_VARCHAR_63 = "varchar(63)";
public const string FLG_DB_FIELD_TYPE_VARCHAR_7 = "varchar(7)"; public const string FLG_DB_FIELD_TYPE_VARCHAR_7 = "varchar(7)";
public const string FLG_DB_FIELD_TYPE_VARCHAR_MAX = "varchar(max)";
public const string FLG_DB_INDEX_PREFIX = "idx_{tablename}_"; public const string FLG_DB_INDEX_PREFIX = "idx_{tablename}_";
public const string FLG_DB_TABLE_NAME_PREFIX = ""; public const string FLG_DB_TABLE_NAME_PREFIX = "";
public const string FLG_FREE_SQL_GLOBAL_FILTER_DATA = nameof(FLG_FREE_SQL_GLOBAL_FILTER_DATA); public const string FLG_FREE_SQL_GLOBAL_FILTER_DATA = nameof(FLG_FREE_SQL_GLOBAL_FILTER_DATA);
@ -81,6 +80,14 @@ public static class Chars
public const string FLG_REDIS_INSTANCE_DATA_CACHE = "DataCache"; public const string FLG_REDIS_INSTANCE_DATA_CACHE = "DataCache";
public const string FLG_SNOWFLAKE_WORK_ID = "SNOWFLAKE_WORK_ID"; public const string FLG_SNOWFLAKE_WORK_ID = "SNOWFLAKE_WORK_ID";
public const string FLGL_DB_FIELD_TYPE_VARCHAR_MAX =
#if DBTYPE_SQLSERVER
"varchar(max)"
#else
"text"
#endif
;
public const string FLGL_HTTP_HEADER_VALUE_UA_MOBILE public const string FLGL_HTTP_HEADER_VALUE_UA_MOBILE
= "Mozilla/5.0 (Linux; Android 9; Redmi Note 8 Pro Build/PPR1.180610.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.96 Mobile Safari/537.36"; = "Mozilla/5.0 (Linux; Android 9; Redmi Note 8 Pro Build/PPR1.180610.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.96 Mobile Safari/537.36";

View File

@ -0,0 +1,100 @@
namespace NetAdmin.Infrastructure.Extensions;
/// <summary>
/// ISelect 扩展方法
/// </summary>
public static class ISelectExtensions
{
/// <summary>
/// 无锁无等待
/// </summary>
public static ISelect<T1> WithNoLockNoWait<T1>(this ISelect<T1> me)
where T1 : class
{
return me
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
;
}
/// <summary>
/// 无锁无等待
/// </summary>
public static ISelect<T1, T2> WithNoLockNoWait<T1, T2>(this ISelect<T1, T2> me)
where T1 : class //
where T2 : class
{
return me
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
;
}
/// <summary>
/// 无锁无等待
/// </summary>
public static ISelect<T1, T2, T3> WithNoLockNoWait<T1, T2, T3>(this ISelect<T1, T2, T3> me)
where T1 : class //
where T2 : class //
where T3 : class
{
return me
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
;
}
/// <summary>
/// 无锁无等待
/// </summary>
public static ISelect<T1, T2, T3, T4> WithNoLockNoWait<T1, T2, T3, T4>(this ISelect<T1, T2, T3, T4> me)
where T1 : class //
where T2 : class //
where T3 : class //
where T4 : class
{
return me
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
;
}
/// <summary>
/// 无锁无等待
/// </summary>
public static ISelect<T1, T2, T3, T4, T5> WithNoLockNoWait<T1, T2, T3, T4, T5>(this ISelect<T1, T2, T3, T4, T5> me)
where T1 : class //
where T2 : class //
where T3 : class //
where T4 : class //
where T5 : class
{
return me
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
;
}
/// <summary>
/// 无锁无等待
/// </summary>
public static ISelect<T1, T2, T3, T4, T5, T6> WithNoLockNoWait<T1, T2, T3, T4, T5, T6>(this ISelect<T1, T2, T3, T4, T5, T6> me)
where T1 : class //
where T2 : class //
where T3 : class //
where T4 : class //
where T5 : class //
where T6 : class
{
return me
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
;
}
}

View File

@ -3,19 +3,18 @@
<Import Project="$(SolutionDir)/build/copy.pkg.xml.comment.files.targets"/> <Import Project="$(SolutionDir)/build/copy.pkg.xml.comment.files.targets"/>
<Import Project="$(SolutionDir)/build/prebuild.targets"/> <Import Project="$(SolutionDir)/build/prebuild.targets"/>
<ItemGroup> <ItemGroup>
<PackageReference Include="FreeSql.DbContext.NS" Version="3.2.833-ns6" Label="refs"/> <PackageReference Include="NetAdmin.FreeSql.DbContext" Version="1.0.2" Label="refs"/>
<PackageReference Include="FreeSql.Provider.Sqlite.NS" Version="3.2.833-ns6" Label="refs"/> <PackageReference Include="NetAdmin.FreeSql.Provider.Sqlite" Version="1.0.2" Label="refs"/>
<PackageReference Include="Gurion" Version="1.2.2" Label="refs"/> <PackageReference Include="Gurion" Version="1.2.5" Label="refs"/>
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="9.0.0"/> <PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="9.0.0"/>
<PackageReference Include="Minio" Version="6.0.3"/> <PackageReference Include="Minio" Version="6.0.3"/>
<PackageReference Include="NSExt" Version="2.3.2"/> <PackageReference Include="NSExt" Version="2.3.2"/>
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.4"/> <PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.4"/>
<PackageReference Include="System.Drawing.Common" Version="9.0.0"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<!--<ProjectReference Include="$(SolutionDir)/refs/FreeSql/FreeSql.DbContext/FreeSql.DbContext.csproj" Label="refs"/>--> <!--<ProjectReference Include="$(SolutionDir)/refs/NetAdmin.FreeSql/src/FreeSql.DbContext/FreeSql.DbContext.csproj" Label="refs"/>-->
<!--<ProjectReference Include="$(SolutionDir)/refs/FreeSql/FreeSql/FreeSql.csproj" Label="refs"/>--> <!--<ProjectReference Include="$(SolutionDir)/refs/NetAdmin.FreeSql/src/FreeSql/FreeSql.csproj" Label="refs"/>-->
<!--<ProjectReference Include="$(SolutionDir)/refs/FreeSql/Providers/FreeSql.Provider.Sqlite/FreeSql.Provider.Sqlite.csproj" Label="refs"/>--> <!--<ProjectReference Include="$(SolutionDir)/refs/NetAdmin.FreeSql/src/FreeSql.Provider.Sqlite/FreeSql.Provider.Sqlite.csproj" Label="refs"/>-->
<!--<ProjectReference Include="$(SolutionDir)/refs/Gurion/src/Gurion/Gurion.csproj" Label="refs"/>--> <!--<ProjectReference Include="$(SolutionDir)/refs/Gurion/src/Gurion/Gurion.csproj" Label="refs"/>-->
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -21,11 +21,7 @@ public sealed class ApiService(
public Task<long> CountAsync(QueryReq<QueryApiReq> req) public Task<long> CountAsync(QueryReq<QueryApiReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().CountAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -46,11 +42,7 @@ public sealed class ApiService(
public Task<bool> ExistAsync(QueryReq<QueryApiReq> req) public Task<bool> ExistAsync(QueryReq<QueryApiReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().AnyAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />

View File

@ -25,11 +25,7 @@ public sealed class ConfigService(BasicRepository<Sys_Config, long> rpo) //
public Task<long> CountAsync(QueryReq<QueryConfigReq> req) public Task<long> CountAsync(QueryReq<QueryConfigReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().CountAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -64,11 +60,7 @@ public sealed class ConfigService(BasicRepository<Sys_Config, long> rpo) //
public Task<bool> ExistAsync(QueryReq<QueryConfigReq> req) public Task<bool> ExistAsync(QueryReq<QueryConfigReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().AnyAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -97,14 +89,7 @@ public sealed class ConfigService(BasicRepository<Sys_Config, long> rpo) //
public async Task<PagedQueryRsp<QueryConfigRsp>> PagedQueryAsync(PagedQueryReq<QueryConfigReq> req) public async Task<PagedQueryRsp<QueryConfigRsp>> PagedQueryAsync(PagedQueryReq<QueryConfigReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var list = await QueryInternal(req) var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
.Page(req.Page, req.PageSize)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Count(out var total)
.ToListAsync()
.ConfigureAwait(false);
return new PagedQueryRsp<QueryConfigRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryConfigRsp>>()); return new PagedQueryRsp<QueryConfigRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryConfigRsp>>());
} }
@ -113,13 +98,7 @@ public sealed class ConfigService(BasicRepository<Sys_Config, long> rpo) //
public async Task<IEnumerable<QueryConfigRsp>> QueryAsync(QueryReq<QueryConfigReq> req) public async Task<IEnumerable<QueryConfigRsp>> QueryAsync(QueryReq<QueryConfigReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req) var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Take(req.Count)
.ToListAsync()
.ConfigureAwait(false);
return ret.Adapt<IEnumerable<QueryConfigRsp>>(); return ret.Adapt<IEnumerable<QueryConfigRsp>>();
} }

View File

@ -25,11 +25,7 @@ public sealed class DeptService(BasicRepository<Sys_Dept, long> rpo) //
public Task<long> CountAsync(QueryReq<QueryDeptReq> req) public Task<long> CountAsync(QueryReq<QueryDeptReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().CountAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -80,11 +76,7 @@ public sealed class DeptService(BasicRepository<Sys_Dept, long> rpo) //
public Task<bool> ExistAsync(QueryReq<QueryDeptReq> req) public Task<bool> ExistAsync(QueryReq<QueryDeptReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().AnyAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -113,12 +105,7 @@ public sealed class DeptService(BasicRepository<Sys_Dept, long> rpo) //
public async Task<IEnumerable<QueryDeptRsp>> QueryAsync(QueryReq<QueryDeptReq> req) public async Task<IEnumerable<QueryDeptRsp>> QueryAsync(QueryReq<QueryDeptReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return (await QueryInternal(req) return (await QueryInternal(req).WithNoLockNoWait().ToTreeListAsync().ConfigureAwait(false)).Adapt<IEnumerable<QueryDeptRsp>>();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.ToTreeListAsync()
.ConfigureAwait(false)).Adapt<IEnumerable<QueryDeptRsp>>();
} }
/// <inheritdoc /> /// <inheritdoc />

View File

@ -25,11 +25,7 @@ public sealed class DicCatalogService(BasicRepository<Sys_DicCatalog, long> rpo)
public Task<long> CountAsync(QueryReq<QueryDicCatalogReq> req) public Task<long> CountAsync(QueryReq<QueryDicCatalogReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().CountAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -37,12 +33,7 @@ public sealed class DicCatalogService(BasicRepository<Sys_DicCatalog, long> rpo)
public async Task<QueryDicCatalogRsp> CreateAsync(CreateDicCatalogReq req) public async Task<QueryDicCatalogRsp> CreateAsync(CreateDicCatalogReq req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
if (req.ParentId != 0 && !await Rpo.Where(a => a.Id == req.ParentId) if (req.ParentId != 0 && !await Rpo.Where(a => a.Id == req.ParentId).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)) {
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync()
.ConfigureAwait(false)) {
throw new NetAdminInvalidOperationException(Ln.); throw new NetAdminInvalidOperationException(Ln.);
} }
@ -63,12 +54,7 @@ public sealed class DicCatalogService(BasicRepository<Sys_DicCatalog, long> rpo)
public async Task<int> EditAsync(EditDicCatalogReq req) public async Task<int> EditAsync(EditDicCatalogReq req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return req.ParentId == 0 || await Rpo.Where(a => a.Id == req.ParentId) return req.ParentId == 0 || await Rpo.Where(a => a.Id == req.ParentId).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync()
.ConfigureAwait(false)
? await UpdateAsync(req, null).ConfigureAwait(false) ? await UpdateAsync(req, null).ConfigureAwait(false)
: throw new NetAdminInvalidOperationException(Ln.); : throw new NetAdminInvalidOperationException(Ln.);
} }
@ -77,11 +63,7 @@ public sealed class DicCatalogService(BasicRepository<Sys_DicCatalog, long> rpo)
public Task<bool> ExistAsync(QueryReq<QueryDicCatalogReq> req) public Task<bool> ExistAsync(QueryReq<QueryDicCatalogReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().AnyAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -103,14 +85,7 @@ public sealed class DicCatalogService(BasicRepository<Sys_DicCatalog, long> rpo)
public async Task<PagedQueryRsp<QueryDicCatalogRsp>> PagedQueryAsync(PagedQueryReq<QueryDicCatalogReq> req) public async Task<PagedQueryRsp<QueryDicCatalogRsp>> PagedQueryAsync(PagedQueryReq<QueryDicCatalogReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var list = await QueryInternal(req) var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
.Page(req.Page, req.PageSize)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Count(out var total)
.ToListAsync()
.ConfigureAwait(false);
return new PagedQueryRsp<QueryDicCatalogRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryDicCatalogRsp>>()); return new PagedQueryRsp<QueryDicCatalogRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryDicCatalogRsp>>());
} }
@ -119,12 +94,7 @@ public sealed class DicCatalogService(BasicRepository<Sys_DicCatalog, long> rpo)
public async Task<IEnumerable<QueryDicCatalogRsp>> QueryAsync(QueryReq<QueryDicCatalogReq> req) public async Task<IEnumerable<QueryDicCatalogRsp>> QueryAsync(QueryReq<QueryDicCatalogReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req) var ret = await QueryInternal(req).WithNoLockNoWait().ToTreeListAsync().ConfigureAwait(false);
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.ToTreeListAsync()
.ConfigureAwait(false);
return ret.Adapt<IEnumerable<QueryDicCatalogRsp>>(); return ret.Adapt<IEnumerable<QueryDicCatalogRsp>>();
} }

View File

@ -25,11 +25,7 @@ public sealed class DicContentService(BasicRepository<Sys_DicContent, long> rpo)
public Task<long> CountAsync(QueryReq<QueryDicContentReq> req) public Task<long> CountAsync(QueryReq<QueryDicContentReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().CountAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -37,13 +33,7 @@ public sealed class DicContentService(BasicRepository<Sys_DicContent, long> rpo)
public async Task<QueryDicContentRsp> CreateAsync(CreateDicContentReq req) public async Task<QueryDicContentRsp> CreateAsync(CreateDicContentReq req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
if (!await Rpo.Orm.Select<Sys_DicCatalog>() if (!await Rpo.Orm.Select<Sys_DicCatalog>().Where(a => a.Id == req.CatalogId).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)) {
.Where(a => a.Id == req.CatalogId)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync()
.ConfigureAwait(false)) {
throw new NetAdminInvalidOperationException(Ln.); throw new NetAdminInvalidOperationException(Ln.);
} }
@ -63,13 +53,7 @@ public sealed class DicContentService(BasicRepository<Sys_DicContent, long> rpo)
public async Task<QueryDicContentRsp> EditAsync(EditDicContentReq req) public async Task<QueryDicContentRsp> EditAsync(EditDicContentReq req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
if (!await Rpo.Orm.Select<Sys_DicCatalog>() if (!await Rpo.Orm.Select<Sys_DicCatalog>().Where(a => a.Id == req.CatalogId).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)) {
.Where(a => a.Id == req.CatalogId)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync()
.ConfigureAwait(false)) {
throw new NetAdminInvalidOperationException(Ln.); throw new NetAdminInvalidOperationException(Ln.);
} }
@ -86,11 +70,7 @@ public sealed class DicContentService(BasicRepository<Sys_DicContent, long> rpo)
public Task<bool> ExistAsync(QueryReq<QueryDicContentReq> req) public Task<bool> ExistAsync(QueryReq<QueryDicContentReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().AnyAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -112,14 +92,7 @@ public sealed class DicContentService(BasicRepository<Sys_DicContent, long> rpo)
public async Task<PagedQueryRsp<QueryDicContentRsp>> PagedQueryAsync(PagedQueryReq<QueryDicContentReq> req) public async Task<PagedQueryRsp<QueryDicContentRsp>> PagedQueryAsync(PagedQueryReq<QueryDicContentReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var list = await QueryInternal(req) var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
.Page(req.Page, req.PageSize)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Count(out var total)
.ToListAsync()
.ConfigureAwait(false);
return new PagedQueryRsp<QueryDicContentRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryDicContentRsp>>()); return new PagedQueryRsp<QueryDicContentRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryDicContentRsp>>());
} }
@ -128,13 +101,7 @@ public sealed class DicContentService(BasicRepository<Sys_DicContent, long> rpo)
public async Task<IEnumerable<QueryDicContentRsp>> QueryAsync(QueryReq<QueryDicContentReq> req) public async Task<IEnumerable<QueryDicContentRsp>> QueryAsync(QueryReq<QueryDicContentReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req) var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Take(req.Count)
.ToListAsync()
.ConfigureAwait(false);
return ret.Adapt<IEnumerable<QueryDicContentRsp>>(); return ret.Adapt<IEnumerable<QueryDicContentRsp>>();
} }
@ -142,9 +109,7 @@ public sealed class DicContentService(BasicRepository<Sys_DicContent, long> rpo)
public async Task<List<QueryDicContentRsp>> QueryByCatalogCodeAsync(string catalogCode) public async Task<List<QueryDicContentRsp>> QueryByCatalogCodeAsync(string catalogCode)
{ {
var ret = await Rpo.Orm.Select<Sys_DicContent>() var ret = await Rpo.Orm.Select<Sys_DicContent>()
#if DBTYPE_SQLSERVER .WithNoLockNoWait()
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Include(a => a.Catalog) .Include(a => a.Catalog)
.Where(a => a.Catalog.Code == catalogCode) .Where(a => a.Catalog.Code == catalogCode)
.Where(a => a.Enabled) .Where(a => a.Enabled)

View File

@ -25,11 +25,7 @@ public sealed class DocCatalogService(BasicRepository<Sys_DocCatalog, long> rpo)
public Task<long> CountAsync(QueryReq<QueryDocCatalogReq> req) public Task<long> CountAsync(QueryReq<QueryDocCatalogReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().CountAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -37,12 +33,7 @@ public sealed class DocCatalogService(BasicRepository<Sys_DocCatalog, long> rpo)
public async Task<QueryDocCatalogRsp> CreateAsync(CreateDocCatalogReq req) public async Task<QueryDocCatalogRsp> CreateAsync(CreateDocCatalogReq req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
if (req.ParentId != 0 && !await Rpo.Where(a => a.Id == req.ParentId) if (req.ParentId != 0 && !await Rpo.Where(a => a.Id == req.ParentId).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)) {
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync()
.ConfigureAwait(false)) {
throw new NetAdminInvalidOperationException(Ln.); throw new NetAdminInvalidOperationException(Ln.);
} }
@ -63,12 +54,7 @@ public sealed class DocCatalogService(BasicRepository<Sys_DocCatalog, long> rpo)
public async Task<int> EditAsync(EditDocCatalogReq req) public async Task<int> EditAsync(EditDocCatalogReq req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return req.ParentId == 0 || await Rpo.Where(a => a.Id == req.ParentId) return req.ParentId == 0 || await Rpo.Where(a => a.Id == req.ParentId).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync()
.ConfigureAwait(false)
? await UpdateAsync(req, null).ConfigureAwait(false) ? await UpdateAsync(req, null).ConfigureAwait(false)
: throw new NetAdminInvalidOperationException(Ln.); : throw new NetAdminInvalidOperationException(Ln.);
} }
@ -77,11 +63,7 @@ public sealed class DocCatalogService(BasicRepository<Sys_DocCatalog, long> rpo)
public Task<bool> ExistAsync(QueryReq<QueryDocCatalogReq> req) public Task<bool> ExistAsync(QueryReq<QueryDocCatalogReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().AnyAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -103,14 +85,7 @@ public sealed class DocCatalogService(BasicRepository<Sys_DocCatalog, long> rpo)
public async Task<PagedQueryRsp<QueryDocCatalogRsp>> PagedQueryAsync(PagedQueryReq<QueryDocCatalogReq> req) public async Task<PagedQueryRsp<QueryDocCatalogRsp>> PagedQueryAsync(PagedQueryReq<QueryDocCatalogReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var list = await QueryInternal(req) var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
.Page(req.Page, req.PageSize)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Count(out var total)
.ToListAsync()
.ConfigureAwait(false);
return new PagedQueryRsp<QueryDocCatalogRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryDocCatalogRsp>>()); return new PagedQueryRsp<QueryDocCatalogRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryDocCatalogRsp>>());
} }
@ -119,12 +94,7 @@ public sealed class DocCatalogService(BasicRepository<Sys_DocCatalog, long> rpo)
public async Task<IEnumerable<QueryDocCatalogRsp>> QueryAsync(QueryReq<QueryDocCatalogReq> req) public async Task<IEnumerable<QueryDocCatalogRsp>> QueryAsync(QueryReq<QueryDocCatalogReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req) var ret = await QueryInternal(req).WithNoLockNoWait().ToTreeListAsync().ConfigureAwait(false);
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.ToTreeListAsync()
.ConfigureAwait(false);
return ret.Adapt<IEnumerable<QueryDocCatalogRsp>>(); return ret.Adapt<IEnumerable<QueryDocCatalogRsp>>();
} }

View File

@ -1,7 +1,9 @@
using NetAdmin.Domain.DbMaps.Dependency.Fields;
using NetAdmin.Domain.DbMaps.Sys; using NetAdmin.Domain.DbMaps.Sys;
using NetAdmin.Domain.Dto.Sys.Doc.Content; using NetAdmin.Domain.Dto.Sys.Doc.Content;
using NetAdmin.Domain.Enums.Sys; using NetAdmin.Domain.Enums.Sys;
#if !DBTYPE_SQLSERVER
using NetAdmin.Domain.DbMaps.Dependency.Fields;
#endif
namespace NetAdmin.SysComponent.Application.Services.Sys; namespace NetAdmin.SysComponent.Application.Services.Sys;
@ -27,11 +29,7 @@ public sealed class DocContentService(BasicRepository<Sys_DocContent, long> rpo)
public Task<long> CountAsync(QueryReq<QueryDocContentReq> req) public Task<long> CountAsync(QueryReq<QueryDocContentReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().CountAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -39,13 +37,7 @@ public sealed class DocContentService(BasicRepository<Sys_DocContent, long> rpo)
public async Task<QueryDocContentRsp> CreateAsync(CreateDocContentReq req) public async Task<QueryDocContentRsp> CreateAsync(CreateDocContentReq req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
if (!await Rpo.Orm.Select<Sys_DocCatalog>() if (!await Rpo.Orm.Select<Sys_DocCatalog>().Where(a => a.Id == req.CatalogId).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)) {
.Where(a => a.Id == req.CatalogId)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync()
.ConfigureAwait(false)) {
throw new NetAdminInvalidOperationException(Ln.); throw new NetAdminInvalidOperationException(Ln.);
} }
@ -65,13 +57,7 @@ public sealed class DocContentService(BasicRepository<Sys_DocContent, long> rpo)
public async Task<QueryDocContentRsp> EditAsync(EditDocContentReq req) public async Task<QueryDocContentRsp> EditAsync(EditDocContentReq req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
if (!await Rpo.Orm.Select<Sys_DocCatalog>() if (!await Rpo.Orm.Select<Sys_DocCatalog>().Where(a => a.Id == req.CatalogId).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)) {
.Where(a => a.Id == req.CatalogId)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync()
.ConfigureAwait(false)) {
throw new NetAdminInvalidOperationException(Ln.); throw new NetAdminInvalidOperationException(Ln.);
} }
@ -88,11 +74,7 @@ public sealed class DocContentService(BasicRepository<Sys_DocContent, long> rpo)
public Task<bool> ExistAsync(QueryReq<QueryDocContentReq> req) public Task<bool> ExistAsync(QueryReq<QueryDocContentReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().AnyAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -114,14 +96,7 @@ public sealed class DocContentService(BasicRepository<Sys_DocContent, long> rpo)
public async Task<PagedQueryRsp<QueryDocContentRsp>> PagedQueryAsync(PagedQueryReq<QueryDocContentReq> req) public async Task<PagedQueryRsp<QueryDocContentRsp>> PagedQueryAsync(PagedQueryReq<QueryDocContentReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var list = await QueryInternal(req) var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
.Page(req.Page, req.PageSize)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Count(out var total)
.ToListAsync()
.ConfigureAwait(false);
return new PagedQueryRsp<QueryDocContentRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryDocContentRsp>>()); return new PagedQueryRsp<QueryDocContentRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryDocContentRsp>>());
} }
@ -130,13 +105,7 @@ public sealed class DocContentService(BasicRepository<Sys_DocContent, long> rpo)
public async Task<IEnumerable<QueryDocContentRsp>> QueryAsync(QueryReq<QueryDocContentReq> req) public async Task<IEnumerable<QueryDocContentRsp>> QueryAsync(QueryReq<QueryDocContentReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req) var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Take(req.Count)
.ToListAsync()
.ConfigureAwait(false);
return ret.Adapt<IEnumerable<QueryDocContentRsp>>(); return ret.Adapt<IEnumerable<QueryDocContentRsp>>();
} }

View File

@ -26,11 +26,7 @@ public sealed class JobRecordService(BasicRepository<Sys_JobRecord, long> rpo) /
public Task<long> CountAsync(QueryReq<QueryJobRecordReq> req) public Task<long> CountAsync(QueryReq<QueryJobRecordReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().CountAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -52,11 +48,7 @@ public sealed class JobRecordService(BasicRepository<Sys_JobRecord, long> rpo) /
public Task<bool> ExistAsync(QueryReq<QueryJobRecordReq> req) public Task<bool> ExistAsync(QueryReq<QueryJobRecordReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().AnyAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -80,9 +72,7 @@ public sealed class JobRecordService(BasicRepository<Sys_JobRecord, long> rpo) /
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req with { Order = Orders.None }) var ret = await QueryInternal(req with { Order = Orders.None })
#if DBTYPE_SQLSERVER .WithNoLockNoWait()
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.GroupBy(a => new { a.CreatedTime.Year, a.CreatedTime.Month, a.CreatedTime.Day, a.CreatedTime.Hour }) .GroupBy(a => new { a.CreatedTime.Year, a.CreatedTime.Month, a.CreatedTime.Day, a.CreatedTime.Hour })
.ToListAsync(a => new GetBarChartRsp { .ToListAsync(a => new GetBarChartRsp {
Timestamp = new DateTime(a.Key.Year, a.Key.Month, a.Key.Day, a.Key.Hour, 0, 0 Timestamp = new DateTime(a.Key.Year, a.Key.Month, a.Key.Day, a.Key.Hour, 0, 0
@ -98,9 +88,7 @@ public sealed class JobRecordService(BasicRepository<Sys_JobRecord, long> rpo) /
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req with { Order = Orders.None }) var ret = await QueryInternal(req with { Order = Orders.None })
#if DBTYPE_SQLSERVER .WithNoLockNoWait()
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Include(a => a.Job) .Include(a => a.Job)
.GroupBy(a => a.HttpStatusCode) .GroupBy(a => a.HttpStatusCode)
#pragma warning disable CA1305 #pragma warning disable CA1305
@ -115,9 +103,7 @@ public sealed class JobRecordService(BasicRepository<Sys_JobRecord, long> rpo) /
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req with { Order = Orders.None }) var ret = await QueryInternal(req with { Order = Orders.None })
#if DBTYPE_SQLSERVER .WithNoLockNoWait()
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Include(a => a.Job) .Include(a => a.Job)
.GroupBy(a => a.Job.JobName) .GroupBy(a => a.Job.JobName)
.ToListAsync(a => new GetPieChartRsp { Value = a.Count(), Key = a.Key }) .ToListAsync(a => new GetPieChartRsp { Value = a.Count(), Key = a.Key })
@ -129,14 +115,7 @@ public sealed class JobRecordService(BasicRepository<Sys_JobRecord, long> rpo) /
public async Task<PagedQueryRsp<QueryJobRecordRsp>> PagedQueryAsync(PagedQueryReq<QueryJobRecordReq> req) public async Task<PagedQueryRsp<QueryJobRecordRsp>> PagedQueryAsync(PagedQueryReq<QueryJobRecordReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var list = await QueryInternal(req) var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
.Page(req.Page, req.PageSize)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Count(out var total)
.ToListAsync()
.ConfigureAwait(false);
return new PagedQueryRsp<QueryJobRecordRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryJobRecordRsp>>()); return new PagedQueryRsp<QueryJobRecordRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryJobRecordRsp>>());
} }
@ -145,13 +124,7 @@ public sealed class JobRecordService(BasicRepository<Sys_JobRecord, long> rpo) /
public async Task<IEnumerable<QueryJobRecordRsp>> QueryAsync(QueryReq<QueryJobRecordReq> req) public async Task<IEnumerable<QueryJobRecordRsp>> QueryAsync(QueryReq<QueryJobRecordReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req) var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Take(req.Count)
.ToListAsync()
.ConfigureAwait(false);
return ret.Adapt<IEnumerable<QueryJobRecordRsp>>(); return ret.Adapt<IEnumerable<QueryJobRecordRsp>>();
} }

View File

@ -30,11 +30,7 @@ public sealed class JobService(BasicRepository<Sys_Job, long> rpo, IJobRecordSer
public Task<long> CountAsync(QueryReq<QueryJobReq> req) public Task<long> CountAsync(QueryReq<QueryJobReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().CountAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -129,11 +125,7 @@ public sealed class JobService(BasicRepository<Sys_Job, long> rpo, IJobRecordSer
public Task<bool> ExistAsync(QueryReq<QueryJobReq> req) public Task<bool> ExistAsync(QueryReq<QueryJobReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().AnyAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -192,9 +184,7 @@ public sealed class JobService(BasicRepository<Sys_Job, long> rpo, IJobRecordSer
] ]
}; };
var job = await QueryInternal(new QueryReq<QueryJobReq> { DynamicFilter = df, Order = Orders.Random }, false) var job = await QueryInternal(new QueryReq<QueryJobReq> { DynamicFilter = df, Order = Orders.Random }, false)
#if DBTYPE_SQLSERVER .WithNoLockNoWait()
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Where(a => !Rpo.Orm.Select<Sys_JobRecord>().As("b").Where(b => b.JobId == a.Id && b.TimeId == a.NextTimeId).Any()) .Where(a => !Rpo.Orm.Select<Sys_JobRecord>().As("b").Where(b => b.JobId == a.Id && b.TimeId == a.NextTimeId).Any())
.ToOneAsync(a => new { .ToOneAsync(a => new {
a.RequestUrl a.RequestUrl
@ -262,14 +252,7 @@ public sealed class JobService(BasicRepository<Sys_Job, long> rpo, IJobRecordSer
public async Task<PagedQueryRsp<QueryJobRsp>> PagedQueryAsync(PagedQueryReq<QueryJobReq> req) public async Task<PagedQueryRsp<QueryJobRsp>> PagedQueryAsync(PagedQueryReq<QueryJobReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var list = await QueryInternal(req) var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
.Page(req.Page, req.PageSize)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Count(out var total)
.ToListAsync()
.ConfigureAwait(false);
return new PagedQueryRsp<QueryJobRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryJobRsp>>()); return new PagedQueryRsp<QueryJobRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryJobRsp>>());
} }
@ -285,13 +268,7 @@ public sealed class JobService(BasicRepository<Sys_Job, long> rpo, IJobRecordSer
public async Task<IEnumerable<QueryJobRsp>> QueryAsync(QueryReq<QueryJobReq> req) public async Task<IEnumerable<QueryJobRsp>> QueryAsync(QueryReq<QueryJobReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req) var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Take(req.Count)
.ToListAsync()
.ConfigureAwait(false);
return ret.Adapt<IEnumerable<QueryJobRsp>>(); return ret.Adapt<IEnumerable<QueryJobRsp>>();
} }

View File

@ -25,11 +25,7 @@ public sealed class LoginLogService(BasicRepository<Sys_LoginLog, long> rpo) //
public Task<long> CountAsync(QueryReq<QueryLoginLogReq> req) public Task<long> CountAsync(QueryReq<QueryLoginLogReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().CountAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -51,11 +47,7 @@ public sealed class LoginLogService(BasicRepository<Sys_LoginLog, long> rpo) //
public Task<bool> ExistAsync(QueryReq<QueryLoginLogReq> req) public Task<bool> ExistAsync(QueryReq<QueryLoginLogReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().AnyAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -80,9 +72,7 @@ public sealed class LoginLogService(BasicRepository<Sys_LoginLog, long> rpo) //
var list = await QueryInternal(req) var list = await QueryInternal(req)
.Include(a => a.Owner) .Include(a => a.Owner)
.Page(req.Page, req.PageSize) .Page(req.Page, req.PageSize)
#if DBTYPE_SQLSERVER .WithNoLockNoWait()
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Count(out var total) .Count(out var total)
.ToListAsync(a => new { .ToListAsync(a => new {
a.CreatedClientIp a.CreatedClientIp
@ -106,13 +96,7 @@ public sealed class LoginLogService(BasicRepository<Sys_LoginLog, long> rpo) //
public async Task<IEnumerable<QueryLoginLogRsp>> QueryAsync(QueryReq<QueryLoginLogReq> req) public async Task<IEnumerable<QueryLoginLogRsp>> QueryAsync(QueryReq<QueryLoginLogReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req) var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Take(req.Count)
.ToListAsync()
.ConfigureAwait(false);
return ret.Adapt<IEnumerable<QueryLoginLogRsp>>(); return ret.Adapt<IEnumerable<QueryLoginLogRsp>>();
} }

View File

@ -25,11 +25,7 @@ public sealed class MenuService(BasicRepository<Sys_Menu, long> rpo, IUserServic
public Task<long> CountAsync(QueryReq<QueryMenuReq> req) public Task<long> CountAsync(QueryReq<QueryMenuReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().CountAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -64,11 +60,7 @@ public sealed class MenuService(BasicRepository<Sys_Menu, long> rpo, IUserServic
public Task<bool> ExistAsync(QueryReq<QueryMenuReq> req) public Task<bool> ExistAsync(QueryReq<QueryMenuReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().AnyAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -97,12 +89,7 @@ public sealed class MenuService(BasicRepository<Sys_Menu, long> rpo, IUserServic
public async Task<IEnumerable<QueryMenuRsp>> QueryAsync(QueryReq<QueryMenuReq> req) public async Task<IEnumerable<QueryMenuRsp>> QueryAsync(QueryReq<QueryMenuReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req) var ret = await QueryInternal(req).WithNoLockNoWait().ToTreeListAsync().ConfigureAwait(false);
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.ToTreeListAsync()
.ConfigureAwait(false);
return ret.Adapt<IEnumerable<QueryMenuRsp>>(); return ret.Adapt<IEnumerable<QueryMenuRsp>>();
} }

View File

@ -25,11 +25,7 @@ public sealed class RequestLogDetailService(BasicRepository<Sys_RequestLogDetail
public Task<long> CountAsync(QueryReq<QueryRequestLogDetailReq> req) public Task<long> CountAsync(QueryReq<QueryRequestLogDetailReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().CountAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -51,11 +47,7 @@ public sealed class RequestLogDetailService(BasicRepository<Sys_RequestLogDetail
public Task<bool> ExistAsync(QueryReq<QueryRequestLogDetailReq> req) public Task<bool> ExistAsync(QueryReq<QueryRequestLogDetailReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().AnyAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -79,14 +71,7 @@ public sealed class RequestLogDetailService(BasicRepository<Sys_RequestLogDetail
public async Task<PagedQueryRsp<QueryRequestLogDetailRsp>> PagedQueryAsync(PagedQueryReq<QueryRequestLogDetailReq> req) public async Task<PagedQueryRsp<QueryRequestLogDetailRsp>> PagedQueryAsync(PagedQueryReq<QueryRequestLogDetailReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var list = await QueryInternal(req) var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
.Page(req.Page, req.PageSize)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Count(out var total)
.ToListAsync()
.ConfigureAwait(false);
return new PagedQueryRsp<QueryRequestLogDetailRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryRequestLogDetailRsp>>()); return new PagedQueryRsp<QueryRequestLogDetailRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryRequestLogDetailRsp>>());
} }
@ -95,13 +80,7 @@ public sealed class RequestLogDetailService(BasicRepository<Sys_RequestLogDetail
public async Task<IEnumerable<QueryRequestLogDetailRsp>> QueryAsync(QueryReq<QueryRequestLogDetailReq> req) public async Task<IEnumerable<QueryRequestLogDetailRsp>> QueryAsync(QueryReq<QueryRequestLogDetailReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req) var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Take(req.Count)
.ToListAsync()
.ConfigureAwait(false);
return ret.Adapt<IEnumerable<QueryRequestLogDetailRsp>>(); return ret.Adapt<IEnumerable<QueryRequestLogDetailRsp>>();
} }

View File

@ -27,11 +27,7 @@ public sealed class RequestLogService(BasicRepository<Sys_RequestLog, long> rpo,
public Task<long> CountAsync(QueryReq<QueryRequestLogReq> req) public Task<long> CountAsync(QueryReq<QueryRequestLogReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().CountAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -59,11 +55,7 @@ public sealed class RequestLogService(BasicRepository<Sys_RequestLog, long> rpo,
public Task<bool> ExistAsync(QueryReq<QueryRequestLogReq> req) public Task<bool> ExistAsync(QueryReq<QueryRequestLogReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().AnyAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -109,9 +101,7 @@ public sealed class RequestLogService(BasicRepository<Sys_RequestLog, long> rpo,
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req with { Order = Orders.None }, false) var ret = await QueryInternal(req with { Order = Orders.None }, false)
#if DBTYPE_SQLSERVER .WithNoLockNoWait()
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.GroupBy(a => new { a.CreatedTime.Year, a.CreatedTime.Month, a.CreatedTime.Day, a.CreatedTime.Hour }) .GroupBy(a => new { a.CreatedTime.Year, a.CreatedTime.Month, a.CreatedTime.Day, a.CreatedTime.Hour })
.ToListAsync(a => new GetBarChartRsp { .ToListAsync(a => new GetBarChartRsp {
Timestamp = new DateTime(a.Key.Year, a.Key.Month, a.Key.Day, a.Key.Hour, 0, 0 Timestamp = new DateTime(a.Key.Year, a.Key.Month, a.Key.Day, a.Key.Hour, 0, 0
@ -127,9 +117,7 @@ public sealed class RequestLogService(BasicRepository<Sys_RequestLog, long> rpo,
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req with { Order = Orders.None }) var ret = await QueryInternal(req with { Order = Orders.None })
#if DBTYPE_SQLSERVER .WithNoLockNoWait()
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.GroupBy(a => a.Api.Summary) .GroupBy(a => a.Api.Summary)
.ToListAsync(a => new GetPieChartRsp { Value = a.Count(), Key = a.Key }) .ToListAsync(a => new GetPieChartRsp { Value = a.Count(), Key = a.Key })
.ConfigureAwait(false); .ConfigureAwait(false);
@ -141,9 +129,7 @@ public sealed class RequestLogService(BasicRepository<Sys_RequestLog, long> rpo,
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req with { Order = Orders.None }, false) var ret = await QueryInternal(req with { Order = Orders.None }, false)
#if DBTYPE_SQLSERVER .WithNoLockNoWait()
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.GroupBy(a => a.HttpStatusCode) .GroupBy(a => a.HttpStatusCode)
#pragma warning disable CA1305 #pragma warning disable CA1305
.ToListAsync(a => new GetPieChartRsp { Value = a.Count(), Key = a.Key.ToString() }) .ToListAsync(a => new GetPieChartRsp { Value = a.Count(), Key = a.Key.ToString() })
@ -171,9 +157,7 @@ public sealed class RequestLogService(BasicRepository<Sys_RequestLog, long> rpo,
} }
var ret = await selectTemp.Page(req.Page, req.PageSize) var ret = await selectTemp.Page(req.Page, req.PageSize)
#if DBTYPE_SQLSERVER .WithNoLockNoWait()
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Count(out var total) .Count(out var total)
.ToListAsync(a => a.temp) .ToListAsync(a => a.temp)
.ConfigureAwait(false); .ConfigureAwait(false);
@ -185,13 +169,7 @@ public sealed class RequestLogService(BasicRepository<Sys_RequestLog, long> rpo,
public async Task<IEnumerable<QueryRequestLogRsp>> QueryAsync(QueryReq<QueryRequestLogReq> req) public async Task<IEnumerable<QueryRequestLogRsp>> QueryAsync(QueryReq<QueryRequestLogReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req) var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Take(req.Count)
.ToListAsync()
.ConfigureAwait(false);
return ret.Adapt<IEnumerable<QueryRequestLogRsp>>(); return ret.Adapt<IEnumerable<QueryRequestLogRsp>>();
} }

View File

@ -25,11 +25,7 @@ public sealed class RoleService(BasicRepository<Sys_Role, long> rpo) //
public Task<long> CountAsync(QueryReq<QueryRoleReq> req) public Task<long> CountAsync(QueryReq<QueryRoleReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().CountAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -52,12 +48,7 @@ public sealed class RoleService(BasicRepository<Sys_Role, long> rpo) //
public async Task<int> DeleteAsync(DelReq req) public async Task<int> DeleteAsync(DelReq req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return await Rpo.Orm.Select<Sys_UserRole>() return await Rpo.Orm.Select<Sys_UserRole>().WithNoLockNoWait().AnyAsync(a => a.RoleId == req.Id).ConfigureAwait(false)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync(a => a.RoleId == req.Id)
.ConfigureAwait(false)
? throw new NetAdminInvalidOperationException(Ln.) ? throw new NetAdminInvalidOperationException(Ln.)
: await Rpo.DeleteAsync(a => a.Id == req.Id).ConfigureAwait(false); : await Rpo.DeleteAsync(a => a.Id == req.Id).ConfigureAwait(false);
} }
@ -79,11 +70,7 @@ public sealed class RoleService(BasicRepository<Sys_Role, long> rpo) //
public Task<bool> ExistAsync(QueryReq<QueryRoleReq> req) public Task<bool> ExistAsync(QueryReq<QueryRoleReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().AnyAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -105,14 +92,7 @@ public sealed class RoleService(BasicRepository<Sys_Role, long> rpo) //
public async Task<PagedQueryRsp<QueryRoleRsp>> PagedQueryAsync(PagedQueryReq<QueryRoleReq> req) public async Task<PagedQueryRsp<QueryRoleRsp>> PagedQueryAsync(PagedQueryReq<QueryRoleReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var list = await QueryInternal(req) var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
.Page(req.Page, req.PageSize)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Count(out var total)
.ToListAsync()
.ConfigureAwait(false);
return new PagedQueryRsp<QueryRoleRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryRoleRsp>>()); return new PagedQueryRsp<QueryRoleRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryRoleRsp>>());
} }
@ -121,12 +101,7 @@ public sealed class RoleService(BasicRepository<Sys_Role, long> rpo) //
public async Task<IEnumerable<QueryRoleRsp>> QueryAsync(QueryReq<QueryRoleReq> req) public async Task<IEnumerable<QueryRoleRsp>> QueryAsync(QueryReq<QueryRoleReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req) var ret = await QueryInternal(req).WithNoLockNoWait().ToListAsync().ConfigureAwait(false);
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.ToListAsync()
.ConfigureAwait(false);
return ret.Adapt<IEnumerable<QueryRoleRsp>>(); return ret.Adapt<IEnumerable<QueryRoleRsp>>();
} }

View File

@ -25,11 +25,7 @@ public sealed class SiteMsgDeptService(BasicRepository<Sys_SiteMsgDept, long> rp
public Task<long> CountAsync(QueryReq<QuerySiteMsgDeptReq> req) public Task<long> CountAsync(QueryReq<QuerySiteMsgDeptReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().CountAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -51,11 +47,7 @@ public sealed class SiteMsgDeptService(BasicRepository<Sys_SiteMsgDept, long> rp
public Task<bool> ExistAsync(QueryReq<QuerySiteMsgDeptReq> req) public Task<bool> ExistAsync(QueryReq<QuerySiteMsgDeptReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().AnyAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -77,14 +69,7 @@ public sealed class SiteMsgDeptService(BasicRepository<Sys_SiteMsgDept, long> rp
public async Task<PagedQueryRsp<QuerySiteMsgDeptRsp>> PagedQueryAsync(PagedQueryReq<QuerySiteMsgDeptReq> req) public async Task<PagedQueryRsp<QuerySiteMsgDeptRsp>> PagedQueryAsync(PagedQueryReq<QuerySiteMsgDeptReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var list = await QueryInternal(req) var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
.Page(req.Page, req.PageSize)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Count(out var total)
.ToListAsync()
.ConfigureAwait(false);
return new PagedQueryRsp<QuerySiteMsgDeptRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QuerySiteMsgDeptRsp>>()); return new PagedQueryRsp<QuerySiteMsgDeptRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QuerySiteMsgDeptRsp>>());
} }
@ -93,13 +78,7 @@ public sealed class SiteMsgDeptService(BasicRepository<Sys_SiteMsgDept, long> rp
public async Task<IEnumerable<QuerySiteMsgDeptRsp>> QueryAsync(QueryReq<QuerySiteMsgDeptReq> req) public async Task<IEnumerable<QuerySiteMsgDeptRsp>> QueryAsync(QueryReq<QuerySiteMsgDeptReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req) var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Take(req.Count)
.ToListAsync()
.ConfigureAwait(false);
return ret.Adapt<IEnumerable<QuerySiteMsgDeptRsp>>(); return ret.Adapt<IEnumerable<QuerySiteMsgDeptRsp>>();
} }

View File

@ -25,11 +25,7 @@ public sealed class SiteMsgFlagService(BasicRepository<Sys_SiteMsgFlag, long> rp
public Task<long> CountAsync(QueryReq<QuerySiteMsgFlagReq> req) public Task<long> CountAsync(QueryReq<QuerySiteMsgFlagReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().CountAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -51,11 +47,7 @@ public sealed class SiteMsgFlagService(BasicRepository<Sys_SiteMsgFlag, long> rp
public Task<bool> ExistAsync(QueryReq<QuerySiteMsgFlagReq> req) public Task<bool> ExistAsync(QueryReq<QuerySiteMsgFlagReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().AnyAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -77,14 +69,7 @@ public sealed class SiteMsgFlagService(BasicRepository<Sys_SiteMsgFlag, long> rp
public async Task<PagedQueryRsp<QuerySiteMsgFlagRsp>> PagedQueryAsync(PagedQueryReq<QuerySiteMsgFlagReq> req) public async Task<PagedQueryRsp<QuerySiteMsgFlagRsp>> PagedQueryAsync(PagedQueryReq<QuerySiteMsgFlagReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var list = await QueryInternal(req) var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
.Page(req.Page, req.PageSize)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Count(out var total)
.ToListAsync()
.ConfigureAwait(false);
return new PagedQueryRsp<QuerySiteMsgFlagRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QuerySiteMsgFlagRsp>>()); return new PagedQueryRsp<QuerySiteMsgFlagRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QuerySiteMsgFlagRsp>>());
} }
@ -93,13 +78,7 @@ public sealed class SiteMsgFlagService(BasicRepository<Sys_SiteMsgFlag, long> rp
public async Task<IEnumerable<QuerySiteMsgFlagRsp>> QueryAsync(QueryReq<QuerySiteMsgFlagReq> req) public async Task<IEnumerable<QuerySiteMsgFlagRsp>> QueryAsync(QueryReq<QuerySiteMsgFlagReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req) var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Take(req.Count)
.ToListAsync()
.ConfigureAwait(false);
return ret.Adapt<IEnumerable<QuerySiteMsgFlagRsp>>(); return ret.Adapt<IEnumerable<QuerySiteMsgFlagRsp>>();
} }

View File

@ -25,11 +25,7 @@ public sealed class SiteMsgRoleService(BasicRepository<Sys_SiteMsgRole, long> rp
public Task<long> CountAsync(QueryReq<QuerySiteMsgRoleReq> req) public Task<long> CountAsync(QueryReq<QuerySiteMsgRoleReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().CountAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -51,11 +47,7 @@ public sealed class SiteMsgRoleService(BasicRepository<Sys_SiteMsgRole, long> rp
public Task<bool> ExistAsync(QueryReq<QuerySiteMsgRoleReq> req) public Task<bool> ExistAsync(QueryReq<QuerySiteMsgRoleReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().AnyAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -77,14 +69,7 @@ public sealed class SiteMsgRoleService(BasicRepository<Sys_SiteMsgRole, long> rp
public async Task<PagedQueryRsp<QuerySiteMsgRoleRsp>> PagedQueryAsync(PagedQueryReq<QuerySiteMsgRoleReq> req) public async Task<PagedQueryRsp<QuerySiteMsgRoleRsp>> PagedQueryAsync(PagedQueryReq<QuerySiteMsgRoleReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var list = await QueryInternal(req) var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
.Page(req.Page, req.PageSize)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Count(out var total)
.ToListAsync()
.ConfigureAwait(false);
return new PagedQueryRsp<QuerySiteMsgRoleRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QuerySiteMsgRoleRsp>>()); return new PagedQueryRsp<QuerySiteMsgRoleRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QuerySiteMsgRoleRsp>>());
} }
@ -93,13 +78,7 @@ public sealed class SiteMsgRoleService(BasicRepository<Sys_SiteMsgRole, long> rp
public async Task<IEnumerable<QuerySiteMsgRoleRsp>> QueryAsync(QueryReq<QuerySiteMsgRoleReq> req) public async Task<IEnumerable<QuerySiteMsgRoleRsp>> QueryAsync(QueryReq<QuerySiteMsgRoleReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req) var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Take(req.Count)
.ToListAsync()
.ConfigureAwait(false);
return ret.Adapt<IEnumerable<QuerySiteMsgRoleRsp>>(); return ret.Adapt<IEnumerable<QuerySiteMsgRoleRsp>>();
} }

View File

@ -29,11 +29,7 @@ public sealed class SiteMsgService(BasicRepository<Sys_SiteMsg, long> rpo, Conte
public Task<long> CountAsync(QueryReq<QuerySiteMsgReq> req) public Task<long> CountAsync(QueryReq<QuerySiteMsgReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().CountAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -94,11 +90,7 @@ public sealed class SiteMsgService(BasicRepository<Sys_SiteMsg, long> rpo, Conte
public Task<bool> ExistAsync(QueryReq<QuerySiteMsgReq> req) public Task<bool> ExistAsync(QueryReq<QuerySiteMsgReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().AnyAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -143,9 +135,7 @@ public sealed class SiteMsgService(BasicRepository<Sys_SiteMsg, long> rpo, Conte
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var list = await QueryInternal(req) var list = await QueryInternal(req)
.Page(req.Page, req.PageSize) .Page(req.Page, req.PageSize)
#if DBTYPE_SQLSERVER .WithNoLockNoWait()
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Count(out var total) .Count(out var total)
.ToListAsync(a => new { .ToListAsync(a => new {
a.CreatedTime a.CreatedTime
@ -172,13 +162,7 @@ public sealed class SiteMsgService(BasicRepository<Sys_SiteMsg, long> rpo, Conte
public async Task<IEnumerable<QuerySiteMsgRsp>> QueryAsync(QueryReq<QuerySiteMsgReq> req) public async Task<IEnumerable<QuerySiteMsgRsp>> QueryAsync(QueryReq<QuerySiteMsgReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req) var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Take(req.Count)
.ToListAsync()
.ConfigureAwait(false);
return ret.Adapt<IEnumerable<QuerySiteMsgRsp>>(); return ret.Adapt<IEnumerable<QuerySiteMsgRsp>>();
} }
@ -295,9 +279,7 @@ public sealed class SiteMsgService(BasicRepository<Sys_SiteMsg, long> rpo, Conte
var roleIds = contextUserInfo.Roles.Select(x => x.Id).ToList(); var roleIds = contextUserInfo.Roles.Select(x => x.Id).ToList();
return Rpo.Orm.Select<Sys_SiteMsg, Sys_User, Sys_SiteMsgDept, Sys_SiteMsgRole, Sys_SiteMsgUser, Sys_SiteMsgFlag>() return Rpo.Orm.Select<Sys_SiteMsg, Sys_User, Sys_SiteMsgDept, Sys_SiteMsgRole, Sys_SiteMsgUser, Sys_SiteMsgFlag>()
#if DBTYPE_SQLSERVER .WithNoLockNoWait()
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.LeftJoin((a, b, _, _, _, _) => a.CreatedUserId == b.Id) .LeftJoin((a, b, _, _, _, _) => a.CreatedUserId == b.Id)
.LeftJoin((a, _, c, _, _, _) => a.Id == c.SiteMsgId) .LeftJoin((a, _, c, _, _, _) => a.Id == c.SiteMsgId)
.LeftJoin((a, _, _, d, _, _) => a.Id == d.SiteMsgId) .LeftJoin((a, _, _, d, _, _) => a.Id == d.SiteMsgId)

View File

@ -25,11 +25,7 @@ public sealed class SiteMsgUserService(BasicRepository<Sys_SiteMsgUser, long> rp
public Task<long> CountAsync(QueryReq<QuerySiteMsgUserReq> req) public Task<long> CountAsync(QueryReq<QuerySiteMsgUserReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().CountAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -51,11 +47,7 @@ public sealed class SiteMsgUserService(BasicRepository<Sys_SiteMsgUser, long> rp
public Task<bool> ExistAsync(QueryReq<QuerySiteMsgUserReq> req) public Task<bool> ExistAsync(QueryReq<QuerySiteMsgUserReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().AnyAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -77,14 +69,7 @@ public sealed class SiteMsgUserService(BasicRepository<Sys_SiteMsgUser, long> rp
public async Task<PagedQueryRsp<QuerySiteMsgUserRsp>> PagedQueryAsync(PagedQueryReq<QuerySiteMsgUserReq> req) public async Task<PagedQueryRsp<QuerySiteMsgUserRsp>> PagedQueryAsync(PagedQueryReq<QuerySiteMsgUserReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var list = await QueryInternal(req) var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
.Page(req.Page, req.PageSize)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Count(out var total)
.ToListAsync()
.ConfigureAwait(false);
return new PagedQueryRsp<QuerySiteMsgUserRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QuerySiteMsgUserRsp>>()); return new PagedQueryRsp<QuerySiteMsgUserRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QuerySiteMsgUserRsp>>());
} }
@ -93,13 +78,7 @@ public sealed class SiteMsgUserService(BasicRepository<Sys_SiteMsgUser, long> rp
public async Task<IEnumerable<QuerySiteMsgUserRsp>> QueryAsync(QueryReq<QuerySiteMsgUserReq> req) public async Task<IEnumerable<QuerySiteMsgUserRsp>> QueryAsync(QueryReq<QuerySiteMsgUserReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req) var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Take(req.Count)
.ToListAsync()
.ConfigureAwait(false);
return ret.Adapt<IEnumerable<QuerySiteMsgUserRsp>>(); return ret.Adapt<IEnumerable<QuerySiteMsgUserRsp>>();
} }

View File

@ -44,11 +44,7 @@ public sealed class UserProfileService(BasicRepository<Sys_UserProfile, long> rp
public Task<long> CountAsync(QueryReq<QueryUserProfileReq> req) public Task<long> CountAsync(QueryReq<QueryUserProfileReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().CountAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -78,11 +74,7 @@ public sealed class UserProfileService(BasicRepository<Sys_UserProfile, long> rp
public Task<bool> ExistAsync(QueryReq<QueryUserProfileReq> req) public Task<bool> ExistAsync(QueryReq<QueryUserProfileReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().AnyAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -113,9 +105,7 @@ public sealed class UserProfileService(BasicRepository<Sys_UserProfile, long> rp
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var list = await QueryInternal(req) var list = await QueryInternal(req)
.Page(req.Page, req.PageSize) .Page(req.Page, req.PageSize)
#if DBTYPE_SQLSERVER .WithNoLockNoWait()
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Count(out var total) .Count(out var total)
.ToListAsync((a, b, c, d, e) => new { .ToListAsync((a, b, c, d, e) => new {
a a
@ -141,9 +131,7 @@ public sealed class UserProfileService(BasicRepository<Sys_UserProfile, long> rp
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req) var ret = await QueryInternal(req)
#if DBTYPE_SQLSERVER .WithNoLockNoWait()
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Take(req.Count) .Take(req.Count)
.ToListAsync((a, b, c, d, e) => new { .ToListAsync((a, b, c, d, e) => new {
a a

View File

@ -68,11 +68,7 @@ public sealed class UserService(
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
#pragma warning disable VSTHRD103 #pragma warning disable VSTHRD103
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().CountAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
#pragma warning restore VSTHRD103 #pragma warning restore VSTHRD103
} }
@ -136,7 +132,7 @@ public sealed class UserService(
ignoreCols.Add(nameof(Sys_User.Password)); ignoreCols.Add(nameof(Sys_User.Password));
} }
_ = await UpdateAsync(entity, null, ignoreCols.ToArray()).ConfigureAwait(false); _ = await UpdateAsync(entity, null, ignoreCols).ConfigureAwait(false);
// 档案表 // 档案表
if (req.Profile != null) { if (req.Profile != null) {
@ -146,7 +142,7 @@ public sealed class UserService(
// 分表 // 分表
await Rpo.SaveManyAsync(entity, nameof(entity.Roles)).ConfigureAwait(false); await Rpo.SaveManyAsync(entity, nameof(entity.Roles)).ConfigureAwait(false);
var ret = (await QueryAsync(new QueryReq<QueryUserReq> { Filter = new QueryUserReq { Id = req.Id } }).ConfigureAwait(false)).First(); var ret = await GetAsync(new QueryUserReq { Id = req.Id }).ConfigureAwait(false);
// 发布用户更新事件 // 发布用户更新事件
await eventPublisher.PublishAsync(new UserUpdatedEvent(ret.Adapt<UserInfoRsp>())).ConfigureAwait(false); await eventPublisher.PublishAsync(new UserUpdatedEvent(ret.Adapt<UserInfoRsp>())).ConfigureAwait(false);
@ -235,9 +231,7 @@ public sealed class UserService(
var includeRoles = listUserExp == _listUserExp; var includeRoles = listUserExp == _listUserExp;
var select = await QueryInternalAsync(req, includeRoles).ConfigureAwait(false); var select = await QueryInternalAsync(req, includeRoles).ConfigureAwait(false);
IEnumerable<Sys_User> list = await select.Page(req.Page, req.PageSize) IEnumerable<Sys_User> list = await select.Page(req.Page, req.PageSize)
#if DBTYPE_SQLSERVER .WithNoLockNoWait()
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Count(out var total) .Count(out var total)
.ToListAsync(listUserExp) .ToListAsync(listUserExp)
.ConfigureAwait(false); .ConfigureAwait(false);
@ -252,12 +246,11 @@ public sealed class UserService(
public async Task<IEnumerable<QueryUserRsp>> QueryAsync(QueryReq<QueryUserReq> req) public async Task<IEnumerable<QueryUserRsp>> QueryAsync(QueryReq<QueryUserReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var list = await (await QueryInternalAsync(req, false).ConfigureAwait(false)) var list = await (await QueryInternalAsync(req, false).ConfigureAwait(false)).WithNoLockNoWait()
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Take(req.Count) .Take(req.Count)
.ToListAsync(a => new Sys_User { Id = a.Id, UserName = a.UserName }) .ToListAsync(a => new Sys_User {
Id = a.Id, UserName = a.UserName
})
.ConfigureAwait(false); .ConfigureAwait(false);
return list.Adapt<IEnumerable<QueryUserRsp>>(); return list.Adapt<IEnumerable<QueryUserRsp>>();
} }
@ -418,63 +411,29 @@ public sealed class UserService(
/// <inheritdoc /> /// <inheritdoc />
public async Task<UserInfoRsp> UserInfoAsync() public async Task<UserInfoRsp> UserInfoAsync()
{ {
static void OtherIncludes(ISelect<Sys_Role> select)
{
select.Where(a => a.Enabled)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.IncludeMany( //
a => a.Menus
#if DBTYPE_SQLSERVER
#pragma warning disable SA1115
, then => then.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#pragma warning restore SA1115
#endif
#pragma warning disable SA1009, SA1111
)
#pragma warning restore SA1111, SA1009
.IncludeMany( //
a => a.Depts
#if DBTYPE_SQLSERVER
#pragma warning disable SA1115
, then => then.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#pragma warning restore SA1115
#endif
#pragma warning disable SA1009, SA1111
)
#pragma warning restore SA1111, SA1009
.IncludeMany( //
a => a.Apis
#if DBTYPE_SQLSERVER
#pragma warning disable SA1115
, then => then.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#pragma warning restore SA1115
#endif
#pragma warning disable SA1009, SA1111
)
#pragma warning restore SA1111, SA1009
;
}
var dbUser = await Rpo.Where(a => a.Token == UserToken.Token && a.Enabled) var dbUser = await Rpo.Where(a => a.Token == UserToken.Token && a.Enabled)
#if DBTYPE_SQLSERVER .WithNoLockNoWait()
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Include(a => a.Dept) .Include(a => a.Dept)
.IncludeMany(a => a.Roles, OtherIncludes) .IncludeMany(a => a.Roles, OtherIncludes)
.ToOneAsync() .ToOneAsync()
.ConfigureAwait(false); .ConfigureAwait(false);
return dbUser.Adapt<UserInfoRsp>(); return dbUser.Adapt<UserInfoRsp>();
static void OtherIncludes(ISelect<Sys_Role> select)
{
_ = select.Where(a => a.Enabled)
.WithNoLockNoWait()
.IncludeMany(a => a.Menus, then => then.WithNoLockNoWait())
.IncludeMany(a => a.Depts, then => then.WithNoLockNoWait())
.IncludeMany(a => a.Apis, then => then.WithNoLockNoWait());
}
} }
private async Task<Dictionary<long, string>> CreateEditCheckAsync(CreateEditUserReq req) private async Task<Dictionary<long, string>> CreateEditCheckAsync(CreateEditUserReq req)
{ {
// 检查角色是否存在 // 检查角色是否存在
var roles = await Rpo.Orm.Select<Sys_Role>() var roles = await Rpo.Orm.Select<Sys_Role>()
#if DBTYPE_SQLSERVER .WithNoLockNoWait()
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Where(a => req.RoleIds.Contains(a.Id)) .Where(a => req.RoleIds.Contains(a.Id))
.ToDictionaryAsync(a => a.Id, a => a.DashboardLayout) .ToDictionaryAsync(a => a.Id, a => a.DashboardLayout)
.ConfigureAwait(false); .ConfigureAwait(false);
@ -483,13 +442,7 @@ public sealed class UserService(
} }
// 检查部门是否存在 // 检查部门是否存在
var dept = await Rpo.Orm.Select<Sys_Dept>() var dept = await Rpo.Orm.Select<Sys_Dept>().WithNoLockNoWait().Where(a => req.DeptId == a.Id).ToListAsync(a => a.Id).ConfigureAwait(false);
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Where(a => req.DeptId == a.Id)
.ToListAsync(a => a.Id)
.ConfigureAwait(false);
return dept.Count != 1 ? throw new NetAdminInvalidOperationException(Ln.) : roles; return dept.Count != 1 ? throw new NetAdminInvalidOperationException(Ln.) : roles;
} }

View File

@ -29,11 +29,7 @@ public sealed class VerifyCodeService(BasicRepository<Sys_VerifyCode, long> rpo,
public Task<long> CountAsync(QueryReq<QueryVerifyCodeReq> req) public Task<long> CountAsync(QueryReq<QueryVerifyCodeReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().CountAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -61,11 +57,7 @@ public sealed class VerifyCodeService(BasicRepository<Sys_VerifyCode, long> rpo,
public Task<bool> ExistAsync(QueryReq<QueryVerifyCodeReq> req) public Task<bool> ExistAsync(QueryReq<QueryVerifyCodeReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
return QueryInternal(req) return QueryInternal(req).WithNoLockNoWait().AnyAsync();
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -87,14 +79,7 @@ public sealed class VerifyCodeService(BasicRepository<Sys_VerifyCode, long> rpo,
public async Task<PagedQueryRsp<QueryVerifyCodeRsp>> PagedQueryAsync(PagedQueryReq<QueryVerifyCodeReq> req) public async Task<PagedQueryRsp<QueryVerifyCodeRsp>> PagedQueryAsync(PagedQueryReq<QueryVerifyCodeReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var list = await QueryInternal(req) var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
.Page(req.Page, req.PageSize)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Count(out var total)
.ToListAsync()
.ConfigureAwait(false);
return new PagedQueryRsp<QueryVerifyCodeRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryVerifyCodeRsp>>()); return new PagedQueryRsp<QueryVerifyCodeRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryVerifyCodeRsp>>());
} }
@ -103,13 +88,7 @@ public sealed class VerifyCodeService(BasicRepository<Sys_VerifyCode, long> rpo,
public async Task<IEnumerable<QueryVerifyCodeRsp>> QueryAsync(QueryReq<QueryVerifyCodeReq> req) public async Task<IEnumerable<QueryVerifyCodeRsp>> QueryAsync(QueryReq<QueryVerifyCodeReq> req)
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req) var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Take(req.Count)
.ToListAsync()
.ConfigureAwait(false);
return ret.Adapt<IEnumerable<QueryVerifyCodeRsp>>(); return ret.Adapt<IEnumerable<QueryVerifyCodeRsp>>();
} }
@ -180,9 +159,7 @@ public sealed class VerifyCodeService(BasicRepository<Sys_VerifyCode, long> rpo,
, Value = destDevice , Value = destDevice
} }
}) })
#if DBTYPE_SQLSERVER .WithNoLockNoWait()
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.ToOneAsync(); .ToOneAsync();
} }

View File

@ -62,9 +62,9 @@ public static class ServiceCollectionExtensions
/// <summary> /// <summary>
/// 添加定时任务 /// 添加定时任务
/// </summary> /// </summary>
public static IServiceCollection AddSchedules(this IServiceCollection me) public static IServiceCollection AddSchedules(this IServiceCollection me, bool force = false)
{ {
return App.WebHostEnvironment.IsProduction() return App.WebHostEnvironment.IsProduction() || force
? me.AddSchedule( // ? me.AddSchedule( //
builder => builder // builder => builder //
.AddJob<ScheduledJob>(true, Triggers.PeriodSeconds(1).SetRunOnStart(true)) .AddJob<ScheduledJob>(true, Triggers.PeriodSeconds(1).SetRunOnStart(true))

View File

@ -117,7 +117,7 @@ public sealed class ScheduledJob : WorkBase<ScheduledJob>, IJob
_ = await jobRecordService.CreateAsync(jobRecord).ConfigureAwait(false); _ = await jobRecordService.CreateAsync(jobRecord).ConfigureAwait(false);
await jobService.FinishJobAsync(job.Adapt<FinishJobReq>() with // await jobService.FinishJobAsync(job.Adapt<FinishJobReq>() with //
{ {
LastStatusCode = rsp.StatusCode // LastStatusCode = (int?)rsp.StatusCode //
, LastDuration = jobRecord.Duration , LastDuration = jobRecord.Duration
}) })
.ConfigureAwait(false); .ConfigureAwait(false);

View File

@ -0,0 +1,183 @@
using NetAdmin.Domain.Dto.Sys.Doc.Catalog;
using NetAdmin.Domain.Dto.Sys.Doc.Content;
namespace UnitTests.Sys;
/// <summary>
/// 文档测试
/// </summary>
[SuppressMessage("Usage", "xUnit1026:Theory methods should use all of their parameters")]
[SuppressMessage("Usage", "xUnit1028:Test method must have valid return type")]
public class DocTests(WebTestApplicationFactory<Startup> factory, ITestOutputHelper testOutputHelper)
: WebApiTestBase<Startup>(factory, testOutputHelper), IDocModule
{
/// <inheritdoc />
[InlineData(default)]
[Theory]
public async Task<int> BulkDeleteCatalogAsync(BulkReq<DelReq> req)
{
var rsp = await PostJsonAsync(typeof(DocController), req);
Assert.True(rsp.IsSuccessStatusCode);
return default;
}
/// <inheritdoc />
[InlineData(default)]
[Theory]
public async Task<int> BulkDeleteContentAsync(BulkReq<DelReq> req)
{
var rsp = await PostJsonAsync(typeof(DocController), req);
Assert.True(rsp.IsSuccessStatusCode);
return default;
}
/// <inheritdoc />
[InlineData(default)]
[Theory]
public async Task<QueryDocCatalogRsp> CreateCatalogAsync(CreateDocCatalogReq req)
{
var rsp = await PostJsonAsync(typeof(DocController), req);
Assert.True(rsp.IsSuccessStatusCode);
return default;
}
/// <inheritdoc />
[InlineData(default)]
[Theory]
public async Task<QueryDocContentRsp> CreateContentAsync(CreateDocContentReq req)
{
var rsp = await PostJsonAsync(typeof(DocController), req);
Assert.True(rsp.IsSuccessStatusCode);
return default;
}
/// <inheritdoc />
[InlineData(default)]
[Theory]
public async Task<int> DeleteCatalogAsync(DelReq req)
{
var rsp = await PostJsonAsync(typeof(DocController), req);
Assert.True(rsp.IsSuccessStatusCode);
return default;
}
/// <inheritdoc />
[InlineData(default)]
[Theory]
public async Task<int> DeleteContentAsync(DelReq req)
{
var rsp = await PostJsonAsync(typeof(DocController), req);
Assert.True(rsp.IsSuccessStatusCode);
return default;
}
/// <inheritdoc />
[InlineData(default)]
[Theory]
public async Task<int> EditCatalogAsync(EditDocCatalogReq req)
{
var rsp = await PostJsonAsync(typeof(DocController), req);
Assert.True(rsp.IsSuccessStatusCode);
return default;
}
/// <inheritdoc />
[InlineData(default)]
[Theory]
public async Task<QueryDocContentRsp> EditContentAsync(EditDocContentReq req)
{
var rsp = await PostJsonAsync(typeof(DocController), req);
Assert.True(rsp.IsSuccessStatusCode);
return default;
}
/// <inheritdoc />
[InlineData(default)]
[Theory]
public async Task<IActionResult> ExportContentAsync(QueryReq<QueryDocContentReq> req)
{
var rsp = await PostJsonAsync(typeof(DocController), req);
Assert.True(rsp.IsSuccessStatusCode);
return default;
}
/// <inheritdoc />
[InlineData(default)]
[Theory]
public async Task<QueryDocCatalogRsp> GetCatalogAsync(QueryDocCatalogReq req)
{
var rsp = await PostJsonAsync(typeof(DocController), req);
Assert.True(rsp.IsSuccessStatusCode);
return default;
}
/// <inheritdoc />
[InlineData(default)]
[Theory]
public async Task<QueryDocContentRsp> GetContentAsync(QueryDocContentReq req)
{
var rsp = await PostJsonAsync(typeof(DocController), req);
Assert.True(rsp.IsSuccessStatusCode);
return default;
}
/// <inheritdoc />
[InlineData(default)]
[Theory]
public async Task<PagedQueryRsp<QueryDocCatalogRsp>> PagedQueryCatalogAsync(PagedQueryReq<QueryDocCatalogReq> req)
{
var rsp = await PostJsonAsync(typeof(DocController), req);
Assert.True(rsp.IsSuccessStatusCode);
return default;
}
/// <inheritdoc />
[InlineData(default)]
[Theory]
public async Task<PagedQueryRsp<QueryDocContentRsp>> PagedQueryContentAsync(PagedQueryReq<QueryDocContentReq> req)
{
var rsp = await PostJsonAsync(typeof(DocController), req);
Assert.True(rsp.IsSuccessStatusCode);
return default;
}
/// <inheritdoc />
[InlineData(default)]
[Theory]
public async Task<IEnumerable<QueryDocCatalogRsp>> QueryCatalogAsync(QueryReq<QueryDocCatalogReq> req)
{
var rsp = await PostJsonAsync(typeof(DocController), req);
Assert.True(rsp.IsSuccessStatusCode);
return default;
}
/// <inheritdoc />
[InlineData(default)]
[Theory]
public async Task<IEnumerable<QueryDocContentRsp>> QueryContentAsync(QueryReq<QueryDocContentReq> req)
{
var rsp = await PostJsonAsync(typeof(DocController), req);
Assert.True(rsp.IsSuccessStatusCode);
return default;
}
/// <inheritdoc />
[InlineData(default)]
[Theory]
public async Task<int> SetEnabledAsync(SetDocContentEnabledReq req)
{
var rsp = await PostJsonAsync(typeof(DocController), req);
Assert.True(rsp.IsSuccessStatusCode);
return default;
}
/// <inheritdoc />
[InlineData(default)]
[Theory]
public async Task<QueryDocContentRsp> ViewContentAsync(QueryDocContentReq req)
{
var rsp = await PostJsonAsync(typeof(DocController), req);
Assert.True(rsp.IsSuccessStatusCode);
return default;
}
}

View File

@ -4,7 +4,4 @@
<ProjectReference Include="../YourSolution.AdmServer.Domain/YourSolution.AdmServer.Domain.csproj"/> <ProjectReference Include="../YourSolution.AdmServer.Domain/YourSolution.AdmServer.Domain.csproj"/>
<ProjectReference Include="../NetAdmin/NetAdmin.SysComponent.Application/NetAdmin.SysComponent.Application.csproj"/> <ProjectReference Include="../NetAdmin/NetAdmin.SysComponent.Application/NetAdmin.SysComponent.Application.csproj"/>
</ItemGroup> </ItemGroup>
<ItemGroup>
<PackageReference Include="MailKit" Version="4.8.0"/>
</ItemGroup>
</Project> </Project>

View File

@ -58,7 +58,7 @@ namespace YourSolution.AdmServer.Host
.EnableBuffering() // 启用请求体缓冲,允许多次读取请求体 .EnableBuffering() // 启用请求体缓冲,允许多次读取请求体
.UseMiddleware<RequestAuditMiddleware>() // 使用RequestAuditMiddleware中间件执行请求审计 .UseMiddleware<RequestAuditMiddleware>() // 使用RequestAuditMiddleware中间件执行请求审计
#if DEBUG #if DEBUG
.UseOpenApiSkin() // 使用OpenApiSkin中间件仅在调试模式下提供Swagger UI皮肤 .UseApiSkin() // 使用OpenApiSkin中间件仅在调试模式下提供Swagger UI皮肤
#else #else
.UseVueAdmin() // 托管管理后台,仅在非调试模式下 .UseVueAdmin() // 托管管理后台,仅在非调试模式下
.UsePrometheus() // 使用Prometheus中间件启用HTTP性能监控 .UsePrometheus() // 使用Prometheus中间件启用HTTP性能监控

View File

@ -12,7 +12,7 @@
<el-button <el-button
v-loading="loading" v-loading="loading"
:icon="item.icon" :icon="item.icon"
:title="item.title" :title="item.title ? $t(item.title) : ''"
:type="item.type" :type="item.type"
@click.native.stop @click.native.stop
size="small"></el-button> size="small"></el-button>
@ -22,7 +22,7 @@
v-else v-else
v-loading="loading" v-loading="loading"
:icon="item.icon" :icon="item.icon"
:title="item.title" :title="item.title ? $t(item.title) : ''"
:type="item.type" :type="item.type"
@click="click(item, row, vue)" @click="click(item, row, vue)"
size="small"> size="small">

View File

@ -11,7 +11,7 @@
<p v-if="$attrs.nestProp2">{{ $TOOL.getNestedProperty(row, $attrs.nestProp2) }}</p> <p v-if="$attrs.nestProp2">{{ $TOOL.getNestedProperty(row, $attrs.nestProp2) }}</p>
</div> </div>
</div> </div>
<save-dialog v-if="dialog.save" @closed="(dialog.save = false)" ref="saveDialog"></save-dialog> <save-dialog v-if="dialog.save" @closed="dialog.save = false" ref="saveDialog"></save-dialog>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>

View File

@ -293,7 +293,7 @@
</div> </div>
<template #footer> <template #footer>
<el-button @click="(dialogVisible = false)">{{ $t('取消') }}</el-button> <el-button @click="dialogVisible = false">{{ $t('取消') }}</el-button>
<el-button @click="submit()" type="primary">{{ $t('确认') }}</el-button> <el-button @click="submit()" type="primary">{{ $t('确认') }}</el-button>
</template> </template>
</el-dialog> </el-dialog>

View File

@ -49,7 +49,7 @@
</div> </div>
<template #footer> <template #footer>
<el-button @click="clear" text>{{ $t('清除') }}</el-button> <el-button @click="clear" text>{{ $t('清除') }}</el-button>
<el-button @click="(dialogVisible = false)">{{ $t('取消') }}</el-button> <el-button @click="dialogVisible = false">{{ $t('取消') }}</el-button>
</template> </template>
</el-dialog> </el-dialog>
</div> </div>

View File

@ -13,7 +13,7 @@
</el-form> </el-form>
<template #footer> <template #footer>
<el-button @click="(visible = false)">{{ $t('取消') }}</el-button> <el-button @click="visible = false">{{ $t('取消') }}</el-button>
<el-button @click="submit" type="primary">{{ $t('确定') }}</el-button> <el-button @click="submit" type="primary">{{ $t('确定') }}</el-button>
</template> </template>
</sc-dialog> </sc-dialog>

View File

@ -90,8 +90,8 @@
:hide-after="0" :hide-after="0"
:title="$t('列设置')" :title="$t('列设置')"
:width="500" :width="500"
@after-leave="(customColumnShow = false)" @after-leave="customColumnShow = false"
@show="(customColumnShow = true)" @show="customColumnShow = true"
placement="top" placement="top"
trigger="click"> trigger="click">
<template #reference> <template #reference>

View File

@ -51,7 +51,7 @@
<el-dialog v-model="cropperDialogVisible" :title="$t('剪裁')" :width="580" @closed="cropperClosed" destroy-on-close draggable> <el-dialog v-model="cropperDialogVisible" :title="$t('剪裁')" :width="580" @closed="cropperClosed" destroy-on-close draggable>
<sc-cropper :aspectRatio="aspectRatio" :compress="compress" :src="cropperFile.tempCropperFile" ref="cropper"></sc-cropper> <sc-cropper :aspectRatio="aspectRatio" :compress="compress" :src="cropperFile.tempCropperFile" ref="cropper"></sc-cropper>
<template #footer> <template #footer>
<el-button @click="(cropperDialogVisible = false)">{{ $t('取消') }}</el-button> <el-button @click="cropperDialogVisible = false">{{ $t('取消') }}</el-button>
<el-button @click="cropperSave" type="primary">{{ $t('确定') }}</el-button> <el-button @click="cropperSave" type="primary">{{ $t('确定') }}</el-button>
</template> </template>
</el-dialog> </el-dialog>

View File

@ -2,12 +2,14 @@ export default {
buttons: [ buttons: [
{ {
icon: 'el-icon-view', icon: 'el-icon-view',
title: '查看',
click: async (row, vue) => { click: async (row, vue) => {
vue.dialog.save = { row, mode: 'view' } vue.dialog.save = { row, mode: 'view' }
}, },
}, },
{ {
icon: 'el-icon-edit', icon: 'el-icon-edit',
title: '编辑',
click: async (row, vue) => { click: async (row, vue) => {
vue.dialog.save = { row, mode: 'edit' } vue.dialog.save = { row, mode: 'edit' }
}, },

View File

@ -53,7 +53,7 @@
</el-footer> </el-footer>
</el-container> </el-container>
<save-dialog v-if="dialog.save" @closed="(dialog.save = null)" @mounted="$refs.saveDialog.open(dialog.save)" ref="saveDialog"></save-dialog> <save-dialog v-if="dialog.save" @closed="dialog.save = null" @mounted="$refs.saveDialog.open(dialog.save)" ref="saveDialog"></save-dialog>
</template> </template>
<script> <script>

View File

@ -71,11 +71,11 @@
</div> </div>
<el-dialog v-model="searchVisible" :title="$t('搜索')" :width="700" center destroy-on-close> <el-dialog v-model="searchVisible" :title="$t('搜索')" :width="700" center destroy-on-close>
<search @success="(searchVisible = false)"></search> <search @success="searchVisible = false"></search>
</el-dialog> </el-dialog>
<el-drawer v-model="tasksVisible" :size="450" :title="$t('作业中心')" destroy-on-close> <el-drawer v-model="tasksVisible" :size="450" :title="$t('作业中心')" destroy-on-close>
<tasks :fail="failJobCnt" @closed="(tasksVisible = false)"></tasks> <tasks :fail="failJobCnt" @closed="tasksVisible = false"></tasks>
</el-drawer> </el-drawer>
</template> </template>

View File

@ -31,7 +31,7 @@
</el-form-item> </el-form-item>
<el-form-item label="" prop="agree"> <el-form-item label="" prop="agree">
<el-checkbox v-model="form.agree" label="">{{ $t('我已阅读并同意') }}</el-checkbox> <el-checkbox v-model="form.agree" label="">{{ $t('我已阅读并同意') }}</el-checkbox>
<span @click="(showAgree = true)" class="link">{{ $t('平台服务协议') }}</span> <span @click="showAgree = true" class="link">{{ $t('平台服务协议') }}</span>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-form v-if="stepActive === 1" :model="form" :rules="rules" ref="stepForm_1" size="large"> <el-form v-if="stepActive === 1" :model="form" :rules="rules" ref="stepForm_1" size="large">
@ -57,7 +57,7 @@
</el-form> </el-form>
<el-dialog v-model="showAgree" :title="$t('平台服务协议')" destroy-on-close> <el-dialog v-model="showAgree" :title="$t('平台服务协议')" destroy-on-close>
<template #footer> <template #footer>
<el-button @click="(showAgree = false)">{{ $t('取消') }}</el-button> <el-button @click="showAgree = false">{{ $t('取消') }}</el-button>
<el-button <el-button
@click=" @click="
() => { () => {

View File

@ -1,6 +1,5 @@
<template> <template>
<article v-if="doc" v-loading="loading" class="article"> <article v-if="doc" v-loading="loading" class="article">
<h1>{{ doc.title }}</h1>
<section <section
:class="this.$TOOL.data.get('APP_SET_DARK') || this.$CONFIG.APP_SET_DARK ? 'aie-theme-dark' : 'aie-theme-light'" :class="this.$TOOL.data.get('APP_SET_DARK') || this.$CONFIG.APP_SET_DARK ? 'aie-theme-dark' : 'aie-theme-light'"
ref="editor"></section> ref="editor"></section>
@ -12,10 +11,11 @@
import { AiEditor } from 'aieditor' import { AiEditor } from 'aieditor'
import 'aieditor/dist/style.css' import 'aieditor/dist/style.css'
import { defineAsyncComponent } from 'vue' import { defineAsyncComponent } from 'vue'
const notFound = defineAsyncComponent(() => import('@/layout/other/404.vue'))
import sysConfig from '@/config' import sysConfig from '@/config'
import tool from '@/utils/tool' import tool from '@/utils/tool'
const notFound = defineAsyncComponent(() => import('@/layout/other/404.vue'))
export default { export default {
components: { notFound }, components: { notFound },
data() { data() {
@ -31,11 +31,9 @@ export default {
if (this.doc) { if (this.doc) {
document.title = this.doc.title document.title = this.doc.title
const aiEditor = new AiEditor({ const aiEditor = new AiEditor({
editable: false,
element: this.$refs.editor, element: this.$refs.editor,
content: this.doc.body, content: `<h1 style="text-align:center">${this.doc.title}</h1>${this.doc.body}`,
onChange: (body) => {
this.doc.body = body.getHtml()
},
}) })
aiEditor.changeLang(this.$TOOL.data.get('APP_SET_LANG') || sysConfig.APP_SET_LANG) aiEditor.changeLang(this.$TOOL.data.get('APP_SET_LANG') || sysConfig.APP_SET_LANG)
} else { } else {
@ -51,11 +49,17 @@ export default {
display: flex; display: flex;
height: 100%; height: 100%;
flex-direction: column; flex-direction: column;
> h1 { > h1 {
padding: 1rem; padding: 1rem;
} }
> section { > section {
flex: 1; flex: 1;
} }
} }
.article:deep(.aie-container) {
border: none;
}
</style> </style>

View File

@ -12,7 +12,7 @@
}"> }">
<el-input <el-input
v-model="form.rows[index].value" v-model="form.rows[index].value"
:input="(form.rows[index].value = form.rows[index].value.replace(/[^0-9 ]/g, ''))" :input="form.rows[index].value = form.rows[index].value.replace(/[^0-9 ]/g, '')"
placeholder="请输入以空格分隔的24分栏布局如【24】或【12 12】或【8 8 8】"> placeholder="请输入以空格分隔的24分栏布局如【24】或【12 12】或【8 8 8】">
<template #append> <template #append>
<el-button @click.prevent="form.rows.splice(index, 1)" icon="delete">删除</el-button> <el-button @click.prevent="form.rows.splice(index, 1)" icon="delete">删除</el-button>

Some files were not shown because too many files have changed in this diff Show More