25 Commits

Author SHA1 Message Date
tk
3293683835 chore(release): 2.0.0 2024-11-04 17:23:02 +08:00
e71661663f refactor: ♻️ 移除Newtonsoft.Json包 (#186)
Co-authored-by: tk <fiyne1a@dingtalk.com>
2024-11-04 16:18:47 +08:00
13ba536df2 refactor: ♻️ 框架&业务代码分离 (#185)
Co-authored-by: tk <fiyne1a@dingtalk.com>
2024-11-04 12:06:50 +08:00
072cc1e491 docs: 📝 在线预览地址变更 (#184)
[skip ci]

Co-authored-by: tk <fiyne1a@dingtalk.com>
2024-10-31 10:19:07 +08:00
6fbb519256 refactor: ♻️ projectUsings (#183)
Co-authored-by: tk <fiyne1a@dingtalk.com>
2024-10-30 16:20:18 +08:00
a4e63c971d refactor: ♻️ projectUsings (#182)
Co-authored-by: tk <fiyne1a@dingtalk.com>
2024-10-30 15:27:25 +08:00
bac4a39544 refactor: ♻️ 框架代码同步 (#181)
Co-authored-by: tk <fiyne1a@dingtalk.com>
2024-10-30 14:40:52 +08:00
f0c3ec109f revert: appConfig.js (#180)
Co-authored-by: tk <fiyne1a@dingtalk.com>
2024-10-14 15:58:51 +08:00
000e3d68a8 fix: 🐛 public const int SECS_CACHE_LOGIN_BY_USER_ID = 3600 * 24 * 30; // 秒:缓存时间-通过用户编号登录的用户信息 (#179)
Co-authored-by: tk <fiyne1a@dingtalk.com>
2024-10-14 14:15:32 +08:00
58e4572723 feat: 框架代码同步 (#178)
Co-authored-by: tk <fiyne1a@dingtalk.com>
2024-10-14 13:55:53 +08:00
dfe6b03b21 style: 💄 code format (#175)
Co-authored-by: tk <fiyne1a@dingtalk.com>
2024-08-29 17:41:28 +08:00
135f082b06 style: 💄 code format (#174)
[skip ci]

Co-authored-by: tk <fiyne1a@dingtalk.com>
2024-08-29 17:31:11 +08:00
c088492cfa feat: 框架代码同步 (#173)
Co-authored-by: tk <fiyne1a@dingtalk.com>
2024-08-29 17:21:06 +08:00
b9b228c9e1 Merge pull request #171 from nsnail/tk
feat:  查询过滤器保存
2024-08-13 11:34:49 +08:00
tk
779d8e511a feat: 查询过滤器保存
页面定时刷新
WebSocket断线自动重连
2024-08-13 11:34:28 +08:00
6922a863ec Merge pull request #170 from nsnail/release
chore(release): 1.6.0
2024-08-12 11:44:45 +08:00
tk
5b69ce8688 chore(release): 1.6.0 2024-08-12 11:44:27 +08:00
cd8ed674e0 feat: 移除RedLocker,更改为自实现 (#169)
用户表增加最后登录时间字段
列表查询多字段模糊查询改为单字段精确查询
WebSocket版本更新检查
前端自定义字段筛选
暗黑模式样式调整
[skip ci]

Co-authored-by: tk <fiyne1a@dingtalk.com>
2024-08-12 11:44:14 +08:00
4733adede5 fix: 🐛 ip归属地查询接口地址更新 (#168)
Co-authored-by: tk <fiyne1a@dingtalk.com>
2024-08-02 09:26:37 +08:00
e00c30c961 fix: 🐛 站内信角标颜色 (#167)
Co-authored-by: tk <fiyne1a@dingtalk.com>
2024-07-29 18:28:20 +08:00
6b63250039 fix: 🐛 ip显示问题 (#166)
Co-authored-by: tk <fiyne1a@dingtalk.com>
2024-07-29 18:19:58 +08:00
2fa8b56f9c chore: 🔨 前端布局样式调整 (#165)
Co-authored-by: tk <fiyne1a@dingtalk.com>
2024-07-29 16:54:00 +08:00
2b4c25c07c refactor: ♻️ 批量查询ip归属地 (#164)
Co-authored-by: tk <fiyne1a@dingtalk.com>
2024-07-29 11:35:26 +08:00
7c56c8d571 fix: 🐛 trimSuffix (#163)
Co-authored-by: tk <fiyne1a@dingtalk.com>
2024-07-26 19:03:21 +08:00
5fb6f7bea7 Merge pull request #162 from nsnail/release
chore(release): 1.5.0
2024-07-26 17:48:07 +08:00
577 changed files with 13396 additions and 5410 deletions

View File

@ -10,6 +10,7 @@ ij_xml_text_wrap = off # IntelliJ IDEA 中 XML 文本不换行
indent_size = 4 # 缩进大小为 4 个空格
indent_style = space # 使用空格进行缩进
insert_final_newline = false # 不在文件末尾插入空行
max_line_length = 150 # 行长度限制为 150 个字符
trim_trailing_whitespace = true # 删除行尾的空格
[{*.json,*.yml}]

1
.github/workflows/README.md vendored Normal file
View File

@ -0,0 +1 @@
github workflows

View File

@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 20.x ]
node-version: [ 22.x ]
steps:
- uses: actions/checkout@v3
with:

View File

@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 20.x ]
node-version: [ 22.x ]
steps:
- uses: actions/checkout@v3
with:

1
.gitignore vendored
View File

@ -397,6 +397,7 @@ FodyWeavers.xsd
# JetBrains Rider
*.sln.iml
.idea/
!src/backend/CloudCode.DataGrip/.idea
# User Define
dist/

6
.gitmodules vendored
View File

@ -1,6 +1,6 @@
[submodule "refs/Furion"]
path = refs/Furion
url = https://github.com/nsnail/Furion.git
[submodule "refs/Gurion"]
path = refs/Gurion
url = https://github.com/nsnail/Gurion.git
[submodule "refs/ns-ext"]
path = refs/ns-ext
url = https://github.com/nsnail/ns-ext.git

View File

@ -2,6 +2,35 @@
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.0.0](https://github.com/nsnail/NetAdmin/compare/v1.6.0...v2.0.0) (2024-11-04)
### Features
* ✨ 查询过滤器保存 ([779d8e5](https://github.com/nsnail/NetAdmin/commit/779d8e511a84d2be91d74ea308c22b969d6963f3))
* ✨ 框架代码同步 ([#173](https://github.com/nsnail/NetAdmin/issues/173)) ([c088492](https://github.com/nsnail/NetAdmin/commit/c088492cfabada198ad563e43278ab7e869029bc))
* ✨ 框架代码同步 ([#178](https://github.com/nsnail/NetAdmin/issues/178)) ([58e4572](https://github.com/nsnail/NetAdmin/commit/58e4572723ba68700fb6414167cb27b03c864db1))
### Bug Fixes
* 🐛 public const int SECS_CACHE_LOGIN_BY_USER_ID = 3600 * 24 * 30; // 秒:缓存时间-通过用户编号登录的用户信息 ([#179](https://github.com/nsnail/NetAdmin/issues/179)) ([000e3d6](https://github.com/nsnail/NetAdmin/commit/000e3d68a85eaee7758b4160d1d0ffa52aa4aae0))
## [1.6.0](https://github.com/nsnail/NetAdmin/compare/v1.5.0...v1.6.0) (2024-08-12)
### Features
* ✨ 移除RedLocker更改为自实现 ([#169](https://github.com/nsnail/NetAdmin/issues/169)) ([cd8ed67](https://github.com/nsnail/NetAdmin/commit/cd8ed674e0615b33fc0e025b9412c2f16d252f0f))
### Bug Fixes
* 🐛 站内信角标颜色 ([#167](https://github.com/nsnail/NetAdmin/issues/167)) ([e00c30c](https://github.com/nsnail/NetAdmin/commit/e00c30c96123769d8a9e6f30cc9a2c3e8099e34c))
* 🐛 ip归属地查询接口地址更新 ([#168](https://github.com/nsnail/NetAdmin/issues/168)) ([4733ade](https://github.com/nsnail/NetAdmin/commit/4733adede5e8993f741e9b94541aafeb6a733859))
* 🐛 ip显示问题 ([#166](https://github.com/nsnail/NetAdmin/issues/166)) ([6b63250](https://github.com/nsnail/NetAdmin/commit/6b6325003924b1605b610f759b2131c15013ffa0))
* 🐛 trimSuffix ([#163](https://github.com/nsnail/NetAdmin/issues/163)) ([7c56c8d](https://github.com/nsnail/NetAdmin/commit/7c56c8d571d4f29fcb20f238893dbf61e5e538f0))
## [1.5.0](https://github.com/nsnail/NetAdmin/compare/v1.4.0...v1.5.0) (2024-07-26)

View File

@ -1,6 +1,7 @@
<!-- 注意此文件名大小写不可变更 -->
<Project>
<PropertyGroup>
<DefineConstants>DBTYPE_SQLITE</DefineConstants>
<SolutionDir>$(MSBuildThisFileDirectory)</SolutionDir>
</PropertyGroup>
<Import Project="$(SolutionDir)/build/minver.targets" />
@ -25,7 +26,7 @@
<Title>$(AssemblyName)</Title>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MinVer" Version="5.0.0">
<PackageReference Include="MinVer" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

View File

@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/aspnet:9.0.0-preview.6 AS base
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
WORKDIR /app
EXPOSE 8080
RUN apt update

View File

@ -31,6 +31,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{BB0B
1.git.pull.request.ps1 = scripts/1.git.pull.request.ps1
2.git.release.ps1 = scripts/2.git.release.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
clean.ln.csx = scripts/clean.ln.csx
code.clean.csx = scripts/code.clean.csx
code.clean.ps1 = scripts/code.clean.ps1
@ -44,10 +45,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{BB0B
rename.csx = scripts/rename.csx
resharper.full.ps1 = scripts/resharper.full.ps1
switcher.freesql.json = scripts/switcher.freesql.json
switcher.furion.json = scripts/switcher.furion.json
switcher.gurion.json = scripts/switcher.gurion.json
switcher.nsext.json = scripts/switcher.nsext.json
switcher.ps1 = scripts/switcher.ps1
sync.sln.files.csx = scripts/sync.sln.files.csx
wait.server.stop.sh = scripts/wait.server.stop.sh
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{1129FE25-466B-4F4F-85FC-3752664245E1}"
@ -55,6 +57,7 @@ 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
@ -97,10 +100,25 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "01.frameworks", "01.framewo
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "04.tests", "04.tests", "{89260294-80FC-49F1-8D73-AECD39AFF2B7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetAdmin.AdmServer.Tests", "src\backend\NetAdmin.AdmServer.Tests\NetAdmin.AdmServer.Tests.csproj", "{C7F27698-DA05-4ACD-B0D7-4791B3972002}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "05.tools", "05.tools", "{79409163-5006-405D-AC96-406FA0AD77B7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "src\backend\UnitTests\UnitTests.csproj", "{C7F27698-DA05-4ACD-B0D7-4791B3972002}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetAdmin.Tests", "src\backend\NetAdmin.Tests\NetAdmin.Tests.csproj", "{00604162-C444-478B-B773-3AB23C856CA7}"
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}") = "NetAdmin.SysComponent.Domain", "src\backend\NetAdmin.SysComponent.Domain\NetAdmin.SysComponent.Domain.csproj", "{51D6E603-0749-4A11-A78C-9E5BB127E03A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetAdmin.AdmServer.Domain", "src\backend\NetAdmin.AdmServer.Domain\NetAdmin.AdmServer.Domain.csproj", "{932520DF-D312-415A-A128-1117F8221D68}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetAdmin.AdmServer.Infrastructure", "src\backend\NetAdmin.AdmServer.Infrastructure\NetAdmin.AdmServer.Infrastructure.csproj", "{C3DE6F6A-D1FC-4B8E-9033-980FBEBBD2BA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetAdmin.SysComponent.Infrastructure", "src\backend\NetAdmin.SysComponent.Infrastructure\NetAdmin.SysComponent.Infrastructure.csproj", "{48EE6FC4-B64A-40D3-B889-36837E067880}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -162,6 +180,22 @@ Global
{00604162-C444-478B-B773-3AB23C856CA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{00604162-C444-478B-B773-3AB23C856CA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{00604162-C444-478B-B773-3AB23C856CA7}.Release|Any CPU.Build.0 = Release|Any CPU
{51D6E603-0749-4A11-A78C-9E5BB127E03A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{51D6E603-0749-4A11-A78C-9E5BB127E03A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{51D6E603-0749-4A11-A78C-9E5BB127E03A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{51D6E603-0749-4A11-A78C-9E5BB127E03A}.Release|Any CPU.Build.0 = Release|Any CPU
{932520DF-D312-415A-A128-1117F8221D68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{932520DF-D312-415A-A128-1117F8221D68}.Debug|Any CPU.Build.0 = Debug|Any CPU
{932520DF-D312-415A-A128-1117F8221D68}.Release|Any CPU.ActiveCfg = Release|Any CPU
{932520DF-D312-415A-A128-1117F8221D68}.Release|Any CPU.Build.0 = Release|Any CPU
{C3DE6F6A-D1FC-4B8E-9033-980FBEBBD2BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C3DE6F6A-D1FC-4B8E-9033-980FBEBBD2BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C3DE6F6A-D1FC-4B8E-9033-980FBEBBD2BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C3DE6F6A-D1FC-4B8E-9033-980FBEBBD2BA}.Release|Any CPU.Build.0 = Release|Any CPU
{48EE6FC4-B64A-40D3-B889-36837E067880}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{48EE6FC4-B64A-40D3-B889-36837E067880}.Debug|Any CPU.Build.0 = Debug|Any CPU
{48EE6FC4-B64A-40D3-B889-36837E067880}.Release|Any CPU.ActiveCfg = Release|Any CPU
{48EE6FC4-B64A-40D3-B889-36837E067880}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{4DAF9366-855F-46BB-AE4C-660C92FA0697} = {C84EB5A0-37AD-4B17-A51E-E36888C4441E}
@ -178,10 +212,15 @@ Global
{CE895E44-EEC3-4ECE-A56A-8A82E7D863E3} = {12AE5B4B-CB1A-498E-83B8-04E201E31D86}
{89260294-80FC-49F1-8D73-AECD39AFF2B7} = {4DAF9366-855F-46BB-AE4C-660C92FA0697}
{C7F27698-DA05-4ACD-B0D7-4791B3972002} = {89260294-80FC-49F1-8D73-AECD39AFF2B7}
{3C6F049E-3EE8-4D66-9AFF-E8A369032487} = {1129FE25-466B-4F4F-85FC-3752664245E1}
{00604162-C444-478B-B773-3AB23C856CA7} = {D9C3EF66-2757-473D-A26B-54FD08DA203F}
{34650E82-D257-46DA-BD6B-DE307113347B} = {3F23258D-8299-4992-9F51-2EE9B52CF9D2}
{19872A4C-3C9A-4C62-A33B-74F5B8D6F77C} = {3F23258D-8299-4992-9F51-2EE9B52CF9D2}
{C2CC1596-3BEE-43EA-A9BE-4EDE5716296C} = {3F23258D-8299-4992-9F51-2EE9B52CF9D2}
{79409163-5006-405D-AC96-406FA0AD77B7} = {4DAF9366-855F-46BB-AE4C-660C92FA0697}
{51D6E603-0749-4A11-A78C-9E5BB127E03A} = {3F23258D-8299-4992-9F51-2EE9B52CF9D2}
{932520DF-D312-415A-A128-1117F8221D68} = {12AE5B4B-CB1A-498E-83B8-04E201E31D86}
{C3DE6F6A-D1FC-4B8E-9033-980FBEBBD2BA} = {12AE5B4B-CB1A-498E-83B8-04E201E31D86}
{48EE6FC4-B64A-40D3-B889-36837E067880} = {3F23258D-8299-4992-9F51-2EE9B52CF9D2}
{3C6F049E-3EE8-4D66-9AFF-E8A369032487} = {1129FE25-466B-4F4F-85FC-3752664245E1}
EndGlobalSection
EndGlobal

View File

@ -27,6 +27,256 @@
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ACCESSOR_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_RECORD_FIELD_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AD/@EntryIndexedValue">AD</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AE/@EntryIndexedValue">AE</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AF/@EntryIndexedValue">AF</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AG/@EntryIndexedValue">AG</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AI/@EntryIndexedValue">AI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AL/@EntryIndexedValue">AL</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AM/@EntryIndexedValue">AM</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AO/@EntryIndexedValue">AO</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AQ/@EntryIndexedValue">AQ</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AR/@EntryIndexedValue">AR</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AS/@EntryIndexedValue">AS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AT/@EntryIndexedValue">AT</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AU/@EntryIndexedValue">AU</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AW/@EntryIndexedValue">AW</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AX/@EntryIndexedValue">AX</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AZ/@EntryIndexedValue">AZ</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BA/@EntryIndexedValue">BA</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BB/@EntryIndexedValue">BB</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BD/@EntryIndexedValue">BD</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BE/@EntryIndexedValue">BE</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BF/@EntryIndexedValue">BF</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BG/@EntryIndexedValue">BG</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BH/@EntryIndexedValue">BH</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BI/@EntryIndexedValue">BI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BJ/@EntryIndexedValue">BJ</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BL/@EntryIndexedValue">BL</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BM/@EntryIndexedValue">BM</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BN/@EntryIndexedValue">BN</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BO/@EntryIndexedValue">BO</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BQ/@EntryIndexedValue">BQ</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BR/@EntryIndexedValue">BR</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BS/@EntryIndexedValue">BS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BT/@EntryIndexedValue">BT</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BV/@EntryIndexedValue">BV</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BW/@EntryIndexedValue">BW</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BY/@EntryIndexedValue">BY</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BZ/@EntryIndexedValue">BZ</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CA/@EntryIndexedValue">CA</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CC/@EntryIndexedValue">CC</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CD/@EntryIndexedValue">CD</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CF/@EntryIndexedValue">CF</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CG/@EntryIndexedValue">CG</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CH/@EntryIndexedValue">CH</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CI/@EntryIndexedValue">CI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CK/@EntryIndexedValue">CK</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CL/@EntryIndexedValue">CL</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CM/@EntryIndexedValue">CM</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CN/@EntryIndexedValue">CN</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CO/@EntryIndexedValue">CO</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CR/@EntryIndexedValue">CR</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CU/@EntryIndexedValue">CU</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CV/@EntryIndexedValue">CV</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CW/@EntryIndexedValue">CW</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CX/@EntryIndexedValue">CX</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CY/@EntryIndexedValue">CY</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CZ/@EntryIndexedValue">CZ</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DE/@EntryIndexedValue">DE</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DJ/@EntryIndexedValue">DJ</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DK/@EntryIndexedValue">DK</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DM/@EntryIndexedValue">DM</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DO/@EntryIndexedValue">DO</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DZ/@EntryIndexedValue">DZ</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=EC/@EntryIndexedValue">EC</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=EE/@EntryIndexedValue">EE</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=EG/@EntryIndexedValue">EG</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=EH/@EntryIndexedValue">EH</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ER/@EntryIndexedValue">ER</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ES/@EntryIndexedValue">ES</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ET/@EntryIndexedValue">ET</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=FI/@EntryIndexedValue">FI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=FJ/@EntryIndexedValue">FJ</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=FK/@EntryIndexedValue">FK</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=FM/@EntryIndexedValue">FM</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=FO/@EntryIndexedValue">FO</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=FR/@EntryIndexedValue">FR</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GA/@EntryIndexedValue">GA</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GB/@EntryIndexedValue">GB</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GD/@EntryIndexedValue">GD</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GE/@EntryIndexedValue">GE</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GF/@EntryIndexedValue">GF</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GG/@EntryIndexedValue">GG</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GH/@EntryIndexedValue">GH</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GI/@EntryIndexedValue">GI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GL/@EntryIndexedValue">GL</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GM/@EntryIndexedValue">GM</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GN/@EntryIndexedValue">GN</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GP/@EntryIndexedValue">GP</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GQ/@EntryIndexedValue">GQ</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GR/@EntryIndexedValue">GR</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GS/@EntryIndexedValue">GS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GT/@EntryIndexedValue">GT</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GU/@EntryIndexedValue">GU</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GW/@EntryIndexedValue">GW</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GY/@EntryIndexedValue">GY</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=HK/@EntryIndexedValue">HK</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=HM/@EntryIndexedValue">HM</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=HN/@EntryIndexedValue">HN</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=HR/@EntryIndexedValue">HR</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=HT/@EntryIndexedValue">HT</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=HU/@EntryIndexedValue">HU</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ID/@EntryIndexedValue">ID</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IE/@EntryIndexedValue">IE</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IL/@EntryIndexedValue">IL</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IM/@EntryIndexedValue">IM</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IN/@EntryIndexedValue">IN</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IO/@EntryIndexedValue">IO</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IQ/@EntryIndexedValue">IQ</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IR/@EntryIndexedValue">IR</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IS/@EntryIndexedValue">IS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IT/@EntryIndexedValue">IT</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=JE/@EntryIndexedValue">JE</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=JM/@EntryIndexedValue">JM</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=JO/@EntryIndexedValue">JO</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=JP/@EntryIndexedValue">JP</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=KE/@EntryIndexedValue">KE</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=KG/@EntryIndexedValue">KG</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=KH/@EntryIndexedValue">KH</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=KI/@EntryIndexedValue">KI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=KM/@EntryIndexedValue">KM</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=KN/@EntryIndexedValue">KN</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=KP/@EntryIndexedValue">KP</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=KR/@EntryIndexedValue">KR</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=KW/@EntryIndexedValue">KW</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=KY/@EntryIndexedValue">KY</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=KZ/@EntryIndexedValue">KZ</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LA/@EntryIndexedValue">LA</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LB/@EntryIndexedValue">LB</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LC/@EntryIndexedValue">LC</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LI/@EntryIndexedValue">LI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LK/@EntryIndexedValue">LK</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LR/@EntryIndexedValue">LR</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LS/@EntryIndexedValue">LS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LT/@EntryIndexedValue">LT</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LU/@EntryIndexedValue">LU</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LV/@EntryIndexedValue">LV</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LY/@EntryIndexedValue">LY</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MA/@EntryIndexedValue">MA</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MC/@EntryIndexedValue">MC</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MD/@EntryIndexedValue">MD</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ME/@EntryIndexedValue">ME</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MF/@EntryIndexedValue">MF</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MG/@EntryIndexedValue">MG</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MH/@EntryIndexedValue">MH</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MK/@EntryIndexedValue">MK</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ML/@EntryIndexedValue">ML</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MM/@EntryIndexedValue">MM</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MN/@EntryIndexedValue">MN</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MO/@EntryIndexedValue">MO</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MP/@EntryIndexedValue">MP</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MQ/@EntryIndexedValue">MQ</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MR/@EntryIndexedValue">MR</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MS/@EntryIndexedValue">MS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MT/@EntryIndexedValue">MT</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MU/@EntryIndexedValue">MU</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MV/@EntryIndexedValue">MV</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MW/@EntryIndexedValue">MW</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MX/@EntryIndexedValue">MX</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MY/@EntryIndexedValue">MY</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MZ/@EntryIndexedValue">MZ</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NA/@EntryIndexedValue">NA</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NC/@EntryIndexedValue">NC</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NE/@EntryIndexedValue">NE</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NF/@EntryIndexedValue">NF</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NG/@EntryIndexedValue">NG</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NI/@EntryIndexedValue">NI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NL/@EntryIndexedValue">NL</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NO/@EntryIndexedValue">NO</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NP/@EntryIndexedValue">NP</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NR/@EntryIndexedValue">NR</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NU/@EntryIndexedValue">NU</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NZ/@EntryIndexedValue">NZ</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=OM/@EntryIndexedValue">OM</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=OTP/@EntryIndexedValue">OTP</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PA/@EntryIndexedValue">PA</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PE/@EntryIndexedValue">PE</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PF/@EntryIndexedValue">PF</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PG/@EntryIndexedValue">PG</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PH/@EntryIndexedValue">PH</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PK/@EntryIndexedValue">PK</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PL/@EntryIndexedValue">PL</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PM/@EntryIndexedValue">PM</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PN/@EntryIndexedValue">PN</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PR/@EntryIndexedValue">PR</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PS/@EntryIndexedValue">PS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PT/@EntryIndexedValue">PT</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PW/@EntryIndexedValue">PW</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PY/@EntryIndexedValue">PY</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=QA/@EntryIndexedValue">QA</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=RE/@EntryIndexedValue">RE</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=RO/@EntryIndexedValue">RO</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=RS/@EntryIndexedValue">RS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=RU/@EntryIndexedValue">RU</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=RW/@EntryIndexedValue">RW</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SA/@EntryIndexedValue">SA</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SB/@EntryIndexedValue">SB</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SC/@EntryIndexedValue">SC</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SD/@EntryIndexedValue">SD</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SE/@EntryIndexedValue">SE</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SG/@EntryIndexedValue">SG</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SH/@EntryIndexedValue">SH</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SI/@EntryIndexedValue">SI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SJ/@EntryIndexedValue">SJ</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SK/@EntryIndexedValue">SK</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SL/@EntryIndexedValue">SL</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SM/@EntryIndexedValue">SM</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SN/@EntryIndexedValue">SN</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SO/@EntryIndexedValue">SO</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SR/@EntryIndexedValue">SR</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SS/@EntryIndexedValue">SS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ST/@EntryIndexedValue">ST</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SV/@EntryIndexedValue">SV</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SX/@EntryIndexedValue">SX</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SY/@EntryIndexedValue">SY</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SZ/@EntryIndexedValue">SZ</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TC/@EntryIndexedValue">TC</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TD/@EntryIndexedValue">TD</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TF/@EntryIndexedValue">TF</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TG/@EntryIndexedValue">TG</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TH/@EntryIndexedValue">TH</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TJ/@EntryIndexedValue">TJ</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TK/@EntryIndexedValue">TK</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TL/@EntryIndexedValue">TL</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TM/@EntryIndexedValue">TM</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TN/@EntryIndexedValue">TN</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TO/@EntryIndexedValue">TO</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TR/@EntryIndexedValue">TR</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TT/@EntryIndexedValue">TT</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TV/@EntryIndexedValue">TV</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TW/@EntryIndexedValue">TW</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TZ/@EntryIndexedValue">TZ</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=UA/@EntryIndexedValue">UA</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=UG/@EntryIndexedValue">UG</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=UM/@EntryIndexedValue">UM</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=US/@EntryIndexedValue">US</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=UY/@EntryIndexedValue">UY</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=UZ/@EntryIndexedValue">UZ</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=VA/@EntryIndexedValue">VA</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=VC/@EntryIndexedValue">VC</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=VE/@EntryIndexedValue">VE</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=VG/@EntryIndexedValue">VG</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=VI/@EntryIndexedValue">VI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=VN/@EntryIndexedValue">VN</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=VU/@EntryIndexedValue">VU</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=WF/@EntryIndexedValue">WF</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=WS/@EntryIndexedValue">WS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=YE/@EntryIndexedValue">YE</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=YT/@EntryIndexedValue">YT</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ZA/@EntryIndexedValue">ZA</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ZM/@EntryIndexedValue">ZM</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ZW/@EntryIndexedValue">ZW</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=15b5b1f1_002D457c_002D4ca6_002Db278_002D5615aedc07d3/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static readonly fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="READONLY_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=236f7aa5_002D7b06_002D43ca_002Dbf2a_002D9b31bfcff09a/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Any" AccessRightKinds="Private" Description="Constant fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="CONSTANT_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="_" Suffix="" Style="AA_BB" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=669e5282_002Dfb4b_002D4e90_002D91e7_002D07d269d04b60/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Any" AccessRightKinds="Protected, ProtectedInternal, Internal, Public, PrivateProtected" Description="Constant fields (not private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="CONSTANT_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /&gt;&lt;/Policy&gt;</s:String>
@ -78,6 +328,7 @@
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002EMemberReordering_002EMigrations_002ECSharpFileLayoutPatternRemoveIsAttributeUpgrade/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EPredefinedNamingRulesToUserRulesUpgrade/@EntryIndexedValue">True</s:Boolean>

View File

@ -4,12 +4,11 @@
[![.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)
[![Furion](https://img.shields.io/badge/Furion-4.x-blueviolet.svg)](https://github.com/nsnail/NetAdmin/blob/main/LICENSE)
[![FreeSql](https://img.shields.io/badge/FreeSql-3.x-orange.svg)](https://github.com/nsnail/NetAdmin/blob/main/LICENSE)
## 在线预览
http://47.110.248.163:12000
https://na.tools92.top
## 一键运行
@ -86,7 +85,6 @@ XC-->XA
| 语言 | 集成领域 | 开源库 |
|------------|---------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| C# | Web基础框架 | [ASP.NET Core](https://github.com/dotnet/aspnetcore) |
| C# | 快速开发脚手架 | [Furion](https://gitee.com/dotnetchina/Furion) |
| C# | 数据库关系映射 | [FreeSql](https://github.com/dotnetcore/FreeSql) |
| C# | 代码质量检查 | [Roslynator.Analyzers](https://github.com/josefpihrt/roslynator) \| [SonarAnalyzer.CSharp](https://github.com/SonarSource/sonar-dotnet) \| [StyleCop.Analyzers](https://github.com/DotNetAnalyzers/StyleCopAnalyzers) |
| C# | 单元测试框架 | [xunit](https://github.com/xunit/xunit) \| [coverlet.collector](https://github.com/coverlet-coverage/coverlet) |

249
assets/res/CountryCodes.ln Normal file
View File

@ -0,0 +1,249 @@
不丹
东帝汶
中国
中非
丹麦
乌克兰
乌兹别克斯坦
乌干达
乌拉圭
乍得
也门
亚美尼亚
以色列
伊拉克
伊朗
伯利兹
佛得角
俄罗斯
保加利亚
克罗地亚
关岛
冈比亚
冰岛
几内亚
几内亚比绍
列支敦士登
刚果共和国
刚果民主共和国
利比亚
利比里亚
加拿大
加纳
加蓬
匈牙利
北马其顿
北马里亚纳群岛
南乔治亚和南桑威奇群岛
南极洲
南苏丹
南非
博茨瓦纳
卡塔尔
卢旺达
卢森堡
印度
印度尼西亚
危地马拉
厄瓜多尔
厄立特里亚
叙利亚
古巴
台湾
吉尔吉斯斯坦
吉布提
哈萨克斯坦
哥伦比亚
哥斯达黎加
喀麦隆
图瓦卢
土库曼斯坦
土耳其
圣卢西亚
圣基茨和尼维斯
圣多美和普林西比
圣巴泰勒米
圣文森特和格林纳丁斯
圣皮埃尔和密克隆
圣诞岛
圣赫勒拿
圣马力诺
圭亚那
坦桑尼亚
埃及
埃塞俄比亚
基里巴斯
塔吉克斯坦
塞内加尔
塞尔维亚
塞拉利昂
塞浦路斯
塞舌尔
墨西哥
多哥
多米尼克
多米尼加
奥兰
奥地利
委内瑞拉
孟加拉国
安哥拉
安圭拉
安提瓜和巴布达
安道尔
密克罗尼西亚联邦
尼加拉瓜
尼日利亚
尼日尔
尼泊尔
巴勒斯坦
巴哈马
巴基斯坦
巴巴多斯
巴布亚新几内亚
巴拉圭
巴拿马
巴林
巴西
布基纳法索
布隆迪
布韦岛
希腊
帕劳
库克群岛
库拉索
开曼群岛
德国
意大利
所罗门群岛
托克劳
拉脱维亚
挪威
捷克
摩尔多瓦
摩洛哥
摩纳哥
文莱
斐济
斯威士兰
斯洛伐克
斯洛文尼亚
斯瓦尔巴和扬马延
斯里兰卡
新加坡
新喀里多尼亚
新西兰
日本
智利
朝鲜
柬埔寨
根西
格林纳达
格陵兰
格鲁吉亚
梵蒂冈
比利时
毛里塔尼亚
毛里求斯
汤加
沙特阿拉伯
法国
法属南部和南极领地
法属圣马丁
法属圭亚那
法属波利尼西亚
法罗群岛
波兰
波多黎各
波黑
泰国
泽西
津巴布韦
洪都拉斯
海地
澳大利亚
澳门
爱尔兰
爱沙尼亚
牙买加
特克斯和凯科斯群岛
特立尼达和多巴哥
玻利维亚
瑙鲁
瑞典
瑞士
瓜德罗普
瓦利斯和富图纳
瓦努阿图
留尼汪
白俄罗斯
百慕大
皮特凯恩群岛
直布罗陀
福克兰群岛
科威特
科摩罗
科特迪瓦
科科斯基林群岛
秘鲁
突尼斯
立陶宛
索马里
约旦
纳米比亚
纽埃
缅甸
罗马尼亚
美国
美国本土外小岛屿
美属维尔京群岛
美属萨摩亚
老挝
肯尼亚
芬兰
苏丹
苏里南
英国
英属印度洋领地
英属维尔京群岛
荷兰
荷兰加勒比区
荷属圣马丁
莫桑比克
莱索托
菲律宾
萨尔瓦多
萨摩亚
葡萄牙
蒙古
蒙特塞拉特
西撒哈拉
西班牙
诺福克岛
贝宁
赞比亚
赤道几内亚
赫德岛和麦克唐纳群岛
越南
阿塞拜疆
阿富汗
阿尔及利亚
阿尔巴尼亚
阿曼
阿根廷
阿联酋
阿鲁巴
韩国
香港
马尔代夫
马恩岛
马拉维
马提尼克
马来西亚
马约特
马绍尔群岛
马耳他
马达加斯加
马里
黎巴嫩
黑山

View File

View File

@ -0,0 +1,70 @@
不为其中之一
不以什么开始
不以什么结束
不包含
不排序
不等于
丧偶
中专
中共党员
为其中之一
以什么开始
以什么结束
保密
保密
信息
倒序排序
共青团员
出生证
初中
包含
博士
博士后
同步数据库结构
外国人居留证
外部错误
大专
大于
大于等于
宕机
小于
小于等于
小学
已婚
并且
成功
或者
护照
插入种子数据
无效操作
无效输入
日期范围
未处理异常
未婚
本科
比较数据库结构
港澳台通行证
硕士
示例导出
离异
等于
等于
等于
管理模块
系统模块
结果非预期
群众
自定义
范围
警告
调试
跟踪
身份证
错误
随机排序
顺序排序
高中

View File

@ -0,0 +1,21 @@
6位数字
8位以上数字字母组合
XML注释文件不存在
中文姓名
事务已回滚
事务已提交
区号电话号码分机号
参数格式不正确
开始事务
支付宝账号
数据库同步开始
数据库结构同步完成
无效端口号
无效证件号码
时间表达式
用户名不能是手机号码
用户名长度4位以上
请求对象不能为空
邀请码不正确
配置文件初始化完毕
非JSON字符串

View File

@ -2,66 +2,29 @@
上次执行状态
上次执行耗时
下次执行时间
不为其中之一
不以什么开始
不以什么结束
不包含
不排序
不等于
丧偶
中专
中共党员
为其中之一
人工审核
以什么开始
以什么结束
作业名称
作业状态
保密
信息
倒序排序
全部数据
公告
共青团员
出生证
创建时间
初中
删除
包含
博士
博士后
发送失败
同步数据库结构
响应体
响应状态码
唯一编码
备注
外国人居留证
外部错误
大专
大于
大于等于
字典内容导出
宕机
客户端IP
小于
小于等于
小学
已发送
已婚
已校验
已读
并且
成功
或者
所属角色
所属部门
手机
手机号
执行耗时
执行计划
护照
指定部门数据
按钮
排序
@ -69,65 +32,41 @@
接口导出
接口描述
接口路径
插入种子数据
操作系统
数据范围
无效操作
无效输入
无限权限
日期范围
是否启用
显示仪表板
未处理异常
未婚
最后登录时间
未读
本人数据
本科
本部门和下级部门数据
本部门数据
框架
比较数据库结构
注册
消息主题
消息摘要
消息类型
港澳台通行证
用户代理
用户名
用户导出
电子邮箱
登录
登录名
登录日志导出
硕士
示例导出
离异
空闲
站内信导出
等于
等待发送
管理模块
系统模块
绑定手机号码
结果非预期
群众
自定义
范围
菜单
角色名称
角色导出
解绑手机号码
警告
计划作业导出
计划作业执行记录导出
请求方式
请求日志导出
调试
跟踪
跟踪标识
跟踪编号
身份证
运行
通知
邮箱号
@ -136,11 +75,7 @@
配置导出
重设密码
链接
错误
随机排序
项值
项名
顺序排序
高中
默认角色
默认部门

View File

@ -1,17 +1,9 @@
1分钟内只能发送1次
6位数字
8位以上数字字母组合
XML注释文件不存在
中文姓名
事务已回滚
事务已提交
人机校验请求不能为空
人机验证未通过
作业名称不能为空
允许的文件大小
允许的文件格式
区号电话号码分机号
参数格式不正确
唯一编码不能为空
图标代码不能为空
图标名称不能为空
@ -19,52 +11,60 @@ XML注释文件不存在
字典名称不能为空
字典目录不存在
字典目录编号不能为空
字典目录编号不能为空
字典编码不能为空
学历不正确
密码不能为空
密码不能为空
密码不能为空
密码不能为空
已处理完毕
已处理完毕
已处理完毕
并发冲突_请稍后重试
开始事务
性别不正确
手机号码不正确
手机号码不能为空
接口编码不存在
支付宝账号
政治面貌不正确
数据库同步开始
数据库服务器时钟偏移
数据库结构同步完成
文件不能为空
新密码不能为空
新手机号码验证码不正确
无效端口号
无效证件号码
旧密码不正确
旧密码不能为空
旧手机号码不正确
旧手机号码验证码不正确
时间表达式
时间计划不能为空
未指定部门
未获取到待执行任务
模块名称不能为空
模块类型不能为空
模块说明不能为空
此节点已下线
此节点已下线
民族不正确
消息主题不能为空
消息内容不能为空
父节点不存在
用户不存在
用户名不能为空
用户名不能是手机号码
用户名不能为空
用户名不能为空
用户名或密码错误
用户名长度4位以上
用户头像不能为空
用户编号不存在
目标设备不能为空
目标设备不能为空
短信验证请求不能为空
短信验证请求不能为空
短信验证请求不能为空
站内信不存在
站内信状态不正确
站内信类型不正确
缓存键不能为空
网络地址不正确
网络地址不正确
网络地址不正确
菜单名称不能为空
菜单标题不能为空
@ -81,21 +81,19 @@ XML注释文件不存在
该部门下存在子部门
该部门下存在用户
请求地址不能为空
请求对象不能为空
请求方法不正确
请稍后重试
请联系管理员激活账号
读取用户令牌出错
账号不能为空
邀请码不正确
邮箱验证码不正确
部门不存在
部门名称不能为空
配置文件初始化完毕
键值不能为空
键名称不能为空
键名称不能为空
随机延时结束时间不正确
随机延时起始时间不正确
非JSON字符串
验证数据不能为空
验证码不正确
验证码不能为空

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
"ExecutionCron": "0 * * * * ?",
"HttpMethod": 3,
"JobName": "HTTP 请求测试",
"NextExecTime": "2020/9/13 12:26:40",
"NextExecTime": "2020-09-13 12:26:40",
"NextTimeId": 1600000000,
"RequestUrl": "https://httpbin.org/ip",
"Status": 1,

View File

@ -15,15 +15,15 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.11.19-preview">
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.11.20">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Roslynator.Analyzers" Version="4.12.4">
<PackageReference Include="Roslynator.Analyzers" Version="4.12.9">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.30.0.95878">
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.32.0.97167">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

View File

@ -9,22 +9,4 @@
Command="dotnet t4 ./gen.cs.tt -o ../dist/backend/$(ProjectName)/Ln.cs"
StdOutEncoding="utf-8" />
</Target>
<ItemGroup>
<None Include="$(SolutionDir)/assets/res/Statements.ln">
<Link>Languages/Statements.ln</Link>
</None>
<None Include="$(SolutionDir)/assets/res/Nations.ln">
<Link>Languages/Nations.ln</Link>
</None>
<None Include="$(SolutionDir)/assets/res/Fields.ln">
<Link>Languages/Fields.ln</Link>
</None>
<EmbeddedResource Include="$(SolutionDir)/assets/res/Ln.resx">
<Link>Languages/Ln.resx</Link>
<Generator>PublicResXFileCodeGenerator</Generator>
</EmbeddedResource>
<Compile Include="$(SolutionDir)/dist/backend/$(ProjectName)/Ln.Designer.cs">
<Link>Languages/Ln.Designer.cs</Link>
</Compile>
</ItemGroup>
</Project>

1
docker/README.md Normal file
View File

@ -0,0 +1 @@
docker

View File

@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-t4": {
"version": "2.3.1",
"version": "3.0.0",
"commands": [
"t4"
]

View File

@ -1,8 +1,8 @@
{
"version": "1.5.0",
"version": "2.0.0",
"devDependencies": {
"cz-git": "^1.9.3",
"commitizen": "^4.3.0",
"cz-git": "^1.10.1",
"commitizen": "^4.3.1",
"prettier": "^3.3.3",
"standard-version": "^9.5.0"
},

Submodule refs/Furion deleted from d23c7cca55

View File

@ -20,8 +20,10 @@ git tag -d $tag
git tag $tag
git push --tags origin release
Start-Process -FilePath "https://github.com/nsnail/NetAdmin/compare/main...release"
Write-Host "按『Enter』回到分支『Ctrl+C』退出"
Write-Host "按『Enter』回到tk分支『Ctrl+C』退出"
Pause
git checkout main
git pull
git branch -D release
git branch -D release
git branch -D tk
git checkout -b tk

View File

@ -0,0 +1,2 @@
git push origin :refs/tags/$(git tag -l "*-*")
git tag -d $(git tag -l "*-*")

View File

@ -1,6 +1,7 @@
<#@ template language="C#" #>
<#@ output encoding="utf-8" extension="resx" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text.RegularExpressions" #>
<?xml version="1.0" encoding="utf-8"?>
<root>
@ -28,14 +29,11 @@
</resheader>
<#
var regex = new Regex(@"^\d", RegexOptions.Compiled);
foreach (var file in Directory.GetFiles("../assets/res/", "*.ln"))
foreach (var line in Directory.GetFiles("../assets/res/", "*.ln").SelectMany(x => File.ReadLines(x)).Distinct())
{
foreach (var line in File.ReadLines(file))
{
#>
<data name="<#= regex.IsMatch(line) ? "_" : "" #><#= line #>" xml:space="preserve"><value><#= line #></value></data>
<#
}
}
#>
</root>

View File

@ -10,11 +10,11 @@
"packages": [
{
"packageName": "FreeSql.NS",
"version": "3.2.833-preview20260627-ns1"
"version": "3.2.833-ns4"
},
{
"packageName": "FreeSql.DbContext.NS",
"version": "3.2.833-preview20260627-ns1"
"version": "3.2.833-ns4"
}
]
}

View File

@ -1,15 +1,15 @@
{
"solution": "NetAdmin.sln",
"mappings": {
"Furion.Pure.NS": "../refs/Furion/framework/Furion.Pure/Furion.Pure.csproj"
"Gurion": "../refs/Gurion/src/Gurion.csproj"
},
"restore": [
{
"name": "NetAdmin.Infrastructure",
"packages": [
{
"packageName": "Furion.Pure.NS",
"version": "4.9.4.6-ns4"
"packageName": "Gurion",
"version": "1.1.0"
}
]
}

View File

@ -17,6 +17,20 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "meta", "meta", "{5198A03D-0
"""
);
content = Regex.Replace(
content,
"Project\\(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\"\\) = \"docker\", \"docker\", \"{E80A1018-C354-4A26-9029-8847BB9DA864}\"(?:.|\n)*?EndProject",
$$"""
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docker", "docker", "{E80A1018-C354-4A26-9029-8847BB9DA864}"
ProjectSection(SolutionItems) = preProject
{{string.Join('\n',
Directory.GetFiles(@"../docker", "*")
.Select(x=>$" {Path.GetFileName(x)} = docker/{Path.GetFileName(x)}")
)}}
EndProject
"""
);
content = Regex.Replace(
content,
"Project\\(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\"\\) = \"workflows\", \"workflows\", \"{3C6F049E-3EE8-4D66-9AFF-E8A369032487}\"(?:.|\n)*?EndProject",

View File

@ -0,0 +1,39 @@
#!/bin/bash
# 检查是否提供了 URL 参数
if [ -z "$1" ]; then
echo "Usage: $0 <url>"
exit 1
fi
# 获取外部传入的 URL 参数
URL="$1"
# 初始化返回值和时间限制
response=""
start_time=$(date +%s)
time_limit=600 # 10分钟的秒数
# 循环检查 API 返回值
while [ "$response" != "1" ]; do
# 等待一段时间再进行下一次检查,避免频繁请求
sleep 1
# 使用 curl 请求 URL并捕获返回值忽略 SSL 证书错误
response=$(curl -sk "$URL")
# 打印返回值 (可选)
echo "$1: $response"
# 检查时间是否超过限制
current_time=$(date +%s)
elapsed_time=$((current_time - start_time))
if [ "$elapsed_time" -ge "$time_limit" ]; then
echo "Time limit exceeded. Continuing with the script..."
break
fi
done
# 无论是因为返回值为 "1" 还是超时,继续执行后续脚本
echo "Continuing with the script..."

View File

@ -25,16 +25,16 @@ global using FreeSql;
global using FreeSql.Aop;
global using FreeSql.DataAnnotations;
global using FreeSql.Internal.Model;
global using Furion;
global using Furion.Authorization;
global using Furion.ConfigurableOptions;
global using Furion.DataEncryption;
global using Furion.DataValidation;
global using Furion.DependencyInjection;
global using Furion.DynamicApiController;
global using Furion.EventBus;
global using Furion.SpecificationDocument;
global using Furion.UnifyResult;
global using Gurion;
global using Gurion.Authorization;
global using Gurion.ConfigurableOptions;
global using Gurion.DataEncryption;
global using Gurion.DataValidation;
global using Gurion.DependencyInjection;
global using Gurion.DynamicApiController;
global using Gurion.EventBus;
global using Gurion.SpecificationDocument;
global using Gurion.UnifyResult;
global using Mapster;
global using Microsoft.AspNetCore.Authorization;
global using Microsoft.AspNetCore.Builder;
@ -63,18 +63,4 @@ global using NetAdmin.Infrastructure.Extensions;
global using NetAdmin.Infrastructure.Languages;
global using NetAdmin.Infrastructure.Utils;
global using NSExt.Attributes;
global using NSExt.Extensions;
#if !INFRAS
global using CsvHelper.Configuration.Attributes;
global using NetAdmin.Domain.Attributes;
global using NetAdmin.Domain.Attributes.DataValidation;
global using NetAdmin.Domain.DbMaps.Dependency;
global using NetAdmin.Domain.DbMaps.Dependency.Fields;
global using NetAdmin.Domain.DbMaps.Sys;
global using CsvIgnore = CsvHelper.Configuration.Attributes.IgnoreAttribute;
global using CsvIndex = CsvHelper.Configuration.Attributes.IndexAttribute;
global using CsvName = CsvHelper.Configuration.Attributes.NameAttribute;
global using DynamicFilterInfo = NetAdmin.Domain.Dto.Dependency.DynamicFilterInfo;
global using DynamicFilterOperators = NetAdmin.Domain.Enums.DynamicFilterOperators;
global using SqlIndex = FreeSql.DataAnnotations.IndexAttribute;
#endif
global using NSExt.Extensions;

View File

@ -1,9 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<DefineConstants>DBTYPE_SQLITE</DefineConstants>
</PropertyGroup>
<Import Project="$(SolutionDir)/build/code.quality.props"/>
<ItemGroup>
<ProjectReference Include="../NetAdmin.AdmServer.Domain/NetAdmin.AdmServer.Domain.csproj"/>
<ProjectReference Include="../NetAdmin.SysComponent.Application/NetAdmin.SysComponent.Application.csproj"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="MailKit" Version="4.8.0"/>
</ItemGroup>
</Project>

View File

@ -1,2 +0,0 @@
<wpf:ResourceDictionary xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xml:space="preserve">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=services_005Cadm_005Cpartial/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(SolutionDir)/build/code.quality.props"/>
<ItemGroup>
<ProjectReference Include="../NetAdmin.SysComponent.Cache/NetAdmin.SysComponent.Cache.csproj"/>
<ProjectReference Include="../NetAdmin.AdmServer.Application/NetAdmin.AdmServer.Application.csproj"/>
<ProjectReference Include="../NetAdmin.SysComponent.Cache/NetAdmin.SysComponent.Cache.csproj"/>
</ItemGroup>
</Project>

View File

@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(SolutionDir)/build/code.quality.props"/>
<ItemGroup>
<Content Include="$(SolutionDir)/assets/seed-data/Adm_*.json" LinkBase="SeedData" CopyToOutputDirectory="PreserveNewest"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../NetAdmin.AdmServer.Infrastructure/NetAdmin.AdmServer.Infrastructure.csproj"/>
<ProjectReference Include="../NetAdmin.SysComponent.Domain/NetAdmin.SysComponent.Domain.csproj"/>
</ItemGroup>
</Project>

View File

@ -9,8 +9,8 @@ namespace NetAdmin.AdmServer.Host.Extensions;
public static class IApplicationBuilderExtensions
{
private const string _INDEX_HTML_PATH = ".index.html";
private const string _RES_PFX = $"{nameof(NetAdmin)}.{nameof(AdmServer)}.{nameof(Host)}.UI";
private static readonly Regex _regex = new(@"\.(\w+)$", RegexOptions.Compiled);
private const string _RES_PFX = $"{nameof(NetAdmin)}.{nameof(AdmServer)}.{nameof(Host)}.UI";
private static readonly Regex _regex = new(@"\.(\w+)$", RegexOptions.Compiled);
private static IEnumerable<string> _allResNames;
/// <summary>

View File

@ -1,7 +1,8 @@
using NetAdmin.AdmServer.Host.Filters;
using NetAdmin.Domain.Contexts;
using NetAdmin.Domain.Enums.Sys;
using NetAdmin.Host.Extensions;
using NetAdmin.Domain.DbMaps.Dependency.Fields;
using NetAdmin.SysComponent.Domain.Contexts;
using NetAdmin.SysComponent.Domain.Enums.Sys;
using NetAdmin.SysComponent.Host.Extensions;
namespace NetAdmin.AdmServer.Host.Extensions;
@ -21,8 +22,7 @@ public static class ServiceCollectionExtensions
(Startup.Args.InsertSeedData ? FreeSqlInitMethods.InsertSeedData : FreeSqlInitMethods.None), freeSql => {
// 数据权限过滤器
_ = freeSql.GlobalFilter.ApplyOnlyIf<IFieldOwner>( //
Chars.FLG_FREE_SQL_GLOBAL_FILTER_DATA
, () => ContextUserInfo.Create()?.Roles.All(x => x.DataScope == DataScopes.Self) ?? false
Chars.FLG_FREE_SQL_GLOBAL_FILTER_DATA, () => ContextUserInfo.Create()?.Roles.All(x => x.DataScope == DataScopes.Self) ?? false
, a => a.OwnerId == ContextUserInfo.Create().Id);
});
}

View File

@ -1,17 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="$(SolutionDir)/build/code.quality.props"/>
<ItemGroup>
<EmbeddedResource Include="$(SolutionDir)/assets/captcha/**" LinkBase="Assets/Captcha"/>
<EmbeddedResource Include="$(SolutionDir)/CHANGELOG.md" LogicalName="CHANGELOG.md"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../NetAdmin.SysComponent.Host/NetAdmin.SysComponent.Host.csproj"/>
<ProjectReference Include="../NetAdmin.AdmServer.Cache/NetAdmin.AdmServer.Cache.csproj"/>
</ItemGroup>
<ItemGroup>
<None Update="*.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<ProjectReference Include="../NetAdmin.SysComponent.Host/NetAdmin.SysComponent.Host.csproj"/>
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' != 'Debug'">
<EmbeddedResource Include="../../../dist/frontend/admin/**/*" LinkBase="UI"/>

View File

@ -1,13 +1,34 @@
/*
_ooOoo_
o8888888o
88" . "88
(| -_- |)
O\ = /O
____/`---'\____
.' \\| |// `.
/ \\||| : |||// \
/ _||||| -:- |||||- \
| | \\\ - /// | |
| \_| ''\---/'' | |
\ .-\__ `-` ___/-. /
___`. .' /--.--\ `. . __
."" '< `.___\_<|>_/___.' >'"".
| | : `- \`.;`\ _ /`;.`/ - ` : | |
\ \ `-. \_ __\ /__ _/ .-` / /
======`-.____`-.___\_____/___.-`____.-'======
`=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
佛祖保佑 永无BUG
*/
using NetAdmin.AdmServer.Host;
using NetAdmin.AdmServer.Host.Extensions;
using NetAdmin.Host.Extensions;
using NetAdmin.Host.Middlewares;
using NetAdmin.SysComponent.Host.Extensions;
using NetAdmin.SysComponent.Host.Middlewares;
using Spectre.Console.Cli;
using ValidationResult = Spectre.Console.ValidationResult;
#if !DEBUG
using Prometheus;
#endif
NetAdmin.Host.Startup.Entry<Startup>(args);
@ -26,8 +47,12 @@ namespace NetAdmin.AdmServer.Host
/// <summary>
/// 配置应用程序中间件
/// </summary>
#pragma warning disable S2325
public void Configure(IApplicationBuilder app, IHostApplicationLifetime lifeTime)
#pragma warning restore S2325
{
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
_ = app //
.UseMiddleware<SafetyShopHostMiddleware>() // 安全停机中间件
.EnableBuffering() // 启用请求体缓冲,允许多次读取请求体
@ -36,15 +61,17 @@ namespace NetAdmin.AdmServer.Host
.UseOpenApiSkin() // 使用OpenApiSkin中间件仅在调试模式下提供Swagger UI皮肤
#else
.UseVueAdmin() // 托管管理后台,仅在非调试模式下
.UseHttpMetrics() // 使用HttpMetrics中间件启用HTTP性能监控
.UsePrometheus() // 使用Prometheus中间件启用HTTP性能监控
#endif
.UseInject(string.Empty) // 使用Inject中间件Furion脚手架的依赖注入支持
.UseInject(string.Empty) // 使用Inject中间件Gurion脚手架的依赖注入支持
.UseUnifyResultStatusCodes() // 使用UnifyResultStatusCodes中间件用于统一处理结果状态码
.UseCorsAccessor() // 使用CorsAccessor中间件启用跨域资源共享CORS支持
.UseRouting() // 使用Routing中间件配置路由映射
.UseAuthentication() // 使用Authentication中间件启用身份验证
.UseAuthorization() // 使用Authorization中间件启用授权
.UseMiddleware<RemoveNullNodeMiddleware>() // 使用RemoveNullNodeMiddleware中间件删除JSON中的空节点
.UseWebSockets() // 使用WebSockets中间件启用WebSocket支持
.UseMiddleware<VersionCheckerMiddleware>() // 使用VersionUpdaterMiddleware中间件用于检查版本
.UseEndpoints(); // 配置端点以处理请求
_ = lifeTime.ApplicationStopping.Register(SafetyShopHostMiddleware.OnStopping);
}
@ -52,7 +79,9 @@ namespace NetAdmin.AdmServer.Host
/// <summary>
/// 配置服务容器
/// </summary>
#pragma warning disable S2325
public void ConfigureServices(IServiceCollection services)
#pragma warning restore S2325
{
_ = services.AddConsoleFormatter() // 添加控制台日志模板
.AddAllOptions() // 添加配置项
@ -62,7 +91,8 @@ namespace NetAdmin.AdmServer.Host
.AddFreeSqlWithArgs() // 添加 freeSql
.AddRemoteRequest() // 添加远程请求
.AddCorsAccessor() // 添加支持跨域访问
.AddContextUser() // 添加上下文用户
.AddContextUserToken() // 添加上下文用户令牌
.AddContextUserInfo() // 添加上下文用户信息
.AddRedisCache() // 添加 Redis 缓存
.AddSchedules() // 添加计划任务
@ -75,12 +105,18 @@ namespace NetAdmin.AdmServer.Host
/// <inheritdoc />
#pragma warning disable ASA001
public Task<int> Execute(CommandContext context, CommandLineArgs settings)
public async Task<int> Execute(CommandContext context, CommandLineArgs settings)
#pragma warning restore ASA001
{
Args = settings;
_ = Serve.Run(RunOptions.Default.WithArgs(context.Remaining.Raw.ToArray()));
return Task.FromResult(0);
var webOpt = new WebApplicationOptions //
{
EnvironmentName = Environment.GetEnvironmentVariable("TEST_ENVIRONMENT").NullOrEmpty(null)
, Args = context.Remaining.Raw.ToArray()
};
Serve.BuildApplication(RunOptions.Default.ConfigureOptions(webOpt), null, out var startUrl, out var app);
await app.RunAsync(startUrl).ConfigureAwait(false);
return 0;
}
/// <inheritdoc />

View File

@ -1,45 +0,0 @@
{
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
"SpecificationDocumentSettings": {
"GroupOpenApiInfos": [
{
"Group": "Sys",
"Title": "系统组件",
"Description": "NetAdmin - 系统组件",
},
{
"Group": "Adm",
"Title": "管理服务",
"Description": "NetAdmin - 管理服务",
},
{
"Group": "Tpl",
"Visible": false,
},
{
"Group": "Probe",
"Visible": false,
}
],
"SecurityDefinitions": [
{
"Id": "Bearer",
"Type": "ApiKey",
"Name": "Authorization",
"Description": "JWT Authorization header using the Bearer scheme.",
"BearerFormat": "JWT",
"Scheme": "bearer",
"In": "Header",
"Requirement": {
"Scheme": {
"Reference": {
"Id": "Bearer",
"Type": "SecurityScheme"
},
"Accesses": []
}
}
}
]
}
}

View File

@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Debug",
"Microsoft.AspNetCore": "Debug",
"System.Logging.EventBusService": "Debug"
},
}
}

View File

@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Debug",
"Microsoft.AspNetCore": "Debug",
"System.Logging.EventBusService": "Debug"
},
}
}

View File

@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Debug",
"Microsoft.AspNetCore": "Debug",
"System.Logging.EventBusService": "Debug"
},
}
}

View File

@ -0,0 +1,98 @@
{
// Swagger文档配置 ------------------------------------------------------------------------------
"SpecificationDocumentSettings": {
"GroupOpenApiInfos": [
{
"Group": "Sys",
"Title": "系统组件",
"Description": "NetAdmin - 系统组件"
},
{
"Group": "Adm",
"Title": "管理服务",
"Description": "NetAdmin - 管理服务"
},
{
"Group": "Tpl",
"Visible": false
},
{
"Group": "Probe",
"Visible": false
}
],
"XmlComments": [
"NetAdmin.AdmServer.Application.xml",
"NetAdmin.AdmServer.Cache.xml",
"NetAdmin.AdmServer.Domain.xml",
"NetAdmin.AdmServer.Host.xml",
"NetAdmin.AdmServer.Infrastructure.xml",
"FreeSql.xml",
"NetAdmin.Application.xml",
"NetAdmin.Cache.xml",
"NetAdmin.Domain.xml",
"NetAdmin.Host.xml",
"NetAdmin.Infrastructure.xml",
"NetAdmin.SysComponent.Application.xml",
"NetAdmin.SysComponent.Cache.xml",
"NetAdmin.SysComponent.Domain.xml",
"NetAdmin.SysComponent.Host.xml",
"NetAdmin.SysComponent.Infrastructure.xml"
]
},
// 数据库配置 --------------------------------------------------------------------------------------------------------
"Database": {
"DbType": "Sqlite",
"ConnStr": "data source=NetAdmin.db",
"SeedDataRelativePath": "SeedData"
},
// JWT鉴权配置 -------------------------------------------------------------------------------------------------------
"JWTSettings": {
"ValidateIssuerSigningKey": true,
"IssuerSigningKey": "bO0BCAGxpxYnm6AE4XpgO25T27NayFzjGgfDqBuzUzD6ROpFiZUi3KjVg93bdGek",
"ValidateIssuer": true,
"ValidIssuer": "签发方",
"ValidateAudience": true,
"ValidAudience": "签收方",
"ValidateLifetime": true,
"ExpiredTime": 5256000,
"ClockSkew": 5,
"Algorithm": "HS256"
},
// 日志配置 ----------------------------------------------------------------------------------------------------------
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"System.Logging.EventBusService": "Error"
}
},
// Redis配置 --------------------------------------------------------------------------------------------------------
"Redis": {
"Instances": [
{
"Name": "DataCache",
"ConnStr": "localhost:6379,abortConnect=false",
"DataBase": 0
}
]
},
// 文件上传配置 -------------------------------------------------------------------------------------------------------
"Upload": {
"ContentTypes": [
"image/jpg",
"image/png",
"image/jpeg",
"image/gif"
],
"MaxSize": 1073741824,
"Minio": {
"ServerAddress": "vm-ubt-1:9000",
"AccessKey": "nVMM0gSqwyIjM8iZ",
"SecretKey": "F8OZngGrNsZSYn4MP9swwMSf5rfm61EC",
"BucketName": "cloud-code",
"AccessUrl": "http://vm-ubt-1:9000",
"Secure": false
}
},
}

View File

@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(SolutionDir)/build/code.quality.props"/>
<ItemGroup>
<ProjectReference Include="../NetAdmin.Infrastructure/NetAdmin.Infrastructure.csproj"/>
</ItemGroup>
<ItemGroup>
<None Include="$(SolutionDir)/assets/res/NetAdmin.AdmServer.Statements.ln">
<Link>Languages/NetAdmin.AdmServer.Statements.ln</Link>
</None>
<None Include="$(SolutionDir)/assets/res/NetAdmin.AdmServer.Fields.ln">
<Link>Languages/NetAdmin.AdmServer.Fields.ln</Link>
</None>
</ItemGroup>
<ItemGroup>
<None Update="*.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
namespace NetAdmin.Host.Extensions;
namespace NetAdmin.Application.Extensions;
/// <summary>
/// 工作单元管理器扩展方法

View File

@ -1,8 +1,7 @@
using NetAdmin.Application.Modules;
using NetAdmin.Domain.Dto.Dependency;
using NetAdmin.Domain.Dto.Tpl.Example;
namespace NetAdmin.SysComponent.Application.Modules.Tpl;
namespace NetAdmin.Application.Modules.Tpl;
/// <summary>
/// 示例模块

View File

@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<DefineConstants>DBTYPE_SQLITE</DefineConstants>
</PropertyGroup>
<Import Project="$(SolutionDir)/build/code.quality.props"/>
<ItemGroup>
<ProjectReference Include="../NetAdmin.Domain/NetAdmin.Domain.csproj"/>

View File

@ -1,14 +1,13 @@
using NetAdmin.Domain.Contexts;
using NetAdmin.Domain.DbMaps.Dependency;
namespace NetAdmin.Application.Repositories;
/// <summary>
/// 基础仓储
/// </summary>
public sealed class BasicRepository<TEntity, TPrimary>(
IFreeSql fSql
, UnitOfWorkManager uowManger
, ContextUserToken userToken) : DefaultRepository<TEntity, TPrimary>(fSql, uowManger)
public sealed class BasicRepository<TEntity, TPrimary>(IFreeSql fSql, UnitOfWorkManager uowManger, ContextUserToken userToken)
: DefaultRepository<TEntity, TPrimary>(fSql, uowManger)
where TEntity : EntityBase<TPrimary> //
where TPrimary : IEquatable<TPrimary>
{

View File

@ -1,50 +0,0 @@
using NetAdmin.Application.Repositories;
using RedLockNet;
namespace NetAdmin.Application.Services;
/// <summary>
/// RedLocker Service Base
/// </summary>
public abstract class RedLockerService<TEntity, TPrimary, TLogger>(
BasicRepository<TEntity, TPrimary> rpo
, RedLocker redLocker) : RepositoryService<TEntity, TPrimary, TLogger>(rpo)
where TEntity : EntityBase<TPrimary> //
where TPrimary : IEquatable<TPrimary>
{
/// <summary>
/// 获取锁
/// </summary>
protected Task<IRedLock> GetLockerAsync(string lockName)
{
return GetLockerAsync(lockName, TimeSpan.FromSeconds(Numbers.SECS_RED_LOCK_WAIT)
, TimeSpan.FromSeconds(Numbers.SECS_RED_LOCK_RETRY_INTERVAL));
}
/// <summary>
/// 获取锁
/// </summary>
/// <exception cref="NetAdminGetLockerException">NetAdminGetLockerException</exception>
protected async Task<IRedLock> GetLockerAsync(string lockName, TimeSpan waitTime, TimeSpan retryInterval)
{
// 加锁
var lockTask = waitTime == default || retryInterval == default
? redLocker.RedLockFactory.CreateLockAsync(lockName, TimeSpan.FromSeconds(Numbers.SECS_RED_LOCK_EXPIRY))
: redLocker.RedLockFactory.CreateLockAsync( //
lockName, TimeSpan.FromSeconds(Numbers.SECS_RED_LOCK_EXPIRY), waitTime, retryInterval);
var redLock = await lockTask.ConfigureAwait(false);
return redLock.IsAcquired ? redLock : throw new NetAdminGetLockerException();
}
/// <summary>
/// 获取锁
/// </summary>
/// <remarks>
/// 不重试,失败直接抛出异常
/// </remarks>
protected Task<IRedLock> GetLockerOnceAsync(string lockName)
{
return GetLockerAsync(lockName, default, default);
}
}

View File

@ -0,0 +1,43 @@
using NetAdmin.Application.Repositories;
using NetAdmin.Domain.DbMaps.Dependency;
using StackExchange.Redis;
namespace NetAdmin.Application.Services;
/// <summary>
/// Redis Service Base
/// </summary>
/// <remarks>
/// Initializes a new instance of the <see cref="RedisService{TEntity, TPrimary, TLogger}" /> class.
/// Redis Service Base
/// </remarks>
public abstract class RedisService<TEntity, TPrimary, TLogger>(BasicRepository<TEntity, TPrimary> rpo)
: RepositoryService<TEntity, TPrimary, TLogger>(rpo)
where TEntity : EntityBase<TPrimary> //
where TPrimary : IEquatable<TPrimary>
{
/// <summary>
/// Redis Database
/// </summary>
protected IDatabase RedisDatabase { get; } //
= App.GetService<IConnectionMultiplexer>()
.GetDatabase(App.GetOptions<RedisOptions>().Instances.First(x => x.Name == Chars.FLG_REDIS_INSTANCE_DATA_CACHE).Database);
/// <summary>
/// 获取锁
/// </summary>
protected Task<RedisLocker> GetLockerAsync(string lockerName)
{
return RedisLocker.GetLockerAsync(RedisDatabase, lockerName, TimeSpan.FromSeconds(Numbers.SECS_REDIS_LOCK_EXPIRY)
, Numbers.MAX_LIMIT_RETRY_CNT_REDIS_LOCK, TimeSpan.FromSeconds(Numbers.SECS_REDIS_LOCK_RETRY_DELAY));
}
/// <summary>
/// 获取锁(仅获取一次)
/// </summary>
protected Task<RedisLocker> GetLockerOnceAsync(string lockerName)
{
return RedisLocker.GetLockerAsync(RedisDatabase, lockerName, TimeSpan.FromSeconds(Numbers.SECS_REDIS_LOCK_EXPIRY), 1
, TimeSpan.FromSeconds(Numbers.SECS_REDIS_LOCK_RETRY_DELAY));
}
}

View File

@ -2,6 +2,8 @@ using CsvHelper;
using Microsoft.Net.Http.Headers;
using NetAdmin.Application.Repositories;
using NetAdmin.Domain;
using NetAdmin.Domain.DbMaps.Dependency;
using NetAdmin.Domain.DbMaps.Dependency.Fields;
using NetAdmin.Domain.Dto.Dependency;
namespace NetAdmin.Application.Services;
@ -12,8 +14,7 @@ namespace NetAdmin.Application.Services;
/// <typeparam name="TEntity">实体类型</typeparam>
/// <typeparam name="TPrimary">主键类型</typeparam>
/// <typeparam name="TLogger">日志类型</typeparam>
public abstract class RepositoryService<TEntity, TPrimary, TLogger>(BasicRepository<TEntity, TPrimary> rpo)
: ServiceBase<TLogger>
public abstract class RepositoryService<TEntity, TPrimary, TLogger>(BasicRepository<TEntity, TPrimary> rpo) : ServiceBase<TLogger>
where TEntity : EntityBase<TPrimary> //
where TPrimary : IEquatable<TPrimary>
{
@ -33,9 +34,20 @@ public abstract class RepositoryService<TEntity, TPrimary, TLogger>(BasicReposit
/// <summary>
/// 导出实体
/// </summary>
protected async Task<IActionResult> ExportAsync<TQuery, TExport>( //
Func<QueryReq<TQuery>, ISelect<TEntity>> selector, QueryReq<TQuery> query, string fileName
, Expression<Func<TEntity, object>> listExp = null)
protected static async Task<IActionResult> ExportAsync<TQuery, TExport>( //
Func<QueryReq<TQuery>, ISelectGrouping<TEntity, TEntity>> selector, QueryReq<TQuery> query, string fileName
, Expression<Func<ISelectGroupingAggregate<TEntity, TEntity>, object>> listExp = null)
where TQuery : DataAbstraction, new()
{
var list = await selector(query).Take(Numbers.MAX_LIMIT_EXPORT).ToListAsync(listExp).ConfigureAwait(false);
return await GetExportFileStreamAsync<TExport>(fileName, list).ConfigureAwait(false);
}
/// <summary>
/// 导出实体
/// </summary>
protected static async Task<IActionResult> ExportAsync<TQuery, TExport>( //
Func<QueryReq<TQuery>, ISelect<TEntity>> selector, QueryReq<TQuery> query, string fileName, Expression<Func<TEntity, object>> listExp = null)
where TQuery : DataAbstraction, new()
{
var select = selector(query)
@ -44,30 +56,9 @@ public abstract class RepositoryService<TEntity, TPrimary, TLogger>(BasicReposit
#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);
var listTyped = list.Adapt<List<TExport>>();
var stream = new MemoryStream();
var writer = new StreamWriter(stream);
var csv = new CsvWriter(writer, CultureInfo.InvariantCulture);
csv.WriteHeader<TExport>();
await csv.NextRecordAsync().ConfigureAwait(false);
foreach (var item in listTyped) {
csv.WriteRecord(item);
await csv.NextRecordAsync().ConfigureAwait(false);
}
await csv.FlushAsync().ConfigureAwait(false);
_ = stream.Seek(0, SeekOrigin.Begin);
App.HttpContext.Response.Headers.ContentDisposition
= new ContentDispositionHeaderValue(Chars.FLG_HTTP_HEADER_VALUE_ATTACHMENT) {
FileNameStar = $"{fileName}_{DateTime.Now:yyyy.MM.dd-HH.mm.ss}.csv"
}.ToString();
return new FileStreamResult(stream, Chars.FLG_HTTP_HEADER_VALUE_APPLICATION_OCTET_STREAM);
return await GetExportFileStreamAsync<TExport>(fileName, list).ConfigureAwait(false);
}
/// <summary>
@ -102,21 +93,49 @@ public abstract class RepositoryService<TEntity, TPrimary, TLogger>(BasicReposit
/// <param name="includeFields">包含的属性</param>
/// <param name="excludeFields">排除的属性</param>
/// <param name="whereExp">查询表达式</param>
/// <param name="whereSql">查询sql</param>
/// <param name="ignoreVersion">是否忽略版本锁</param>
/// <returns>更新后的实体列表</returns>
protected Task<List<TEntity>> UpdateReturnListAsync( //
TEntity newValue //
, IEnumerable<string> includeFields //
, string[] excludeFields = null //
, Expression<Func<TEntity, bool>> whereExp = null //
, Expression<Func<TEntity, bool>> whereExp = null //
, string whereSql = null //
, bool ignoreVersion = false)
{
// 默认匹配主键
whereExp ??= a => a.Id.Equals(newValue.Id);
return BuildUpdate(newValue, includeFields, excludeFields, ignoreVersion).Where(whereExp).ExecuteUpdatedAsync();
return BuildUpdate(newValue, includeFields, excludeFields, ignoreVersion).Where(whereExp).Where(whereSql).ExecuteUpdatedAsync();
}
#endif
private static async Task<IActionResult> GetExportFileStreamAsync<TExport>(string fileName, object list)
{
var listTyped = list.Adapt<List<TExport>>();
var stream = new MemoryStream();
var writer = new StreamWriter(stream);
var csv = new CsvWriter(writer, CultureInfo.InvariantCulture);
csv.WriteHeader<TExport>();
await csv.NextRecordAsync().ConfigureAwait(false);
foreach (var item in listTyped) {
csv.WriteRecord(item);
await csv.NextRecordAsync().ConfigureAwait(false);
}
await csv.FlushAsync().ConfigureAwait(false);
_ = stream.Seek(0, SeekOrigin.Begin);
App.HttpContext.Response.Headers.ContentDisposition
= new ContentDispositionHeaderValue(Chars.FLG_HTTP_HEADER_VALUE_ATTACHMENT) {
FileNameStar
= $"{fileName}_{DateTime.Now:yyyy.MM.dd-HH.mm.ss}.csv"
}.ToString();
return new FileStreamResult(stream, Chars.FLG_HTTP_HEADER_VALUE_APPLICATION_OCTET_STREAM);
}
private IUpdate<TEntity> BuildUpdate( //
TEntity entity //
, IEnumerable<string> includeFields //
@ -126,9 +145,7 @@ public abstract class RepositoryService<TEntity, TPrimary, TLogger>(BasicReposit
var updateExp = includeFields == null
? Rpo.UpdateDiy.SetSource(entity)
: Rpo.UpdateDiy.SetDto(includeFields!.ToDictionary(
x => x
, x => typeof(TEntity).GetProperty(x, BindingFlags.Public | BindingFlags.Instance)!
.GetValue(entity)));
x => x, x => typeof(TEntity).GetProperty(x, BindingFlags.Public | BindingFlags.Instance)!.GetValue(entity)));
if (excludeFields != null) {
updateExp = updateExp.IgnoreColumns(excludeFields);
}

View File

@ -0,0 +1,8 @@
using NetAdmin.Application.Modules.Tpl;
namespace NetAdmin.Application.Services.Tpl.Dependency;
/// <summary>
/// 示例服务
/// </summary>
public interface IExampleService : IService, IExampleModule;

View File

@ -1,11 +1,10 @@
using NetAdmin.Application.Repositories;
using NetAdmin.Application.Services;
using NetAdmin.Application.Services.Tpl.Dependency;
using NetAdmin.Domain.DbMaps.Tpl;
using NetAdmin.Domain.Dto.Dependency;
using NetAdmin.Domain.Dto.Tpl.Example;
using NetAdmin.SysComponent.Application.Services.Tpl.Dependency;
namespace NetAdmin.SysComponent.Application.Services.Tpl;
namespace NetAdmin.Application.Services.Tpl;
/// <inheritdoc cref="IExampleService" />
public sealed class ExampleService(BasicRepository<Tpl_Example, long> rpo) //
@ -30,10 +29,10 @@ public sealed class ExampleService(BasicRepository<Tpl_Example, long> rpo) //
{
req.ThrowIfInvalid();
return QueryInternal(req)
#if DBTYPE_SQLSERVER
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.CountAsync();
#endif
.CountAsync();
}
/// <inheritdoc />
@ -56,10 +55,10 @@ public sealed class ExampleService(BasicRepository<Tpl_Example, long> rpo) //
{
req.ThrowIfInvalid();
return QueryInternal(req)
#if DBTYPE_SQLSERVER
#if DBTYPE_SQLSERVER
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
#endif
.AnyAsync();
#endif
.AnyAsync();
}
/// <inheritdoc />
@ -73,9 +72,7 @@ public sealed class ExampleService(BasicRepository<Tpl_Example, long> rpo) //
public async Task<QueryExampleRsp> GetAsync(QueryExampleReq req)
{
req.ThrowIfInvalid();
var ret = await QueryInternal(new QueryReq<QueryExampleReq> { Filter = req })
.ToOneAsync()
.ConfigureAwait(false);
var ret = await QueryInternal(new QueryReq<QueryExampleReq> { Filter = req, Order = Orders.None }).ToOneAsync().ConfigureAwait(false);
return ret.Adapt<QueryExampleRsp>();
}
@ -92,8 +89,7 @@ public sealed class ExampleService(BasicRepository<Tpl_Example, long> rpo) //
.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>>());
}
/// <inheritdoc />

View File

@ -5,8 +5,7 @@ namespace NetAdmin.Cache;
/// <summary>
/// 缓存基类
/// </summary>
public abstract class CacheBase<TCacheContainer, TService>(TCacheContainer cache, TService service)
: ICache<TCacheContainer, TService>
public abstract class CacheBase<TCacheContainer, TService>(TCacheContainer cache, TService service) : ICache<TCacheContainer, TService>
where TService : IService
{
/// <inheritdoc />

View File

@ -6,8 +6,7 @@ namespace NetAdmin.Cache;
/// <summary>
/// 分布式缓存
/// </summary>
public abstract class DistributedCache<TService>(IDistributedCache cache, TService service)
: CacheBase<IDistributedCache, TService>(cache, service)
public abstract class DistributedCache<TService>(IDistributedCache cache, TService service) : CacheBase<IDistributedCache, TService>(cache, service)
where TService : IService
{
/// <summary>
@ -66,12 +65,10 @@ public abstract class DistributedCache<TService>(IDistributedCache cache, TServi
/// <param name="slideLifeTime">滑动过期时间</param>
/// <typeparam name="T">缓存对象类型</typeparam>
/// <returns>缓存对象</returns>
protected async Task<T> GetOrCreateAsync<T>(string key, Func<Task<T>> createProc, TimeSpan? absLifeTime = null
, TimeSpan? slideLifeTime = null)
protected async Task<T> GetOrCreateAsync<T>(string key, Func<Task<T>> createProc, TimeSpan? absLifeTime = null, TimeSpan? slideLifeTime = null)
{
var cacheRead = await GetAsync<T>(key).ConfigureAwait(false);
if (cacheRead is not null && App.HttpContext?.Request.Headers.CacheControl.FirstOrDefault() !=
Chars.FLG_HTTP_HEADER_VALUE_NO_CACHE) {
if (cacheRead is not null && App.HttpContext?.Request.Headers.CacheControl.FirstOrDefault() != Chars.FLG_HTTP_HEADER_VALUE_NO_CACHE) {
return cacheRead;
}

View File

@ -5,6 +5,5 @@ namespace NetAdmin.Cache;
/// <summary>
/// 内存缓存
/// </summary>
public abstract class MemoryCache<TService>(IMemoryCache cache, TService service)
: CacheBase<IMemoryCache, TService>(cache, service)
public abstract class MemoryCache<TService>(IMemoryCache cache, TService service) : CacheBase<IMemoryCache, TService>(cache, service)
where TService : IService;

View File

@ -0,0 +1,9 @@
using NetAdmin.Application.Modules.Tpl;
using NetAdmin.Application.Services.Tpl.Dependency;
namespace NetAdmin.Cache.Tpl.Dependency;
/// <summary>
/// 示例缓存
/// </summary>
public interface IExampleCache : ICache<IDistributedCache, IExampleService>, IExampleModule;

View File

@ -1,10 +1,9 @@
using NetAdmin.Cache;
using NetAdmin.Application.Services.Tpl.Dependency;
using NetAdmin.Cache.Tpl.Dependency;
using NetAdmin.Domain.Dto.Dependency;
using NetAdmin.Domain.Dto.Tpl.Example;
using NetAdmin.SysComponent.Application.Services.Tpl.Dependency;
using NetAdmin.SysComponent.Cache.Tpl.Dependency;
namespace NetAdmin.SysComponent.Cache.Tpl;
namespace NetAdmin.Cache.Tpl;
/// <inheritdoc cref="IExampleCache" />
public sealed class ExampleCache(IDistributedCache cache, IExampleService service)

View File

@ -0,0 +1,7 @@
namespace NetAdmin.Domain.Attributes;
/// <summary>
/// 危险字段标记
/// </summary>
[AttributeUsage(AttributeTargets.Property)]
public sealed class DangerFieldAttribute : Attribute;

View File

@ -9,8 +9,6 @@ public sealed class JsonStringAttribute : ValidationAttribute
/// <inheritdoc />
protected override ValidationResult IsValid(object value, ValidationContext validationContext)
{
return (value as string).IsJsonString()
? ValidationResult.Success
: new ValidationResult(Ln.JSON字符串, new[] { validationContext.MemberName });
return (value as string).IsJsonString() ? ValidationResult.Success : new ValidationResult(Ln.JSON字符串, [validationContext.MemberName]);
}
}

View File

@ -1,5 +1,3 @@
using NetAdmin.Domain.Dto.Sys.User;
namespace NetAdmin.Domain.Contexts;
/// <summary>
@ -43,11 +41,9 @@ public sealed record ContextUserToken : DataAbstraction
/// <summary>
/// 从 QueryUserRsp 创建上下文用户
/// </summary>
public static ContextUserToken Create(QueryUserRsp user)
public static ContextUserToken Create(long id, Guid token, string userName, long deptId)
{
return new ContextUserToken {
Id = user.Id, Token = user.Token, UserName = user.UserName, DeptId = user.DeptId
};
return new ContextUserToken { Id = id, Token = token, UserName = userName, DeptId = deptId };
}
/// <summary>

View File

@ -30,9 +30,7 @@ public abstract record DataAbstraction
/// </summary>
public void TruncateStrings()
{
foreach (var property in GetType()
.GetProperties(BindingFlags.Public | BindingFlags.Instance)
.Where(x => x.PropertyType == typeof(string))) {
foreach (var property in GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType == typeof(string))) {
var maxLen = property.GetCustomAttribute<MaxLengthAttribute>(true)?.Length;
if (maxLen is null or 0) {
continue;

View File

@ -1,7 +1,7 @@
namespace NetAdmin.Domain.DbMaps.Dependency.Fields;
/// <summary>
/// 更新用户字段接口
/// 修改用户字段接口
/// </summary>
public interface IFieldModifiedUser
{

View File

@ -1,12 +1,12 @@
namespace NetAdmin.Domain.DbMaps.Dependency.Fields;
/// <summary>
/// 描述字段接口
/// 备注字段接口
/// </summary>
public interface IFieldSummary
{
/// <summary>
/// 描述
/// 备注
/// </summary>
string Summary { get; init; }
}

View File

@ -3,7 +3,9 @@ namespace NetAdmin.Domain.DbMaps.Dependency;
/// <inheritdoc />
public abstract record ImmutableEntity : ImmutableEntity<long>
{
/// <inheritdoc cref="EntityBase{T}.Id" />
/// <summary>
/// 唯一编码
/// </summary>
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
[CsvIgnore]
[Snowflake]
@ -17,19 +19,25 @@ public abstract record ImmutableEntity : ImmutableEntity<long>
public abstract record ImmutableEntity<T> : LiteImmutableEntity<T>, IFieldCreatedUser
where T : IEquatable<T>
{
/// <inheritdoc cref="IFieldCreatedUser.CreatedUserId" />
/// <summary>
/// 创建者编号
/// </summary>
[Column(CanUpdate = false, Position = -1)]
[CsvIgnore]
[JsonIgnore]
public long? CreatedUserId { get; init; }
/// <inheritdoc cref="IFieldCreatedUser.CreatedUserName" />
/// <summary>
/// 创建者用户名
/// </summary>
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31, CanUpdate = false, Position = -1)]
[CsvIgnore]
[JsonIgnore]
public virtual string CreatedUserName { get; init; }
/// <inheritdoc cref="EntityBase{T}.Id" />
/// <summary>
/// 唯一编码
/// </summary>
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
[CsvIgnore]
public override T Id { get; init; }

View File

@ -3,7 +3,9 @@ namespace NetAdmin.Domain.DbMaps.Dependency;
/// <inheritdoc />
public abstract record LiteImmutableEntity : LiteImmutableEntity<long>
{
/// <inheritdoc cref="EntityBase{T}.Id" />
/// <summary>
/// 唯一编码
/// </summary>
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
[CsvIgnore]
[Snowflake]
@ -17,13 +19,17 @@ public abstract record LiteImmutableEntity : LiteImmutableEntity<long>
public abstract record LiteImmutableEntity<T> : EntityBase<T>, IFieldCreatedTime
where T : IEquatable<T>
{
/// <inheritdoc cref="IFieldCreatedTime.CreatedTime" />
/// <summary>
/// 创建时间
/// </summary>
[Column(ServerTime = DateTimeKind.Local, CanUpdate = false, Position = -1)]
[CsvIgnore]
[JsonIgnore]
public virtual DateTime CreatedTime { get; init; }
/// <inheritdoc cref="EntityBase{T}.Id" />
/// <summary>
/// 唯一编码
/// </summary>
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
[CsvIgnore]
[JsonIgnore]

View File

@ -3,7 +3,9 @@ namespace NetAdmin.Domain.DbMaps.Dependency;
/// <inheritdoc />
public abstract record LiteMutableEntity : LiteMutableEntity<long>
{
/// <inheritdoc cref="EntityBase{T}.Id" />
/// <summary>
/// 唯一编码
/// </summary>
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
[CsvIgnore]
[Snowflake]
@ -16,12 +18,16 @@ public abstract record LiteMutableEntity : LiteMutableEntity<long>
public abstract record LiteMutableEntity<T> : LiteImmutableEntity<T>, IFieldModifiedTime
where T : IEquatable<T>
{
/// <inheritdoc cref="EntityBase{T}.Id" />
/// <summary>
/// 唯一编码
/// </summary>
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
[CsvIgnore]
public override T Id { get; init; }
/// <inheritdoc cref="IFieldModifiedTime.ModifiedTime" />
/// <summary>
/// 修改时间
/// </summary>
[Column(ServerTime = DateTimeKind.Local, CanInsert = false, Position = -1)]
[CsvIgnore]
[JsonIgnore]

View File

@ -3,7 +3,9 @@ namespace NetAdmin.Domain.DbMaps.Dependency;
/// <inheritdoc />
public abstract record LiteVersionEntity : LiteVersionEntity<long>
{
/// <inheritdoc cref="EntityBase{T}.Id" />
/// <summary>
/// 唯一编码
/// </summary>
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
[CsvIgnore]
[Snowflake]
@ -16,13 +18,17 @@ public abstract record LiteVersionEntity : LiteVersionEntity<long>
public abstract record LiteVersionEntity<T> : LiteMutableEntity<T>, IFieldVersion
where T : IEquatable<T>
{
/// <inheritdoc cref="EntityBase{T}.Id" />
/// <summary>
/// 唯一编码
/// </summary>
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
[CsvIgnore]
[Snowflake]
public override T Id { get; init; }
/// <inheritdoc cref="IFieldVersion.Version" />
/// <summary>
/// 数据版本
/// </summary>
[Column(IsVersion = true, Position = -1)]
[CsvIgnore]
[JsonIgnore]

View File

@ -3,7 +3,9 @@ namespace NetAdmin.Domain.DbMaps.Dependency;
/// <inheritdoc />
public abstract record MutableEntity : MutableEntity<long>
{
/// <inheritdoc cref="EntityBase{T}.Id" />
/// <summary>
/// 唯一编码
/// </summary>
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
[CsvIgnore]
[Snowflake]
@ -13,21 +15,43 @@ public abstract record MutableEntity : MutableEntity<long>
/// <summary>
/// 可变实体
/// </summary>
public abstract record MutableEntity<T> : LiteMutableEntity<T>, IFieldModifiedUser
public abstract record MutableEntity<T> : LiteMutableEntity<T>, IFieldCreatedUser, IFieldModifiedUser
where T : IEquatable<T>
{
/// <inheritdoc cref="EntityBase{T}.Id" />
/// <summary>
/// 创建者编号
/// </summary>
[Column(CanUpdate = false, Position = -1)]
[CsvIgnore]
[JsonIgnore]
public virtual long? CreatedUserId { get; init; }
/// <summary>
/// 创建者用户名
/// </summary>
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31, CanUpdate = false, Position = -1)]
[CsvIgnore]
[JsonIgnore]
public virtual string CreatedUserName { get; init; }
/// <summary>
/// 唯一编码
/// </summary>
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
[CsvIgnore]
public override T Id { get; init; }
/// <inheritdoc cref="IFieldModifiedUser.ModifiedUserId" />
/// <summary>
/// 修改者编号
/// </summary>
[Column(CanInsert = false, Position = -1)]
[CsvIgnore]
[JsonIgnore]
public long? ModifiedUserId { get; init; }
/// <inheritdoc cref="IFieldModifiedUser.ModifiedUserName" />
/// <summary>
/// 修改者用户名
/// </summary>
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31, CanInsert = false, Position = -1)]
[CsvIgnore]
[JsonIgnore]

View File

@ -3,7 +3,9 @@ namespace NetAdmin.Domain.DbMaps.Dependency;
/// <inheritdoc />
public abstract record SimpleEntity : SimpleEntity<long>
{
/// <inheritdoc cref="EntityBase{T}.Id" />
/// <summary>
/// 唯一编码
/// </summary>
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
[CsvIgnore]
[Snowflake]

View File

@ -3,7 +3,9 @@ namespace NetAdmin.Domain.DbMaps.Dependency;
/// <inheritdoc />
public abstract record VersionEntity : VersionEntity<long>
{
/// <inheritdoc cref="EntityBase{T}.Id" />
/// <summary>
/// 唯一编码
/// </summary>
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
[CsvIgnore]
[Snowflake]
@ -16,30 +18,40 @@ public abstract record VersionEntity : VersionEntity<long>
public abstract record VersionEntity<T> : LiteVersionEntity<T>, IFieldModifiedUser, IFieldCreatedUser
where T : IEquatable<T>
{
/// <inheritdoc />
/// <summary>
/// 创建者编号
/// </summary>
[Column(CanUpdate = false, Position = -1)]
[CsvIgnore]
[JsonIgnore]
public virtual long? CreatedUserId { get; init; }
/// <inheritdoc />
/// <summary>
/// 创建者用户名
/// </summary>
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31, CanUpdate = false, Position = -1)]
[CsvIgnore]
[JsonIgnore]
public virtual string CreatedUserName { get; init; }
/// <inheritdoc cref="EntityBase{T}.Id" />
/// <summary>
/// 唯一编码
/// </summary>
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
[CsvIgnore]
public override T Id { get; init; }
/// <inheritdoc cref="IFieldModifiedUser.ModifiedUserId" />
/// <summary>
/// 修改者编号
/// </summary>
[Column(CanInsert = false, Position = -1)]
[CsvIgnore]
[JsonIgnore]
public virtual long? ModifiedUserId { get; init; }
/// <inheritdoc cref="IFieldModifiedUser.ModifiedUserName" />
/// <summary>
/// 修改者用户名
/// </summary>
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31, CanInsert = false, Position = -1)]
[CsvIgnore]
[JsonIgnore]

View File

@ -1,83 +0,0 @@
using NetAdmin.Domain.Enums;
namespace NetAdmin.Domain.Dto.Dependency;
/// <summary>
/// 动态过滤条件
/// </summary>
public sealed record DynamicFilterInfo : DataAbstraction
{
/// <summary>
/// 字段名
/// </summary>
public string Field { get; init; }
/// <summary>
/// 子过滤条件
/// </summary>
public List<DynamicFilterInfo> Filters { get; init; }
/// <summary>
/// 子过滤条件逻辑关系
/// </summary>
public DynamicFilterLogics Logic { get; init; }
/// <summary>
/// 操作符
/// </summary>
public DynamicFilterOperators Operator { get; init; }
/// <summary>
/// 值
/// </summary>
public object Value { get; init; }
/// <summary>
/// 隐式转换为 FreeSql 的 DynamicFilterInfo 对象
/// </summary>
public static implicit operator FreeSql.Internal.Model.DynamicFilterInfo(DynamicFilterInfo d)
{
var ret = d.Adapt<FreeSql.Internal.Model.DynamicFilterInfo>();
ProcessDynamicFilter(ret);
return ret;
}
private static void ProcessDynamicFilter(FreeSql.Internal.Model.DynamicFilterInfo d)
{
if (d?.Filters != null) {
foreach (var filterInfo in d.Filters) {
ProcessDynamicFilter(filterInfo);
}
}
if (new[] { nameof(IFieldCreatedClientIp.CreatedClientIp), nameof(IFieldModifiedClientIp.ModifiedClientIp) }
.Contains(d?.Field, StringComparer.OrdinalIgnoreCase)) {
var val = d!.Value?.ToString();
if (val?.IsIpV4() == true) {
d.Value = val.IpV4ToInt32();
}
}
else if (d?.Operator == DynamicFilterOperator.DateRange) {
var values = ((JsonElement)d.Value).Deserialize<string[]>();
if (!DateTime.TryParse(values[0], CultureInfo.InvariantCulture, out _)) {
var result = values[0]
.ExecuteCSharpCodeAsync<DateTime>([typeof(DateTime).Assembly], nameof(System))
.ConfigureAwait(false)
.GetAwaiter()
.GetResult();
values[0] = $"{result:yyyy-MM-dd HH:mm:ss}";
}
if (!DateTime.TryParse(values[1], CultureInfo.InvariantCulture, out _)) {
var result = values[1]
.ExecuteCSharpCodeAsync<DateTime>([typeof(DateTime).Assembly], nameof(System))
.ConfigureAwait(false)
.GetAwaiter()
.GetResult();
values[1] = $"{result:yyyy-MM-dd HH:mm:ss}";
}
d.Value = values;
}
}
}

View File

@ -36,4 +36,37 @@ public record QueryReq<T> : DataAbstraction
/// 排序字段
/// </summary>
public string Prop { get; init; }
/// <summary>
/// 所需字段
/// </summary>
public string[] RequiredFields { get; set; }
/// <summary>
/// 列表表达式
/// </summary>
public Expression<Func<TEntity, TEntity>> GetToListExp<TEntity>()
{
if (RequiredFields.NullOrEmpty()) {
return null;
}
var expParameter = Expression.Parameter(typeof(TEntity), "a");
var bindings = new List<MemberBinding>();
// ReSharper disable once LoopCanBeConvertedToQuery
foreach (var field in RequiredFields) {
var prop = typeof(TEntity).GetProperty(field);
if (prop == null || prop.GetCustomAttribute<DangerFieldAttribute>() != null) {
continue;
}
var propExp = Expression.Property(expParameter, prop);
var binding = Expression.Bind(prop, propExp);
bindings.Add(binding);
}
var expBody = Expression.MemberInit(Expression.New(typeof(TEntity)), bindings);
return Expression.Lambda<Func<TEntity, TEntity>>(expBody, expParameter);
}
}

View File

@ -0,0 +1,17 @@
using NetAdmin.Domain.Enums;
namespace NetAdmin.Domain.Dto;
/// <summary>
/// 动态过滤条件生成器
/// </summary>
public sealed record DfBuilder
{
/// <summary>
/// 构建生成器
/// </summary>
public static DynamicFilterInfo New(DynamicFilterLogics logic)
{
return new DynamicFilterInfo { Logic = logic, Filters = [] };
}
}

View File

@ -0,0 +1,125 @@
using NetAdmin.Domain.Enums;
namespace NetAdmin.Domain.Dto;
/// <summary>
/// 动态过滤条件
/// </summary>
public sealed record DynamicFilterInfo : DataAbstraction
{
/// <summary>
/// 字段名
/// </summary>
public string Field { get; init; }
/// <summary>
/// 子过滤条件
/// </summary>
public List<DynamicFilterInfo> Filters { get; init; }
/// <summary>
/// 子过滤条件逻辑关系
/// </summary>
public DynamicFilterLogics Logic { get; init; }
/// <summary>
/// 操作符
/// </summary>
public DynamicFilterOperators Operator { get; init; }
/// <summary>
/// 值
/// </summary>
public object Value { get; init; }
/// <summary>
/// 隐式转换为 FreeSql 的 DynamicFilterInfo 对象
/// </summary>
public static implicit operator FreeSql.Internal.Model.DynamicFilterInfo(DynamicFilterInfo d)
{
var ret = d.Adapt<FreeSql.Internal.Model.DynamicFilterInfo>();
ProcessDynamicFilter(ret);
return ret;
}
/// <summary>
/// 添加子过滤条件
/// </summary>
public DynamicFilterInfo Add(DynamicFilterInfo df)
{
if (Filters == null) {
return this with { Filters = [df] };
}
Filters.Add(df);
return this;
}
/// <summary>
/// 添加过滤条件
/// </summary>
public DynamicFilterInfo Add(string field, DynamicFilterOperators opt, object val)
{
return Add(new DynamicFilterInfo { Field = field, Operator = opt, Value = val });
}
/// <summary>
/// 添加过滤条件
/// </summary>
public DynamicFilterInfo AddIf(bool condition, string field, DynamicFilterOperators opt, object val)
{
return !condition ? this : Add(field, opt, val);
}
/// <summary>
/// 添加过滤条件
/// </summary>
public DynamicFilterInfo AddIf(bool condition, DynamicFilterInfo df)
{
return !condition ? this : Add(df);
}
private static void ParseDateExp(FreeSql.Internal.Model.DynamicFilterInfo d)
{
var values = ((JsonElement)d.Value).Deserialize<string[]>();
if (!DateTime.TryParse(values[0], CultureInfo.InvariantCulture, out _)) {
var result = values[0]
.ExecuteCSharpCodeAsync<DateTime>([typeof(DateTime).Assembly], nameof(System))
.ConfigureAwait(false)
.GetAwaiter()
.GetResult();
values[0] = $"{result:yyyy-MM-dd HH:mm:ss}";
}
if (!DateTime.TryParse(values[1], CultureInfo.InvariantCulture, out _)) {
var result = values[1]
.ExecuteCSharpCodeAsync<DateTime>([typeof(DateTime).Assembly], nameof(System))
.ConfigureAwait(false)
.GetAwaiter()
.GetResult();
values[1] = $"{result:yyyy-MM-dd HH:mm:ss}";
}
d.Value = values;
}
private static void ProcessDynamicFilter(FreeSql.Internal.Model.DynamicFilterInfo d)
{
if (d?.Filters != null) {
foreach (var filterInfo in d.Filters) {
ProcessDynamicFilter(filterInfo);
}
}
if (new[] { nameof(IFieldCreatedClientIp.CreatedClientIp), nameof(IFieldModifiedClientIp.ModifiedClientIp) }.Contains(
d?.Field, StringComparer.OrdinalIgnoreCase)) {
var val = d!.Value?.ToString();
if (val?.IsIpV4() == true) {
d.Value = val.IpV4ToInt32();
}
}
else if (d?.Operator == DynamicFilterOperator.DateRange) {
ParseDateExp(d);
}
}
}

View File

@ -8,6 +8,7 @@ public record RestfulInfo<T> : DataAbstraction
/// <summary>
/// 代码
/// </summary>
/// <example>succeed</example>
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
public ErrorCodes Code { get; init; }
@ -17,7 +18,8 @@ public record RestfulInfo<T> : DataAbstraction
public T Data { get; init; }
/// <summary>
/// 消息
/// 字符串:"消息内容",或数组:[{"参数名1":"消息内容1"},{"参数名2":"消息内容2"}]
/// </summary>
/// <example>请求成功</example>
public object Msg { get; init; }
}

View File

@ -1,6 +0,0 @@
namespace NetAdmin.Domain.Dto.Sys.JobRecord;
/// <summary>
/// 请求:创建计划作业执行记录
/// </summary>
public record CreateJobRecordReq : Sys_JobRecord;

View File

@ -1,6 +0,0 @@
namespace NetAdmin.Domain.Dto.Sys.RequestLogDetail;
/// <summary>
/// 请求:创建请求日志明细
/// </summary>
public record CreateRequestLogDetailReq : Sys_RequestLogDetail;

View File

@ -1,6 +0,0 @@
namespace NetAdmin.Domain.Dto.Sys.SiteMsgDept;
/// <summary>
/// 请求:创建站内信-部门映射
/// </summary>
public record CreateSiteMsgDeptReq : Sys_SiteMsgDept;

View File

@ -1,6 +0,0 @@
namespace NetAdmin.Domain.Dto.Sys.SiteMsgRole;
/// <summary>
/// 请求:创建站内信-角色映射
/// </summary>
public record CreateSiteMsgRoleReq : Sys_SiteMsgRole;

View File

@ -1,6 +0,0 @@
namespace NetAdmin.Domain.Dto.Sys.SiteMsgUser;
/// <summary>
/// 请求:创建站内信-用户映射
/// </summary>
public record CreateSiteMsgUserReq : Sys_SiteMsgUser;

View File

@ -17,7 +17,6 @@ public sealed record SyncStructureAfterEvent : SyncStructureBeforeEvent
/// <inheritdoc />
public override string ToString()
{
return string.Format(CultureInfo.InvariantCulture, "{0}: {1}: {2}", Id, Ln.
, string.Join(',', EntityTypes.Select(x => x.Name)));
return string.Format(CultureInfo.InvariantCulture, "{0}: {1}: {2}", Id, Ln., string.Join(',', EntityTypes.Select(x => x.Name)));
}
}

View File

@ -1,11 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<DefineConstants>DBTYPE_SQLITE</DefineConstants>
</PropertyGroup>
<Import Project="$(SolutionDir)/build/code.quality.props"/>
<ItemGroup>
<Content Include="$(SolutionDir)/assets/seed-data/**" LinkBase="SeedData" CopyToOutputDirectory="PreserveNewest"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../NetAdmin.Infrastructure/NetAdmin.Infrastructure.csproj"/>
</ItemGroup>
@ -13,7 +7,6 @@
<PackageReference Include="CronExpressionDescriptor" Version="2.36.0"/>
<PackageReference Include="Cronos" Version="0.8.4"/>
<PackageReference Include="CsvHelper.NS" Version="33.0.2-ns2"/>
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="9.0.0-preview.6.24328.4"/>
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14"/>
</ItemGroup>
</Project>

View File

@ -0,0 +1,5 @@
global using NetAdmin.Domain.Attributes;
global using NetAdmin.Domain.DbMaps.Dependency;
global using NetAdmin.Domain.DbMaps.Dependency.Fields;
global using CsvIgnore = CsvHelper.Configuration.Attributes.IgnoreAttribute;
global using DynamicFilterOperators = NetAdmin.Domain.Enums.DynamicFilterOperators;

View File

@ -1,4 +1,4 @@
using RedLockNet;
using StackExchange.Redis;
namespace NetAdmin.Host.BackgroundRunning;
@ -7,8 +7,6 @@ namespace NetAdmin.Host.BackgroundRunning;
/// </summary>
public abstract class WorkBase<TLogger>
{
private readonly RedLocker _redLocker;
/// <summary>
/// Initializes a new instance of the <see cref="WorkBase{TLogger}" /> class.
/// </summary>
@ -17,7 +15,6 @@ public abstract class WorkBase<TLogger>
ServiceProvider = App.GetService<IServiceScopeFactory>().CreateScope().ServiceProvider;
UowManager = ServiceProvider.GetService<UnitOfWorkManager>();
Logger = ServiceProvider.GetService<ILogger<TLogger>>();
_redLocker = ServiceProvider.GetService<RedLocker>();
}
/// <summary>
@ -53,10 +50,8 @@ public abstract class WorkBase<TLogger>
{
if (singleInstance) {
// 加锁
await using var redLock = await GetLockerAsync(GetType().FullName).ConfigureAwait(false);
if (!redLock.IsAcquired) {
throw new NetAdminGetLockerException();
}
var lockName = GetType().FullName;
await using var redisLocker = await GetLockerAsync(lockName).ConfigureAwait(false);
await WorkflowAsync(cancelToken).ConfigureAwait(false);
return;
@ -68,10 +63,13 @@ public abstract class WorkBase<TLogger>
/// <summary>
/// 获取锁
/// </summary>
private Task<IRedLock> GetLockerAsync(string lockId)
private Task<RedisLocker> GetLockerAsync(string lockId)
{
return _redLocker.RedLockFactory.CreateLockAsync(lockId, TimeSpan.FromSeconds(Numbers.SECS_RED_LOCK_EXPIRY)
, TimeSpan.FromSeconds(Numbers.SECS_RED_LOCK_WAIT)
, TimeSpan.FromSeconds(Numbers.SECS_RED_LOCK_RETRY_INTERVAL));
var db = ServiceProvider.GetService<IConnectionMultiplexer>()
.GetDatabase(ServiceProvider.GetService<IOptions<RedisOptions>>()
.Value.Instances.First(x => x.Name == Chars.FLG_REDIS_INSTANCE_DATA_CACHE)
.Database);
return RedisLocker.GetLockerAsync(db, lockId, TimeSpan.FromSeconds(Numbers.SECS_REDIS_LOCK_EXPIRY), Numbers.MAX_LIMIT_RETRY_CNT_REDIS_LOCK
, TimeSpan.FromSeconds(Numbers.SECS_REDIS_LOCK_RETRY_DELAY));
}
}

View File

@ -8,8 +8,26 @@ namespace NetAdmin.Host.Controllers;
/// 探针组件
/// </summary>
[ApiDescriptionSettings("Probe")]
[Produces(Chars.FLG_HTTP_HEADER_VALUE_APPLICATION_JSON)]
public sealed class ProbeController : ControllerBase<ICache<IDistributedCache, IService>, IService>
{
/// <summary>
/// 退出程序
/// </summary>
[AllowAnonymous]
[HttpGet]
#pragma warning disable CA1822
public ActionResult Exit(string token)
#pragma warning restore CA1822
{
if (token != GlobalStatic.SecretKey) {
return new UnauthorizedResult();
}
Environment.Exit(0);
return new OkResult();
}
/// <summary>
/// 健康检查
/// </summary>
@ -23,6 +41,58 @@ public sealed class ProbeController : ControllerBase<ICache<IDistributedCache, I
HostName = Environment.MachineName
, CurrentConnections = SafetyShopHostMiddleware.Connections
, GlobalStatic.ProductVersion
, ThreadCounts = GlobalStatic.CurrentProcess.Threads.Count
, GlobalStatic.LatestLogTime
};
}
/// <summary>
/// 系统是否已经安全停止
/// </summary>
[AllowAnonymous]
[HttpGet]
[NonUnify]
#pragma warning disable CA1822, S3400
public IActionResult IsSystemSafetyStopped(int logTimeoutSeconds = 15)
#pragma warning restore S3400, CA1822
{
return new ContentResult { Content = (DateTime.Now - GlobalStatic.LatestLogTime).TotalSeconds > logTimeoutSeconds ? "1" : "0" };
}
/// <summary>
/// 实例下线
/// </summary>
/// <remarks>
/// 流量只出不进
/// </remarks>
[AllowAnonymous]
[HttpGet]
#pragma warning disable CA1822
public ActionResult Offline(string token)
#pragma warning restore CA1822
{
if (token != GlobalStatic.SecretKey) {
return new UnauthorizedResult();
}
SafetyShopHostMiddleware.Stop();
return new OkResult();
}
/// <summary>
/// 停止日志计数器
/// </summary>
[AllowAnonymous]
[HttpGet]
#pragma warning disable CA1822
public ActionResult StopLogCounter(string token)
#pragma warning restore CA1822
{
if (token != GlobalStatic.SecretKey) {
return new UnauthorizedResult();
}
GlobalStatic.LogCounterOff = true;
return new OkResult();
}
}

View File

@ -1,19 +1,18 @@
using NetAdmin.Application.Modules.Tpl;
using NetAdmin.Application.Services.Tpl.Dependency;
using NetAdmin.Cache.Tpl.Dependency;
using NetAdmin.Domain.Dto.Dependency;
using NetAdmin.Domain.Dto.Tpl.Example;
using NetAdmin.Host.Attributes;
using NetAdmin.Host.Controllers;
using NetAdmin.SysComponent.Application.Modules.Tpl;
using NetAdmin.SysComponent.Application.Services.Tpl.Dependency;
using NetAdmin.SysComponent.Cache.Tpl.Dependency;
namespace NetAdmin.SysComponent.Host.Controllers.Tpl;
namespace NetAdmin.Host.Controllers.Tpl;
/// <summary>
/// 示例服务
/// </summary>
[ApiDescriptionSettings(nameof(Tpl), Module = nameof(Tpl))]
public sealed class ExampleController(IExampleCache cache) : ControllerBase<IExampleCache, IExampleService>(cache)
, IExampleModule
[Produces(Chars.FLG_HTTP_HEADER_VALUE_APPLICATION_JSON)]
public sealed class ExampleController(IExampleCache cache) : ControllerBase<IExampleCache, IExampleService>(cache), IExampleModule
{
/// <summary>
/// 批量删除示例

View File

@ -3,6 +3,7 @@ using IGeekFan.AspNetCore.Knife4jUI;
#else
using Prometheus;
using Prometheus.HttpMetrics;
#endif
namespace NetAdmin.Host.Extensions;
@ -40,5 +41,22 @@ public static class IApplicationBuilderExtensions
}
});
}
#else
/// <summary>
/// 使用 Prometheus
/// </summary>
public static IApplicationBuilder UsePrometheus(this IApplicationBuilder me)
{
return me.UseHttpMetrics(opt => {
opt.RequestDuration.Histogram = Metrics.CreateHistogram( //
"http_request_duration_seconds"
, "The duration of HTTP requests processed by an ASP.NET Core application."
, HttpRequestLabelNames.All
, new HistogramConfiguration {
Buckets = Histogram.PowersOfTenDividedBuckets(
-2, 2, 4)
});
});
}
#endif
}

View File

@ -17,26 +17,20 @@ public static class IMvcBuilderExtensions
public static IMvcBuilder AddDefaultApiResultHandler(this IMvcBuilder me)
{
return me.AddInjectWithUnifyResult<DefaultApiResultHandler>(injectOptions => {
injectOptions.ConfigureSwaggerGen(
genOptions => {
// 替换自定义的EnumSchemaFilter支持多语言Resx资源 需将SpecificationDocumentSettings.EnableEnumSchemaFilter配置为false)
genOptions
.SchemaFilter<
SwaggerEnumSchemaFixer>();
injectOptions.ConfigureSwaggerGen(genOptions => {
// 替换自定义的EnumSchemaFilter支持多语言Resx资源 需将SpecificationDocumentSettings.EnableEnumSchemaFilter配置为false)
genOptions.SchemaFilter<SwaggerEnumSchemaFixer>();
// 将程序集版本号与OpenApi版本号同步
foreach (var doc in genOptions
.SwaggerGeneratorOptions
.SwaggerDocs) {
doc.Value.Version
= FileVersionInfo
.GetVersionInfo(
Assembly
.GetEntryAssembly()!
.Location)
.ProductVersion;
}
});
// 枚举显示自身xml comment 而不是$ref原型引用
genOptions.UseInlineDefinitionsForEnums();
// 将程序集版本号与OpenApi版本号同步
foreach (var doc in genOptions.SwaggerGeneratorOptions.SwaggerDocs) {
doc.Value.Version = FileVersionInfo
.GetVersionInfo(Assembly.GetEntryAssembly()!.Location)
.ProductVersion;
}
});
});
}

View File

@ -0,0 +1,18 @@
namespace NetAdmin.Host.Extensions;
/// <summary>
/// Type 扩展方法
/// </summary>
public static class MethodInfoExtensions
{
/// <summary>
/// 获取路由路径
/// </summary>
public static string GetRoutePath(this MethodInfo me, IServiceProvider serviceProvider)
{
return serviceProvider.GetService<IActionDescriptorCollectionProvider>()
.ActionDescriptors.Items.FirstOrDefault(x => x.DisplayName!.StartsWith( //
$"{me.DeclaringType}.{me.Name}", StringComparison.Ordinal))
?.AttributeRouteInfo?.Template;
}
}

View File

@ -1,12 +1,7 @@
using Furion.Logging;
using Gurion.Logging;
using NetAdmin.Domain.Contexts;
using NetAdmin.Domain.Events;
using NetAdmin.Host.Filters;
using NetAdmin.Host.Utils;
using StackExchange.Redis;
using Yitter.IdGenerator;
using FreeSqlBuilder = NetAdmin.Infrastructure.Utils.FreeSqlBuilder;
#if DEBUG
using Spectre.Console;
#endif
@ -83,15 +78,15 @@ public static class ServiceCollectionExtensions
this IServiceCollection me)
{
var optionsTypes
= from type in App.EffectiveTypes.Where(x => !x.IsAbstract && !x.FullName!.Contains(nameof(Furion)) &&
= from type in App.EffectiveTypes.Where(x => !x.IsAbstract && !x.FullName!.Contains(nameof(Gurion)) &&
x.GetInterfaces().Contains(typeof(IConfigurableOptions)))
select type;
var sbLog = new StringBuilder();
foreach (var type in optionsTypes) {
var configureMethod = typeof(ConfigurableOptionsServiceCollectionExtensions).GetMethod(
nameof(ConfigurableOptionsServiceCollectionExtensions.AddConfigurableOptions)
, BindingFlags.Public | BindingFlags.Static, [typeof(IServiceCollection)]);
nameof(ConfigurableOptionsServiceCollectionExtensions.AddConfigurableOptions), BindingFlags.Public | BindingFlags.Static
, [typeof(IServiceCollection)]);
_ = configureMethod!.MakeGenericMethod(type).Invoke(me, [me]);
_ = sbLog.Append(CultureInfo.InvariantCulture, $" {type.Name}");
}
@ -108,32 +103,29 @@ public static class ServiceCollectionExtensions
return me.AddConsoleFormatter(options => {
var logLevels = Enum.GetValues<LogLevels>().ToDictionary(x => x, x => x.GetDisplay());
#if DEBUG
options.WriteHandler = (message, _, _, _, _) => {
#if DEBUG
MarkupLine(message.Message.EscapeMarkup(), message, logLevels);
if (message.Exception != null) {
MarkupLine(message.Exception.ToString().EscapeMarkup(), message, logLevels);
}
};
#else
options.WriteHandler = (message, _, _, _, _) => {
#else
var msg = message.Message.ReplaceLineEndings(string.Empty);
var (date, logName, logFormat) = ParseMessage(message, false);
Console.WriteLine( //
logFormat, date, logLevels[(LogLevels)message.LogLevel].ShortName, logName, message.ThreadId, msg);
#endif
GlobalStatic.IncrementLogCounter();
};
#endif
});
}
/// <summary>
/// 添加上下文用户
/// 添加上下文用户令牌
/// </summary>
public static IServiceCollection AddContextUser(this IServiceCollection me)
public static IServiceCollection AddContextUserToken(this IServiceCollection me)
{
return me.AddScoped(typeof(ContextUserToken), _ => ContextUserToken.Create())
.AddScoped(typeof(ContextUserInfo), _ => ContextUserInfo.Create());
return me.AddScoped(typeof(ContextUserToken), _ => ContextUserToken.Create());
}
/// <summary>
@ -144,46 +136,6 @@ public static class ServiceCollectionExtensions
return me.AddEventBus(builder => builder.AddSubscribers(App.Assemblies.ToArray()));
}
/// <summary>
/// 添加 freeSql orm工具
/// </summary>
public static IServiceCollection AddFreeSql( //
this IServiceCollection me, FreeSqlInitMethods initMethods = FreeSqlInitMethods.None
, Action<IFreeSql> freeSqlConfig = null)
{
// // 非调试模式下禁止同步数据库
// #if !DEBUG
// initOptions = FreeSqlInitOptions.None;
// #endif
var freeSql = new FreeSqlBuilder(App.GetOptions<DatabaseOptions>()).Build(initMethods);
_ = me.AddSingleton(freeSql);
freeSql.Aop.AuditValue += SqlAuditor.DataAuditHandler; // Insert/Update自动值处理
var eventPublisher = App.GetService<IEventPublisher>();
#pragma warning disable VSTHRD110
// AOP事件发布异步
freeSql.Aop.CommandBefore
+= (_, e) => eventPublisher.PublishAsync(new SqlCommandBeforeEvent(e)); // 增删查改,执行命令之前触发
freeSql.Aop.CommandAfter
+= (_, e) => eventPublisher.PublishAsync(new SqlCommandAfterEvent(e)); // 增删查改,执行命令完成后触发
freeSql.Aop.SyncStructureBefore += (_, e) =>
eventPublisher.PublishAsync(new SyncStructureBeforeEvent(e)); // CodeFirst迁移执行之前触发
freeSql.Aop.SyncStructureAfter += (_, e) =>
eventPublisher.PublishAsync(new SyncStructureAfterEvent(e)); // CodeFirst迁移执行完成触发
#pragma warning restore VSTHRD110
// 全局过滤器设置
freeSqlConfig?.Invoke(freeSql);
return me.AddScoped<UnitOfWorkManager>() // 注入工作单元管理器
.AddFreeRepository(null, App.Assemblies.ToArray()) // 批量注入 Repository
.AddMvcFilter<TransactionInterceptor>(); // 注入事务拦截器
}
/// <summary>
/// 添加内存缓存
/// </summary>
@ -211,8 +163,7 @@ public static class ServiceCollectionExtensions
/// </summary>
public static IServiceCollection AddRedisCache(this IServiceCollection me)
{
var redisOptions = App.GetOptions<RedisOptions>()
.Instances.First(x => x.Name == Chars.FLG_REDIS_INSTANCE_DATA_CACHE);
var redisOptions = App.GetOptions<RedisOptions>().Instances.First(x => x.Name == Chars.FLG_REDIS_INSTANCE_DATA_CACHE);
// IDistributedCache 分布式缓存通用接口
_ = me.AddStackExchangeRedisCache(options => {

View File

@ -1,4 +1,4 @@
using Furion.FriendlyException;
using Gurion.FriendlyException;
using NetAdmin.Domain.Dto;
namespace NetAdmin.Host.Filters;
@ -64,8 +64,7 @@ public abstract class ApiResultHandler<T>
{
SetErrorCodeToHeader(context.HttpContext, ErrorCodes.InvalidInput);
return new JsonResult(RestfulResult(ErrorCodes.InvalidInput, metadata.Data
, GetValidationResult(metadata.ValidationResult))) {
return new JsonResult(RestfulResult(ErrorCodes.InvalidInput, metadata.Data, GetValidationResult(metadata.ValidationResult))) {
StatusCode = Numbers.HTTP_STATUS_BIZ_FAIL
};
}

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