1 Commits

Author SHA1 Message Date
tk
661640d441 chore(release): 2.2.0 2024-11-27 16:54:26 +08:00
132 changed files with 945 additions and 690 deletions

View File

@ -1 +0,0 @@
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/NetAdmin.FreeSql"] [submodule "refs/FreeSql"]
path = refs/NetAdmin.FreeSql path = refs/FreeSql
url = https://github.com/nsnail/NetAdmin.FreeSql.git url = https://github.com/nsnail/FreeSql.git

View File

@ -2,28 +2,6 @@
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) ## [2.2.0](https://github.com/nsnail/NetAdmin/compare/v2.1.0...v2.2.0) (2024-11-27)

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-2024 nsnail</Copyright> <Copyright>© 2006-2023 nsnail</Copyright>
<Description>通用后台权限管理系统、快速开发框架基于C#13/.NET9、Vue3/Vite、ElementPlus等现代技术构建具有十分整洁、优雅的编码规范</Description> <Description>通用后台权限管理系统、快速开发框架基于C#12/.NET9、Vue3/Vite、Element Plus等现代技术构建具有十分整洁、优雅的编码规范</Description>
<EnableBaseIntermediateOutputPathMismatchWarning>false</EnableBaseIntermediateOutputPathMismatchWarning> <EnableBaseIntermediateOutputPathMismatchWarning>false</EnableBaseIntermediateOutputPathMismatchWarning>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>

View File

@ -1,42 +1,12 @@
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}") = "workflows", "workflows", "{BB5BB244-E7D2-4368-8C18-C1C0ED1E12D1}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "backend", "backend", "{4DAF9366-855F-46BB-AE4C-660C92FA0697}"
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
@ -56,14 +26,12 @@ 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
@ -81,10 +49,23 @@ 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}") = "backend", "backend", "{4DAF9366-855F-46BB-AE4C-660C92FA0697}" 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 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
@ -122,19 +103,23 @@ 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\NetAdmin.FreeSql\src\FreeSql\FreeSql.csproj", "{3C65DA42-877D-46FF-B754-C12214302A29}"#refs ##Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FreeSql", "refs\FreeSql\FreeSql\FreeSql.csproj", "{3C65DA42-877D-46FF-B754-C12214302A29}"#refs
##EndProject#refs ##EndProject#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 ##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
##EndProject#refs ##EndProject#refs
##Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FreeSql.DbContext", "refs\NetAdmin.FreeSql\src\FreeSql.DbContext\FreeSql.DbContext.csproj", "{FE03DF27-EC56-48DB-81B0-F99947259A7C}"#refs ##Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FreeSql.DbContext", "refs\FreeSql\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
@ -244,6 +229,5 @@ 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#13/.NET9、Vue3/Vite、ElementPlus等现代技术构建具有十分整洁、优雅的编码规范 通用后台权限管理系统、快速开发框架基于C#12/.NET9、Vue3/Vite、Element Plus等现代技术构建具有十分整洁、优雅的编码规范
[![.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,14 +28,15 @@ 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 插入种子数据-s 同步数据库结构 # -i 插入种子数据
# -s 同步数据库结构
# 浏览器访问 http://localhost:5010 将看到SwaggerKnife4jUI界面 # 浏览器访问 http://localhost:5010 将看到SwaggerKnife4jUI界面
# 5. 检查 nodejs 版本 >=20 # 5. 检查 nodejs 版本 >=20
@ -109,7 +110,7 @@ biz-infra-->infra
| C# | 自动化版本管理 | [MinVer](https://github.com/adamralph/minver) | | C# | 自动化版本管理 | [MinVer](https://github.com/adamralph/minver) |
| TypeScript | SPA基础框架 | [Vue](https://github.com/vuejs/core) | | TypeScript | SPA基础框架 | [Vue](https://github.com/vuejs/core) |
| TypeScript | 前端构建工具 | [Vite](https://github.com/vitejs/vite) | | TypeScript | 前端构建工具 | [Vite](https://github.com/vitejs/vite) |
| TypeScript | UI控件库 | [ElementPlus](https://github.com/element-plus/element-plus) | | TypeScript | UI控件库 | [Element Plus](https://github.com/element-plus/element-plus) |
| TypeScript | CSS解析器 | [Sass](https://github.com/sass/sass) | | TypeScript | CSS解析器 | [Sass](https://github.com/sass/sass) |
| TypeScript | 图表和数据可视化 | [ECharts](https://github.com/apache/echarts) | | TypeScript | 图表和数据可视化 | [ECharts](https://github.com/apache/echarts) |
| JavaScript | 后台管理界面 | [SCUI](https://gitee.com/lolicode/scui) | | JavaScript | 后台管理界面 | [SCUI](https://gitee.com/lolicode/scui) |
@ -117,4 +118,4 @@ biz-infra-->infra
| JavaScript | JavaScript解析器 | [Terser](https://github.com/terser/terser) | | JavaScript | JavaScript解析器 | [Terser](https://github.com/terser/terser) |
| JavaScript | 代码质量检查 | [ESLint](https://github.com/eslint/eslint) | | JavaScript | 代码质量检查 | [ESLint](https://github.com/eslint/eslint) |
| JavaScript | 代码格式化工具 | [Prettier](https://github.com/prettier/prettier) | | JavaScript | 代码格式化工具 | [Prettier](https://github.com/prettier/prettier) |
| JavaScript | 标准加密库 | [crypto-js](https://github.com/brix/crypto-js) | | JavaScript | 标准加密库 | [crypto-js](https://github.com/brix/crypto-js) |

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": "https://element-plus.org/zh-CN/component/overview.html", "Path": "http://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#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>", "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>",
"CreatedUserId": 370942943322181, "CreatedUserId": 370942943322181,
"CreatedUserName": "root", "CreatedUserName": "root",
"MsgType": 2, "MsgType": 2,
"Summary": "尊敬的用户:\n欢迎您使用 NetAdmin 后台管理系统NetAdmin 是一款通用后台权限管理系统和快速开发框架,它基于 C#13/.NET9、Vue3/Vite、ElementPlus 等现代", "Summary": "尊敬的用户:\n欢迎您使用 NetAdmin 后台管理系统NetAdmin 是一款通用后台权限管理系统和快速开发框架,它基于 C#12/.NET9、Vue3/Vite、Element Plus 等现代",
"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="10.3.0.106239"> <PackageReference Include="SonarAnalyzer.CSharp" Version="9.32.0.97167">
<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.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

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

1
refs/FreeSql Submodule

Submodule refs/FreeSql added at 6ea7ac8e50

View File

@ -1,3 +0,0 @@
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,7 +5,8 @@ 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}*", SearchOption.AllDirectories).Where(x => !x.Contains(".git"))) foreach (var path in Directory.EnumerateDirectories("../", $"*{oldName}*",
SearchOption.AllDirectories))
{ {
Console.Write($"{path} --> "); Console.Write($"{path} --> ");
var newPath = path.Replace(oldName, newName); var newPath = path.Replace(oldName, newName);
@ -15,7 +16,7 @@ foreach (var path in Directory.EnumerateDirectories("../", $"*{oldName}*", Searc
Console.WriteLine(); Console.WriteLine();
foreach (var path in Directory.EnumerateFiles("../", $"*.*", SearchOption.AllDirectories).Where(x => !x.Contains(".git"))) foreach (var path in Directory.EnumerateFiles("../", $"*.*", SearchOption.AllDirectories))
{ {
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,20 +45,6 @@ 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,7 +50,11 @@ 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).WithNoLockNoWait().Take(Numbers.MAX_LIMIT_EXPORT); var select = selector(query)
#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);
@ -69,8 +73,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 //
, List<string> includeFields = null // , IEnumerable<string> includeFields //
, List<string> excludeFields = null // , 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)
@ -94,8 +98,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 //
, List<string> includeFields = null // , IEnumerable<string> includeFields //
, List<string> excludeFields = null // , 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)
@ -132,22 +136,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(TEntity entity, List<string> includeFields, List<string> excludeFields, bool ignoreVersion) private IUpdate<TEntity> BuildUpdate( //
TEntity entity //
, IEnumerable<string> includeFields //
, string[] excludeFields = null //
, bool ignoreVersion = false)
{ {
IUpdate<TEntity> updateExp; var updateExp = includeFields == null
if (includeFields.NullOrEmpty()) { ? Rpo.UpdateDiy.SetSource(entity)
updateExp = Rpo.UpdateDiy.SetSource(entity); : Rpo.UpdateDiy.SetDto(includeFields!.ToDictionary(
if (!excludeFields.NullOrEmpty()) { x => x, x => typeof(TEntity).GetProperty(x, BindingFlags.Public | BindingFlags.Instance)!.GetValue(entity)));
updateExp = updateExp.IgnoreColumns(excludeFields.ToArray()); if (excludeFields != null) {
} updateExp = updateExp.IgnoreColumns(excludeFields);
} }
else {
updateExp = Rpo.UpdateDiy.SetDto(includeFields!.ToDictionary( if (!ignoreVersion && entity is IFieldVersion ver) {
x => x updateExp = updateExp.Where($"{nameof(IFieldVersion.Version)} = @version", new { version = ver.Version });
, x => typeof(TEntity).GetProperty(x, BindingFlags.Public | BindingFlags.Instance)!.GetValue(entity)));
if (!ignoreVersion && entity is IFieldVersion ver) {
updateExp = updateExp.Where($"{nameof(IFieldVersion.Version)} = {ver.Version}");
}
} }
return updateExp; return updateExp;

View File

@ -28,7 +28,11 @@ 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).WithNoLockNoWait().CountAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -50,7 +54,11 @@ 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).WithNoLockNoWait().AnyAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -72,7 +80,14 @@ 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).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false); var list = await QueryInternal(req)
.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>>());
} }
@ -81,7 +96,13 @@ 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).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false); var ret = await QueryInternal(req)
#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,7 +11,11 @@ public record Sys_DocContent : VersionEntity, IFieldEnabled, IFieldOwner
/// <summary> /// <summary>
/// 文档正文 /// 文档正文
/// </summary> /// </summary>
[Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)] #if DBTYPE_SQLSERVER
[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(DbType = Chars.FLG_DB_FIELD_TYPE_SMALL_INT)] [Column]
[CsvIgnore] [CsvIgnore]
[JsonIgnore] [JsonIgnore]
public int? LastStatusCode { get; init; } public HttpStatusCode? LastStatusCode { get; init; }
/// <summary> /// <summary>
/// 下次执行时间 /// 下次执行时间
@ -99,7 +99,11 @@ public record Sys_Job : VersionEntity, IFieldEnabled, IFieldSummary
/// <summary> /// <summary>
/// 请求体 /// 请求体
/// </summary> /// </summary>
[Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)] #if DBTYPE_SQLSERVER
[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; }
@ -107,7 +111,11 @@ public record Sys_Job : VersionEntity, IFieldEnabled, IFieldSummary
/// <summary> /// <summary>
/// 请求头 /// 请求头
/// </summary> /// </summary>
[Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)] #if DBTYPE_SQLSERVER
[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; }
@ -115,7 +123,11 @@ public record Sys_Job : VersionEntity, IFieldEnabled, IFieldSummary
/// <summary> /// <summary>
/// 请求的网络地址 /// 请求的网络地址
/// </summary> /// </summary>
[Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)] #if DBTYPE_SQLSERVER
[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; }
@ -131,7 +143,11 @@ 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,7 +53,11 @@ public record Sys_JobRecord : LiteImmutableEntity
/// <summary> /// <summary>
/// 请求体 /// 请求体
/// </summary> /// </summary>
[Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)] #if DBTYPE_SQLSERVER
[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; }
@ -61,7 +65,11 @@ public record Sys_JobRecord : LiteImmutableEntity
/// <summary> /// <summary>
/// 请求头 /// 请求头
/// </summary> /// </summary>
[Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)] #if DBTYPE_SQLSERVER
[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; }
@ -77,7 +85,11 @@ public record Sys_JobRecord : LiteImmutableEntity
/// <summary> /// <summary>
/// 响应体 /// 响应体
/// </summary> /// </summary>
[Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)] #if DBTYPE_SQLSERVER
[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; }
@ -85,7 +97,11 @@ public record Sys_JobRecord : LiteImmutableEntity
/// <summary> /// <summary>
/// 响应头 /// 响应头
/// </summary> /// </summary>
[Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)] #if DBTYPE_SQLSERVER
[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,7 +28,11 @@ 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; }
@ -92,7 +96,11 @@ public record Sys_LoginLog : SimpleEntity, IFieldCreatedTime, IFieldOwner, IFiel
/// <summary> /// <summary>
/// 请求内容 /// 请求内容
/// </summary> /// </summary>
[Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)] #if DBTYPE_SQLSERVER
[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; }
@ -100,7 +108,11 @@ public record Sys_LoginLog : SimpleEntity, IFieldCreatedTime, IFieldOwner, IFiel
/// <summary> /// <summary>
/// 请求头信息 /// 请求头信息
/// </summary> /// </summary>
[Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)] #if DBTYPE_SQLSERVER
[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; }
@ -116,7 +128,11 @@ public record Sys_LoginLog : SimpleEntity, IFieldCreatedTime, IFieldOwner, IFiel
/// <summary> /// <summary>
/// 响应内容 /// 响应内容
/// </summary> /// </summary>
[Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)] #if DBTYPE_SQLSERVER
[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; }
@ -124,7 +140,11 @@ public record Sys_LoginLog : SimpleEntity, IFieldCreatedTime, IFieldOwner, IFiel
/// <summary> /// <summary>
/// 响应头 /// 响应头
/// </summary> /// </summary>
[Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)] #if DBTYPE_SQLSERVER
[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,7 +18,11 @@ 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; }
@ -34,7 +38,11 @@ public record Sys_RequestLogDetail : SimpleEntity, IFieldCreatedTime, IFieldCrea
/// <summary> /// <summary>
/// 异常信息 /// 异常信息
/// </summary> /// </summary>
[Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)] #if DBTYPE_SQLSERVER
[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; }
@ -42,7 +50,11 @@ public record Sys_RequestLogDetail : SimpleEntity, IFieldCreatedTime, IFieldCrea
/// <summary> /// <summary>
/// 请求内容 /// 请求内容
/// </summary> /// </summary>
[Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)] #if DBTYPE_SQLSERVER
[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; }
@ -58,7 +70,11 @@ public record Sys_RequestLogDetail : SimpleEntity, IFieldCreatedTime, IFieldCrea
/// <summary> /// <summary>
/// 请求头信息 /// 请求头信息
/// </summary> /// </summary>
[Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)] #if DBTYPE_SQLSERVER
[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; }
@ -74,7 +90,11 @@ public record Sys_RequestLogDetail : SimpleEntity, IFieldCreatedTime, IFieldCrea
/// <summary> /// <summary>
/// 响应内容 /// 响应内容
/// </summary> /// </summary>
[Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)] #if DBTYPE_SQLSERVER
[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; }
@ -90,7 +110,11 @@ public record Sys_RequestLogDetail : SimpleEntity, IFieldCreatedTime, IFieldCrea
/// <summary> /// <summary>
/// 响应头 /// 响应头
/// </summary> /// </summary>
[Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)] #if DBTYPE_SQLSERVER
[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,7 +21,11 @@ public record Sys_Role : VersionEntity, IFieldSort, IFieldEnabled, IFieldSummary
/// <summary> /// <summary>
/// 仪表板布局 /// 仪表板布局
/// </summary> /// </summary>
[Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)] #if DBTYPE_SQLSERVER
[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,7 +12,11 @@ public record Sys_SiteMsg : VersionEntity, IRegister, IFieldSummary
/// <summary> /// <summary>
/// 消息内容 /// 消息内容
/// </summary> /// </summary>
[Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)] #if DBTYPE_SQLSERVER
[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,7 +11,11 @@ public record Sys_UserProfile : VersionEntity, IRegister
/// <summary> /// <summary>
/// 应用配置 /// 应用配置
/// </summary> /// </summary>
[Column(DbType = Chars.FLGL_DB_FIELD_TYPE_VARCHAR_MAX)] #if DBTYPE_SQLSERVER
[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,11 +20,13 @@ 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
, _ => base.LastStatusCode.Value == Numbers.HTTP_STATUS_BIZ_FAIL , _ => (int)base.LastStatusCode.Value == Numbers.HTTP_STATUS_BIZ_FAIL
? nameof(ErrorCodes.Unhandled).ToLowerCamelCase() ? nameof(ErrorCodes.Unhandled).ToLowerCamelCase()
: ((HttpStatusCode)base.LastStatusCode.Value).ToString().ToLowerCamelCase() : 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="NetAdmin.CsvHelper" Version="1.0.0"/> <PackageReference Include="CsvHelper.NS" Version="33.0.2-ns2"/>
<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 NetAdmin.ApiSkin; using IGeekFan.AspNetCore.Knife4jUI;
#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 UseApiSkin(this IApplicationBuilder me) public static IApplicationBuilder UseOpenApiSkin(this IApplicationBuilder me)
{ {
return me.UseApiSkin(options => { return me.UseKnife4UI(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="NetAdmin.ApiSkin" Condition="'$(Configuration)' == 'Debug'" Version="1.0.0"/> <PackageReference Include="IGeekFan.AspNetCore.Knife4jUI.NS" Condition="'$(Configuration)' == 'Debug'" Version="0.0.15-ns3"/>
<PackageReference Include="NetAdmin.Spectre.Console.Cli" Version="1.0.0"/> <PackageReference Include="Spectre.Console.Cli.NS" Version="0.45.1-preview.0.179"/>
<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,6 +41,7 @@ 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);
@ -80,14 +81,6 @@ 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

@ -1,100 +0,0 @@
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,18 +3,19 @@
<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="NetAdmin.FreeSql.DbContext" Version="1.0.2" Label="refs"/> <PackageReference Include="FreeSql.DbContext.NS" Version="3.2.833-ns6" Label="refs"/>
<PackageReference Include="NetAdmin.FreeSql.Provider.Sqlite" Version="1.0.2" Label="refs"/> <PackageReference Include="FreeSql.Provider.Sqlite.NS" Version="3.2.833-ns6" Label="refs"/>
<PackageReference Include="Gurion" Version="1.2.5" Label="refs"/> <PackageReference Include="Gurion" Version="1.2.2" 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/NetAdmin.FreeSql/src/FreeSql.DbContext/FreeSql.DbContext.csproj" Label="refs"/>--> <!--<ProjectReference Include="$(SolutionDir)/refs/FreeSql/FreeSql.DbContext/FreeSql.DbContext.csproj" Label="refs"/>-->
<!--<ProjectReference Include="$(SolutionDir)/refs/NetAdmin.FreeSql/src/FreeSql/FreeSql.csproj" Label="refs"/>--> <!--<ProjectReference Include="$(SolutionDir)/refs/FreeSql/FreeSql/FreeSql.csproj" Label="refs"/>-->
<!--<ProjectReference Include="$(SolutionDir)/refs/NetAdmin.FreeSql/src/FreeSql.Provider.Sqlite/FreeSql.Provider.Sqlite.csproj" Label="refs"/>--> <!--<ProjectReference Include="$(SolutionDir)/refs/FreeSql/Providers/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,7 +21,11 @@ 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).WithNoLockNoWait().CountAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -42,7 +46,11 @@ 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).WithNoLockNoWait().AnyAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />

View File

@ -25,7 +25,11 @@ 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).WithNoLockNoWait().CountAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -60,7 +64,11 @@ 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).WithNoLockNoWait().AnyAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -89,7 +97,14 @@ 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).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false); var list = await QueryInternal(req)
.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>>());
} }
@ -98,7 +113,13 @@ 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).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false); var ret = await QueryInternal(req)
#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,7 +25,11 @@ 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).WithNoLockNoWait().CountAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -76,7 +80,11 @@ 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).WithNoLockNoWait().AnyAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -105,7 +113,12 @@ 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).WithNoLockNoWait().ToTreeListAsync().ConfigureAwait(false)).Adapt<IEnumerable<QueryDeptRsp>>(); return (await QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.ToTreeListAsync()
.ConfigureAwait(false)).Adapt<IEnumerable<QueryDeptRsp>>();
} }
/// <inheritdoc /> /// <inheritdoc />

View File

@ -25,7 +25,11 @@ 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).WithNoLockNoWait().CountAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -33,7 +37,12 @@ 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).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)) { if (req.ParentId != 0 && !await Rpo.Where(a => a.Id == req.ParentId)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync()
.ConfigureAwait(false)) {
throw new NetAdminInvalidOperationException(Ln.); throw new NetAdminInvalidOperationException(Ln.);
} }
@ -54,7 +63,12 @@ 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).WithNoLockNoWait().AnyAsync().ConfigureAwait(false) return req.ParentId == 0 || await Rpo.Where(a => a.Id == req.ParentId)
#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.);
} }
@ -63,7 +77,11 @@ 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).WithNoLockNoWait().AnyAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -85,7 +103,14 @@ 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).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false); var list = await QueryInternal(req)
.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>>());
} }
@ -94,7 +119,12 @@ 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).WithNoLockNoWait().ToTreeListAsync().ConfigureAwait(false); var ret = await QueryInternal(req)
#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,7 +25,11 @@ 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).WithNoLockNoWait().CountAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -33,7 +37,13 @@ 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>().Where(a => a.Id == req.CatalogId).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)) { if (!await Rpo.Orm.Select<Sys_DicCatalog>()
.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.);
} }
@ -53,7 +63,13 @@ 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>().Where(a => a.Id == req.CatalogId).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)) { if (!await Rpo.Orm.Select<Sys_DicCatalog>()
.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.);
} }
@ -70,7 +86,11 @@ 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).WithNoLockNoWait().AnyAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -92,7 +112,14 @@ 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).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false); var list = await QueryInternal(req)
.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>>());
} }
@ -101,7 +128,13 @@ 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).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false); var ret = await QueryInternal(req)
#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>>();
} }
@ -109,7 +142,9 @@ 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>()
.WithNoLockNoWait() #if DBTYPE_SQLSERVER
.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,7 +25,11 @@ 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).WithNoLockNoWait().CountAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -33,7 +37,12 @@ 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).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)) { if (req.ParentId != 0 && !await Rpo.Where(a => a.Id == req.ParentId)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync()
.ConfigureAwait(false)) {
throw new NetAdminInvalidOperationException(Ln.); throw new NetAdminInvalidOperationException(Ln.);
} }
@ -54,7 +63,12 @@ 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).WithNoLockNoWait().AnyAsync().ConfigureAwait(false) return req.ParentId == 0 || await Rpo.Where(a => a.Id == req.ParentId)
#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.);
} }
@ -63,7 +77,11 @@ 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).WithNoLockNoWait().AnyAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -85,7 +103,14 @@ 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).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false); var list = await QueryInternal(req)
.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>>());
} }
@ -94,7 +119,12 @@ 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).WithNoLockNoWait().ToTreeListAsync().ConfigureAwait(false); var ret = await QueryInternal(req)
#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,9 +1,7 @@
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;
@ -29,7 +27,11 @@ 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).WithNoLockNoWait().CountAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -37,7 +39,13 @@ 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>().Where(a => a.Id == req.CatalogId).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)) { if (!await Rpo.Orm.Select<Sys_DocCatalog>()
.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.);
} }
@ -57,7 +65,13 @@ 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>().Where(a => a.Id == req.CatalogId).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)) { if (!await Rpo.Orm.Select<Sys_DocCatalog>()
.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.);
} }
@ -74,7 +88,11 @@ 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).WithNoLockNoWait().AnyAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -96,7 +114,14 @@ 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).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false); var list = await QueryInternal(req)
.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>>());
} }
@ -105,7 +130,13 @@ 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).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false); var ret = await QueryInternal(req)
#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,7 +26,11 @@ 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).WithNoLockNoWait().CountAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -48,7 +52,11 @@ 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).WithNoLockNoWait().AnyAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -72,7 +80,9 @@ 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 })
.WithNoLockNoWait() #if DBTYPE_SQLSERVER
.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
@ -88,7 +98,9 @@ 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 })
.WithNoLockNoWait() #if DBTYPE_SQLSERVER
.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
@ -103,7 +115,9 @@ 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 })
.WithNoLockNoWait() #if DBTYPE_SQLSERVER
.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 })
@ -115,7 +129,14 @@ 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).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false); var list = await QueryInternal(req)
.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>>());
} }
@ -124,7 +145,13 @@ 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).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false); var ret = await QueryInternal(req)
#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,7 +30,11 @@ 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).WithNoLockNoWait().CountAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -125,7 +129,11 @@ 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).WithNoLockNoWait().AnyAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -184,7 +192,9 @@ 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)
.WithNoLockNoWait() #if DBTYPE_SQLSERVER
.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
@ -252,7 +262,14 @@ 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).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false); var list = await QueryInternal(req)
.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>>());
} }
@ -268,7 +285,13 @@ 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).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false); var ret = await QueryInternal(req)
#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,7 +25,11 @@ 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).WithNoLockNoWait().CountAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -47,7 +51,11 @@ 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).WithNoLockNoWait().AnyAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -72,7 +80,9 @@ 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)
.WithNoLockNoWait() #if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Count(out var total) .Count(out var total)
.ToListAsync(a => new { .ToListAsync(a => new {
a.CreatedClientIp a.CreatedClientIp
@ -96,7 +106,13 @@ 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).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false); var ret = await QueryInternal(req)
#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,7 +25,11 @@ 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).WithNoLockNoWait().CountAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -60,7 +64,11 @@ 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).WithNoLockNoWait().AnyAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -89,7 +97,12 @@ 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).WithNoLockNoWait().ToTreeListAsync().ConfigureAwait(false); var ret = await QueryInternal(req)
#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,7 +25,11 @@ 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).WithNoLockNoWait().CountAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -47,7 +51,11 @@ 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).WithNoLockNoWait().AnyAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -71,7 +79,14 @@ 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).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false); var list = await QueryInternal(req)
.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>>());
} }
@ -80,7 +95,13 @@ 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).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false); var ret = await QueryInternal(req)
#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,7 +27,11 @@ 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).WithNoLockNoWait().CountAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -55,7 +59,11 @@ 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).WithNoLockNoWait().AnyAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -101,7 +109,9 @@ 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)
.WithNoLockNoWait() #if DBTYPE_SQLSERVER
.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
@ -117,7 +127,9 @@ 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 })
.WithNoLockNoWait() #if DBTYPE_SQLSERVER
.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);
@ -129,7 +141,9 @@ 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)
.WithNoLockNoWait() #if DBTYPE_SQLSERVER
.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() })
@ -157,7 +171,9 @@ 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)
.WithNoLockNoWait() #if DBTYPE_SQLSERVER
.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);
@ -169,7 +185,13 @@ 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).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false); var ret = await QueryInternal(req)
#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,7 +25,11 @@ 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).WithNoLockNoWait().CountAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -48,7 +52,12 @@ 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>().WithNoLockNoWait().AnyAsync(a => a.RoleId == req.Id).ConfigureAwait(false) return await Rpo.Orm.Select<Sys_UserRole>()
#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);
} }
@ -70,7 +79,11 @@ 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).WithNoLockNoWait().AnyAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -92,7 +105,14 @@ 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).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false); var list = await QueryInternal(req)
.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>>());
} }
@ -101,7 +121,12 @@ 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).WithNoLockNoWait().ToListAsync().ConfigureAwait(false); var ret = await QueryInternal(req)
#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,7 +25,11 @@ 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).WithNoLockNoWait().CountAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -47,7 +51,11 @@ 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).WithNoLockNoWait().AnyAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -69,7 +77,14 @@ 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).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false); var list = await QueryInternal(req)
.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>>());
} }
@ -78,7 +93,13 @@ 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).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false); var ret = await QueryInternal(req)
#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,7 +25,11 @@ 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).WithNoLockNoWait().CountAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -47,7 +51,11 @@ 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).WithNoLockNoWait().AnyAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -69,7 +77,14 @@ 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).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false); var list = await QueryInternal(req)
.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>>());
} }
@ -78,7 +93,13 @@ 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).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false); var ret = await QueryInternal(req)
#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,7 +25,11 @@ 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).WithNoLockNoWait().CountAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -47,7 +51,11 @@ 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).WithNoLockNoWait().AnyAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -69,7 +77,14 @@ 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).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false); var list = await QueryInternal(req)
.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>>());
} }
@ -78,7 +93,13 @@ 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).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false); var ret = await QueryInternal(req)
#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,7 +29,11 @@ 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).WithNoLockNoWait().CountAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -90,7 +94,11 @@ 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).WithNoLockNoWait().AnyAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -135,7 +143,9 @@ 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)
.WithNoLockNoWait() #if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Count(out var total) .Count(out var total)
.ToListAsync(a => new { .ToListAsync(a => new {
a.CreatedTime a.CreatedTime
@ -162,7 +172,13 @@ 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).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false); var ret = await QueryInternal(req)
#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>>();
} }
@ -279,7 +295,9 @@ 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>()
.WithNoLockNoWait() #if DBTYPE_SQLSERVER
.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,7 +25,11 @@ 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).WithNoLockNoWait().CountAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -47,7 +51,11 @@ 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).WithNoLockNoWait().AnyAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -69,7 +77,14 @@ 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).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false); var list = await QueryInternal(req)
.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>>());
} }
@ -78,7 +93,13 @@ 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).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false); var ret = await QueryInternal(req)
#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,7 +44,11 @@ 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).WithNoLockNoWait().CountAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -74,7 +78,11 @@ 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).WithNoLockNoWait().AnyAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -105,7 +113,9 @@ 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)
.WithNoLockNoWait() #if DBTYPE_SQLSERVER
.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
@ -131,7 +141,9 @@ public sealed class UserProfileService(BasicRepository<Sys_UserProfile, long> rp
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
var ret = await QueryInternal(req) var ret = await QueryInternal(req)
.WithNoLockNoWait() #if DBTYPE_SQLSERVER
.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,7 +68,11 @@ public sealed class UserService(
{ {
req.ThrowIfInvalid(); req.ThrowIfInvalid();
#pragma warning disable VSTHRD103 #pragma warning disable VSTHRD103
return QueryInternal(req).WithNoLockNoWait().CountAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
#pragma warning restore VSTHRD103 #pragma warning restore VSTHRD103
} }
@ -132,7 +136,7 @@ public sealed class UserService(
ignoreCols.Add(nameof(Sys_User.Password)); ignoreCols.Add(nameof(Sys_User.Password));
} }
_ = await UpdateAsync(entity, null, ignoreCols).ConfigureAwait(false); _ = await UpdateAsync(entity, null, ignoreCols.ToArray()).ConfigureAwait(false);
// 档案表 // 档案表
if (req.Profile != null) { if (req.Profile != null) {
@ -142,7 +146,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 GetAsync(new QueryUserReq { Id = req.Id }).ConfigureAwait(false); var ret = (await QueryAsync(new QueryReq<QueryUserReq> { Filter = new QueryUserReq { Id = req.Id } }).ConfigureAwait(false)).First();
// 发布用户更新事件 // 发布用户更新事件
await eventPublisher.PublishAsync(new UserUpdatedEvent(ret.Adapt<UserInfoRsp>())).ConfigureAwait(false); await eventPublisher.PublishAsync(new UserUpdatedEvent(ret.Adapt<UserInfoRsp>())).ConfigureAwait(false);
@ -231,7 +235,9 @@ 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)
.WithNoLockNoWait() #if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.Count(out var total) .Count(out var total)
.ToListAsync(listUserExp) .ToListAsync(listUserExp)
.ConfigureAwait(false); .ConfigureAwait(false);
@ -246,12 +252,13 @@ 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)).WithNoLockNoWait() var list = await (await QueryInternalAsync(req, false).ConfigureAwait(false))
.Take(req.Count) #if DBTYPE_SQLSERVER
.ToListAsync(a => new Sys_User { .WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
Id = a.Id, UserName = a.UserName #endif
}) .Take(req.Count)
.ConfigureAwait(false); .ToListAsync(a => new Sys_User { Id = a.Id, UserName = a.UserName })
.ConfigureAwait(false);
return list.Adapt<IEnumerable<QueryUserRsp>>(); return list.Adapt<IEnumerable<QueryUserRsp>>();
} }
@ -411,29 +418,63 @@ 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)
.WithNoLockNoWait() #if DBTYPE_SQLSERVER
.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>()
.WithNoLockNoWait() #if DBTYPE_SQLSERVER
.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);
@ -442,7 +483,13 @@ public sealed class UserService(
} }
// 检查部门是否存在 // 检查部门是否存在
var dept = await Rpo.Orm.Select<Sys_Dept>().WithNoLockNoWait().Where(a => req.DeptId == a.Id).ToListAsync(a => a.Id).ConfigureAwait(false); var dept = await Rpo.Orm.Select<Sys_Dept>()
#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,7 +29,11 @@ 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).WithNoLockNoWait().CountAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -57,7 +61,11 @@ 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).WithNoLockNoWait().AnyAsync(); return QueryInternal(req)
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
} }
/// <inheritdoc /> /// <inheritdoc />
@ -79,7 +87,14 @@ 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).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false); var list = await QueryInternal(req)
.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>>());
} }
@ -88,7 +103,13 @@ 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).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false); var ret = await QueryInternal(req)
#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>>();
} }
@ -159,7 +180,9 @@ public sealed class VerifyCodeService(BasicRepository<Sys_VerifyCode, long> rpo,
, Value = destDevice , Value = destDevice
} }
}) })
.WithNoLockNoWait() #if DBTYPE_SQLSERVER
.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, bool force = false) public static IServiceCollection AddSchedules(this IServiceCollection me)
{ {
return App.WebHostEnvironment.IsProduction() || force return App.WebHostEnvironment.IsProduction()
? 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 = (int?)rsp.StatusCode // LastStatusCode = rsp.StatusCode //
, LastDuration = jobRecord.Duration , LastDuration = jobRecord.Duration
}) })
.ConfigureAwait(false); .ConfigureAwait(false);

View File

@ -1,183 +0,0 @@
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,4 +4,7 @@
<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
.UseApiSkin() // 使用OpenApiSkin中间件仅在调试模式下提供Swagger UI皮肤 .UseOpenApiSkin() // 使用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 ? $t(item.title) : ''" :title="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 ? $t(item.title) : ''" :title="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,14 +2,12 @@ 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,5 +1,6 @@
<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>
@ -11,11 +12,10 @@
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,9 +31,11 @@ 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: `<h1 style="text-align:center">${this.doc.title}</h1>${this.doc.body}`, content: 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 {
@ -49,17 +51,11 @@ 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