Browse Source

创建项目

master
郑勃旭 2 years ago
parent
commit
7aac685ffe
  1. 1
      Code/Be/Faster.Zheng.Winin/.gitattributes
  2. 265
      Code/Be/Faster.Zheng.Winin/.gitignore
  3. 5
      Code/Be/Faster.Zheng.Winin/.prettierrc
  4. 130
      Code/Be/Faster.Zheng.Winin/Faster.Zheng.Winin.sln
  5. 23
      Code/Be/Faster.Zheng.Winin/Faster.Zheng.Winin.sln.DotSettings
  6. 5
      Code/Be/Faster.Zheng.Winin/NuGet.Config
  7. 19
      Code/Be/Faster.Zheng.Winin/common.props
  8. 25
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/Faster.Zheng.Winin.Application.Contracts.csproj
  9. 20
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/Permissions/WininPermissionDefinitionProvider.cs
  10. 9
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/Permissions/WininPermissions.cs
  11. 28
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/WininApplicationContractsModule.cs
  12. 28
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/WininDtoExtensions.cs
  13. 25
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/Faster.Zheng.Winin.Application.csproj
  14. 2
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/Properties/AssemblyInfo.cs
  15. 17
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/WininAppService.cs
  16. 13
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/WininApplicationAutoMapperProfile.cs
  17. 31
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/WininApplicationModule.cs
  18. 51
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.DbMigrator/DbMigratorHostedService.cs
  19. 45
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.DbMigrator/Faster.Zheng.Winin.DbMigrator.csproj
  20. 41
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.DbMigrator/Program.cs
  21. 15
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.DbMigrator/WininDbMigratorModule.cs
  22. 27
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.DbMigrator/appsettings.json
  23. 2
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.DbMigrator/appsettings.secrets.json
  24. 32
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Faster.Zheng.Winin.Domain.Shared.csproj
  25. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/ar.json
  26. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/cs.json
  27. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/de.json
  28. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/en-GB.json
  29. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/en.json
  30. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/es.json
  31. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/fi.json
  32. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/fr.json
  33. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/hi.json
  34. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/hr.json
  35. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/hu.json
  36. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/is.json
  37. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/it.json
  38. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/nl.json
  39. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/pl-PL.json
  40. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/pt-BR.json
  41. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/ro-RO.json
  42. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/ru.json
  43. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/sk.json
  44. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/sl.json
  45. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/tr.json
  46. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/vi.json
  47. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/zh-Hans.json
  48. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/zh-Hant.json
  49. 9
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/WininResource.cs
  50. 10
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs
  51. 6
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/WininDomainErrorCodes.cs
  52. 58
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/WininDomainSharedModule.cs
  53. 22
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/WininGlobalFeatureConfigurator.cs
  54. 73
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/WininModuleExtensionConfigurator.cs
  55. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain/Data/IWininDbSchemaMigrator.cs
  56. 15
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain/Data/NullWininDbSchemaMigrator.cs
  57. 218
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain/Data/WininDbMigrationService.cs
  58. 28
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain/Faster.Zheng.Winin.Domain.csproj
  59. 405
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain/OpenIddict/OpenIddictDataSeedContributor.cs
  60. 3
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain/Properties/AssemblyInfo.cs
  61. 12
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain/Settings/WininSettingDefinitionProvider.cs
  62. 9
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain/Settings/WininSettings.cs
  63. 8
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain/WininConsts.cs
  64. 68
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain/WininDomainModule.cs
  65. 34
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreWininDbSchemaMigrator.cs
  66. 86
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/EntityFrameworkCore/WininDbContext.cs
  67. 33
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/EntityFrameworkCore/WininDbContextFactory.cs
  68. 44
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/EntityFrameworkCore/WininEfCoreEntityExtensionMappings.cs
  69. 54
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/EntityFrameworkCore/WininEntityFrameworkCoreModule.cs
  70. 31
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/Faster.Zheng.Winin.EntityFrameworkCore.csproj
  71. 1870
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/Migrations/20230614050503_Initial.Designer.cs
  72. 1084
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/Migrations/20230614050503_Initial.cs
  73. 1867
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/Migrations/WininDbContextModelSnapshot.cs
  74. 2
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/Properties/AssemblyInfo.cs
  75. 29
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.HttpApi.Client/Faster.Zheng.Winin.HttpApi.Client.csproj
  76. 38
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.HttpApi.Client/WininHttpApiClientModule.cs
  77. 14
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.HttpApi/Controllers/WininController.cs
  78. 24
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.HttpApi/Faster.Zheng.Winin.HttpApi.csproj
  79. 10
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.HttpApi/Models/Test/TestModel.cs
  80. 41
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.HttpApi/WininHttpApiModule.cs
  81. 4
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Components/_ViewImports.cshtml
  82. 56
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Faster.Zheng.Winin.Web.csproj
  83. 51
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Menus/WininMenuContributor.cs
  84. 10
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Menus/WininMenus.cs
  85. 187
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/Index.cshtml
  86. 9
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/Index.cshtml.cs
  87. 3
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/Index.css
  88. 3
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/Index.js
  89. 14
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/WininPageModel.cs
  90. 4
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/_ViewImports.cshtml
  91. 56
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Program.cs
  92. 2
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Properties/AssemblyInfo.cs
  93. 27
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Properties/launchSettings.json
  94. 4
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Views/_ViewImports.cshtml
  95. 10
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/WininBrandingProvider.cs
  96. 11
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/WininWebAutoMapperProfile.cs
  97. 215
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/WininWebModule.cs
  98. 11
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/abp.resourcemapping.js
  99. 2
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/appsettings.Development.json
  100. 11
      Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/appsettings.json

1
Code/Be/Faster.Zheng.Winin/.gitattributes

@ -0,0 +1 @@
**/wwwroot/libs/** linguist-vendored

265
Code/Be/Faster.Zheng.Winin/.gitignore

@ -0,0 +1,265 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# DNX
project.lock.json
artifacts/
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# Winin
src/Faster.Zheng.Winin.Web/Logs/*
src/Faster.Zheng.Winin.Web.Host/Logs/*
src/Faster.Zheng.Winin.AuthServer/Logs/*
src/Faster.Zheng.Winin.HttpApi.Host/Logs/*
src/Faster.Zheng.Winin.HttpApi.HostWithIds/Logs/*
src/Faster.Zheng.Winin.DbMigrator/Logs/*
src/Faster.Zheng.Winin.Blazor.Server/Logs/*
src/Faster.Zheng.Winin.Blazor.Server.Tiered/Logs/*
# Use abp install-libs to restore.
**/wwwroot/libs/*

5
Code/Be/Faster.Zheng.Winin/.prettierrc

@ -0,0 +1,5 @@
{
"singleQuote": true,
"useTabs": false,
"tabWidth": 4
}

130
Code/Be/Faster.Zheng.Winin/Faster.Zheng.Winin.sln

@ -0,0 +1,130 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29020.237
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Faster.Zheng.Winin.Domain", "src\Faster.Zheng.Winin.Domain\Faster.Zheng.Winin.Domain.csproj", "{554AD327-6DBA-4F8F-96F8-81CE7A0C863F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Faster.Zheng.Winin.Application", "src\Faster.Zheng.Winin.Application\Faster.Zheng.Winin.Application.csproj", "{1A94A50E-06DC-43C1-80B5-B662820EC3EB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Faster.Zheng.Winin.EntityFrameworkCore", "src\Faster.Zheng.Winin.EntityFrameworkCore\Faster.Zheng.Winin.EntityFrameworkCore.csproj", "{C956DD76-69C8-4A9C-83EA-D17DF83340FD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Faster.Zheng.Winin.Web", "src\Faster.Zheng.Winin.Web\Faster.Zheng.Winin.Web.csproj", "{068855E8-9240-4F1A-910B-CF825794513B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{CA9AC87F-097E-4F15-8393-4BC07735A5B0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{04DBDB01-70F4-4E06-B468-8F87850B22BE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Faster.Zheng.Winin.Application.Tests", "test\Faster.Zheng.Winin.Application.Tests\Faster.Zheng.Winin.Application.Tests.csproj", "{50B2631D-129C-47B3-A587-029CCD6099BC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Faster.Zheng.Winin.Web.Tests", "test\Faster.Zheng.Winin.Web.Tests\Faster.Zheng.Winin.Web.Tests.csproj", "{5F1B28C6-8D0C-4155-92D0-252F7EA5F674}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Faster.Zheng.Winin.Domain.Shared", "src\Faster.Zheng.Winin.Domain.Shared\Faster.Zheng.Winin.Domain.Shared.csproj", "{42F719ED-8413-4895-B5B4-5AB56079BC66}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Faster.Zheng.Winin.Application.Contracts", "src\Faster.Zheng.Winin.Application.Contracts\Faster.Zheng.Winin.Application.Contracts.csproj", "{520659C8-C734-4298-A3DA-B539DB9DFC0B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Faster.Zheng.Winin.HttpApi", "src\Faster.Zheng.Winin.HttpApi\Faster.Zheng.Winin.HttpApi.csproj", "{4164BDF7-F527-4E85-9CE6-E3C2D7426A27}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Faster.Zheng.Winin.HttpApi.Client", "src\Faster.Zheng.Winin.HttpApi.Client\Faster.Zheng.Winin.HttpApi.Client.csproj", "{3B5A0094-670D-4BB1-BFDD-61B88A8773DC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Faster.Zheng.Winin.EntityFrameworkCore.Tests", "test\Faster.Zheng.Winin.EntityFrameworkCore.Tests\Faster.Zheng.Winin.EntityFrameworkCore.Tests.csproj", "{1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Faster.Zheng.Winin.TestBase", "test\Faster.Zheng.Winin.TestBase\Faster.Zheng.Winin.TestBase.csproj", "{91853F21-9CD9-4132-BC29-A7D5D84FFFE7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Faster.Zheng.Winin.Domain.Tests", "test\Faster.Zheng.Winin.Domain.Tests\Faster.Zheng.Winin.Domain.Tests.csproj", "{E512F4D9-9375-480F-A2F6-A46509F9D824}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Faster.Zheng.Winin.HttpApi.Client.ConsoleTestApp", "test\Faster.Zheng.Winin.HttpApi.Client.ConsoleTestApp\Faster.Zheng.Winin.HttpApi.Client.ConsoleTestApp.csproj", "{EF480016-9127-4916-8735-D2466BDBC582}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Faster.Zheng.Winin.DbMigrator", "src\Faster.Zheng.Winin.DbMigrator\Faster.Zheng.Winin.DbMigrator.csproj", "{AA94D832-1CCC-4715-95A9-A483F23A1A5D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{554AD327-6DBA-4F8F-96F8-81CE7A0C863F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{554AD327-6DBA-4F8F-96F8-81CE7A0C863F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{554AD327-6DBA-4F8F-96F8-81CE7A0C863F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{554AD327-6DBA-4F8F-96F8-81CE7A0C863F}.Release|Any CPU.Build.0 = Release|Any CPU
{1A94A50E-06DC-43C1-80B5-B662820EC3EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1A94A50E-06DC-43C1-80B5-B662820EC3EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1A94A50E-06DC-43C1-80B5-B662820EC3EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1A94A50E-06DC-43C1-80B5-B662820EC3EB}.Release|Any CPU.Build.0 = Release|Any CPU
{C956DD76-69C8-4A9C-83EA-D17DF83340FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C956DD76-69C8-4A9C-83EA-D17DF83340FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C956DD76-69C8-4A9C-83EA-D17DF83340FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C956DD76-69C8-4A9C-83EA-D17DF83340FD}.Release|Any CPU.Build.0 = Release|Any CPU
{068855E8-9240-4F1A-910B-CF825794513B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{068855E8-9240-4F1A-910B-CF825794513B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{068855E8-9240-4F1A-910B-CF825794513B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{068855E8-9240-4F1A-910B-CF825794513B}.Release|Any CPU.Build.0 = Release|Any CPU
{50B2631D-129C-47B3-A587-029CCD6099BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{50B2631D-129C-47B3-A587-029CCD6099BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{50B2631D-129C-47B3-A587-029CCD6099BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{50B2631D-129C-47B3-A587-029CCD6099BC}.Release|Any CPU.Build.0 = Release|Any CPU
{5F1B28C6-8D0C-4155-92D0-252F7EA5F674}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5F1B28C6-8D0C-4155-92D0-252F7EA5F674}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5F1B28C6-8D0C-4155-92D0-252F7EA5F674}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5F1B28C6-8D0C-4155-92D0-252F7EA5F674}.Release|Any CPU.Build.0 = Release|Any CPU
{42F719ED-8413-4895-B5B4-5AB56079BC66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{42F719ED-8413-4895-B5B4-5AB56079BC66}.Debug|Any CPU.Build.0 = Debug|Any CPU
{42F719ED-8413-4895-B5B4-5AB56079BC66}.Release|Any CPU.ActiveCfg = Release|Any CPU
{42F719ED-8413-4895-B5B4-5AB56079BC66}.Release|Any CPU.Build.0 = Release|Any CPU
{520659C8-C734-4298-A3DA-B539DB9DFC0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{520659C8-C734-4298-A3DA-B539DB9DFC0B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{520659C8-C734-4298-A3DA-B539DB9DFC0B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{520659C8-C734-4298-A3DA-B539DB9DFC0B}.Release|Any CPU.Build.0 = Release|Any CPU
{4164BDF7-F527-4E85-9CE6-E3C2D7426A27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4164BDF7-F527-4E85-9CE6-E3C2D7426A27}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4164BDF7-F527-4E85-9CE6-E3C2D7426A27}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4164BDF7-F527-4E85-9CE6-E3C2D7426A27}.Release|Any CPU.Build.0 = Release|Any CPU
{3B5A0094-670D-4BB1-BFDD-61B88A8773DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B5A0094-670D-4BB1-BFDD-61B88A8773DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B5A0094-670D-4BB1-BFDD-61B88A8773DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3B5A0094-670D-4BB1-BFDD-61B88A8773DC}.Release|Any CPU.Build.0 = Release|Any CPU
{1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81}.Release|Any CPU.Build.0 = Release|Any CPU
{91853F21-9CD9-4132-BC29-A7D5D84FFFE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{91853F21-9CD9-4132-BC29-A7D5D84FFFE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{91853F21-9CD9-4132-BC29-A7D5D84FFFE7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{91853F21-9CD9-4132-BC29-A7D5D84FFFE7}.Release|Any CPU.Build.0 = Release|Any CPU
{E512F4D9-9375-480F-A2F6-A46509F9D824}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E512F4D9-9375-480F-A2F6-A46509F9D824}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E512F4D9-9375-480F-A2F6-A46509F9D824}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E512F4D9-9375-480F-A2F6-A46509F9D824}.Release|Any CPU.Build.0 = Release|Any CPU
{EF480016-9127-4916-8735-D2466BDBC582}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF480016-9127-4916-8735-D2466BDBC582}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF480016-9127-4916-8735-D2466BDBC582}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EF480016-9127-4916-8735-D2466BDBC582}.Release|Any CPU.Build.0 = Release|Any CPU
{AA94D832-1CCC-4715-95A9-A483F23A1A5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AA94D832-1CCC-4715-95A9-A483F23A1A5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AA94D832-1CCC-4715-95A9-A483F23A1A5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AA94D832-1CCC-4715-95A9-A483F23A1A5D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{554AD327-6DBA-4F8F-96F8-81CE7A0C863F} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{1A94A50E-06DC-43C1-80B5-B662820EC3EB} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{C956DD76-69C8-4A9C-83EA-D17DF83340FD} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{068855E8-9240-4F1A-910B-CF825794513B} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{50B2631D-129C-47B3-A587-029CCD6099BC} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
{5F1B28C6-8D0C-4155-92D0-252F7EA5F674} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
{42F719ED-8413-4895-B5B4-5AB56079BC66} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{520659C8-C734-4298-A3DA-B539DB9DFC0B} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{4164BDF7-F527-4E85-9CE6-E3C2D7426A27} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{3B5A0094-670D-4BB1-BFDD-61B88A8773DC} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
{91853F21-9CD9-4132-BC29-A7D5D84FFFE7} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
{E512F4D9-9375-480F-A2F6-A46509F9D824} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
{EF480016-9127-4916-8735-D2466BDBC582} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
{AA94D832-1CCC-4715-95A9-A483F23A1A5D} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F}
EndGlobalSection
EndGlobal

23
Code/Be/Faster.Zheng.Winin/Faster.Zheng.Winin.sln.DotSettings

@ -0,0 +1,23 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeEditing/Intellisense/CodeCompletion/IntelliSenseCompletingCharacters/CSharpCompletingCharacters/UpgradedFromVSSettings/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceDoWhileStatementBraces/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceFixedStatementBraces/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceForeachStatementBraces/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceForStatementBraces/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceIfStatementBraces/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceLockStatementBraces/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceUsingStatementBraces/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceWhileStatementBraces/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_FOR/@EntryValue">Required</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_FOREACH/@EntryValue">Required</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_IFELSE/@EntryValue">Required</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_WHILE/@EntryValue">Required</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_REDUNDANT/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/Generate/=Implementations/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Generate/=Implementations/Options/=Async/@EntryIndexedValue">False</s:String>
<s:String x:Key="/Default/CodeStyle/Generate/=Implementations/Options/=Mutable/@EntryIndexedValue">False</s:String>
<s:Boolean x:Key="/Default/CodeStyle/Generate/=Overrides/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Generate/=Overrides/Options/=Async/@EntryIndexedValue">False</s:String>
<s:String x:Key="/Default/CodeStyle/Generate/=Overrides/Options/=Mutable/@EntryIndexedValue">False</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SQL/@EntryIndexedValue">SQL</s:String>
</wpf:ResourceDictionary>

5
Code/Be/Faster.Zheng.Winin/NuGet.Config

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
</packageSources>
</configuration>

19
Code/Be/Faster.Zheng.Winin/common.props

@ -0,0 +1,19 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>1.0.0</Version>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<AbpProjectType>app</AbpProjectType>
</PropertyGroup>
<Target Name="NoWarnOnRazorViewImportedTypeConflicts" BeforeTargets="RazorCoreCompile">
<PropertyGroup>
<NoWarn>$(NoWarn);0436</NoWarn>
</PropertyGroup>
</Target>
<ItemGroup>
<Content Remove="$(UserProfile)\.nuget\packages\*\*\contentFiles\any\*\*.abppkg*.json" />
</ItemGroup>
</Project>

25
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/Faster.Zheng.Winin.Application.Contracts.csproj

@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Nullable>enable</Nullable>
<RootNamespace>Faster.Zheng.Winin</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Faster.Zheng.Winin.Domain.Shared\Faster.Zheng.Winin.Domain.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.ObjectExtending" Version="7.2.1" />
<PackageReference Include="Volo.Abp.Account.Application.Contracts" Version="7.2.1" />
<PackageReference Include="Volo.Abp.Identity.Application.Contracts" Version="7.2.1" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application.Contracts" Version="7.2.1" />
<PackageReference Include="Volo.Abp.TenantManagement.Application.Contracts" Version="7.2.1" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application.Contracts" Version="7.2.1" />
<PackageReference Include="Volo.Abp.SettingManagement.Application.Contracts" Version="7.2.1" />
</ItemGroup>
</Project>

20
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/Permissions/WininPermissionDefinitionProvider.cs

@ -0,0 +1,20 @@
using Faster.Zheng.Winin.Localization;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;
namespace Faster.Zheng.Winin.Permissions;
public class WininPermissionDefinitionProvider : PermissionDefinitionProvider
{
public override void Define(IPermissionDefinitionContext context)
{
var myGroup = context.AddGroup(WininPermissions.GroupName);
//Define your own permissions here. Example:
//myGroup.AddPermission(WininPermissions.MyPermission1, L("Permission:MyPermission1"));
}
private static LocalizableString L(string name)
{
return LocalizableString.Create<WininResource>(name);
}
}

9
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/Permissions/WininPermissions.cs

@ -0,0 +1,9 @@
namespace Faster.Zheng.Winin.Permissions;
public static class WininPermissions
{
public const string GroupName = "Winin";
//Add your own permission names. Example:
//public const string MyPermission1 = GroupName + ".MyPermission1";
}

28
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/WininApplicationContractsModule.cs

@ -0,0 +1,28 @@
using Volo.Abp.Account;
using Volo.Abp.FeatureManagement;
using Volo.Abp.Identity;
using Volo.Abp.Modularity;
using Volo.Abp.ObjectExtending;
using Volo.Abp.PermissionManagement;
using Volo.Abp.SettingManagement;
using Volo.Abp.TenantManagement;
namespace Faster.Zheng.Winin;
[DependsOn(
typeof(WininDomainSharedModule),
typeof(AbpAccountApplicationContractsModule),
typeof(AbpFeatureManagementApplicationContractsModule),
typeof(AbpIdentityApplicationContractsModule),
typeof(AbpPermissionManagementApplicationContractsModule),
typeof(AbpSettingManagementApplicationContractsModule),
typeof(AbpTenantManagementApplicationContractsModule),
typeof(AbpObjectExtendingModule)
)]
public class WininApplicationContractsModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
WininDtoExtensions.Configure();
}
}

28
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/WininDtoExtensions.cs

@ -0,0 +1,28 @@
using Volo.Abp.Identity;
using Volo.Abp.ObjectExtending;
using Volo.Abp.Threading;
namespace Faster.Zheng.Winin;
public static class WininDtoExtensions
{
private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner();
public static void Configure()
{
OneTimeRunner.Run(() =>
{
/* You can add extension properties to DTOs
* defined in the depended modules.
*
* Example:
*
* ObjectExtensionManager.Instance
* .AddOrUpdateProperty<IdentityRoleDto, string>("Title");
*
* See the documentation for more:
* https://docs.abp.io/en/abp/latest/Object-Extensions
*/
});
}
}

25
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/Faster.Zheng.Winin.Application.csproj

@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<RootNamespace>Faster.Zheng.Winin</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Faster.Zheng.Winin.Domain\Faster.Zheng.Winin.Domain.csproj" />
<ProjectReference Include="..\Faster.Zheng.Winin.Application.Contracts\Faster.Zheng.Winin.Application.Contracts.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Account.Application" Version="7.2.1" />
<PackageReference Include="Volo.Abp.Identity.Application" Version="7.2.1" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application" Version="7.2.1" />
<PackageReference Include="Volo.Abp.TenantManagement.Application" Version="7.2.1" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application" Version="7.2.1" />
<PackageReference Include="Volo.Abp.SettingManagement.Application" Version="7.2.1" />
</ItemGroup>
</Project>

2
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/Properties/AssemblyInfo.cs

@ -0,0 +1,2 @@
using System.Runtime.CompilerServices;
[assembly:InternalsVisibleToAttribute("Faster.Zheng.Winin.Application.Tests")]

17
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/WininAppService.cs

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Text;
using Faster.Zheng.Winin.Localization;
using Volo.Abp.Application.Services;
namespace Faster.Zheng.Winin;
/* Inherit your application services from this class.
*/
public abstract class WininAppService : ApplicationService
{
protected WininAppService()
{
LocalizationResource = typeof(WininResource);
}
}

13
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/WininApplicationAutoMapperProfile.cs

@ -0,0 +1,13 @@
using AutoMapper;
namespace Faster.Zheng.Winin;
public class WininApplicationAutoMapperProfile : Profile
{
public WininApplicationAutoMapperProfile()
{
/* You can configure your AutoMapper mapping configuration here.
* Alternatively, you can split your mapping configurations
* into multiple profile classes for a better organization. */
}
}

31
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/WininApplicationModule.cs

@ -0,0 +1,31 @@
using Volo.Abp.Account;
using Volo.Abp.AutoMapper;
using Volo.Abp.FeatureManagement;
using Volo.Abp.Identity;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement;
using Volo.Abp.SettingManagement;
using Volo.Abp.TenantManagement;
namespace Faster.Zheng.Winin;
[DependsOn(
typeof(WininDomainModule),
typeof(AbpAccountApplicationModule),
typeof(WininApplicationContractsModule),
typeof(AbpIdentityApplicationModule),
typeof(AbpPermissionManagementApplicationModule),
typeof(AbpTenantManagementApplicationModule),
typeof(AbpFeatureManagementApplicationModule),
typeof(AbpSettingManagementApplicationModule)
)]
public class WininApplicationModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpAutoMapperOptions>(options =>
{
options.AddMaps<WininApplicationModule>();
});
}
}

51
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.DbMigrator/DbMigratorHostedService.cs

@ -0,0 +1,51 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Faster.Zheng.Winin.Data;
using Serilog;
using Volo.Abp;
using Volo.Abp.Data;
namespace Faster.Zheng.Winin.DbMigrator;
public class DbMigratorHostedService : IHostedService
{
private readonly IHostApplicationLifetime _hostApplicationLifetime;
private readonly IConfiguration _configuration;
public DbMigratorHostedService(IHostApplicationLifetime hostApplicationLifetime, IConfiguration configuration)
{
_hostApplicationLifetime = hostApplicationLifetime;
_configuration = configuration;
}
public async Task StartAsync(CancellationToken cancellationToken)
{
using (var application = await AbpApplicationFactory.CreateAsync<WininDbMigratorModule>(options =>
{
options.Services.ReplaceConfiguration(_configuration);
options.UseAutofac();
options.Services.AddLogging(c => c.AddSerilog());
options.AddDataMigrationEnvironment();
}))
{
await application.InitializeAsync();
await application
.ServiceProvider
.GetRequiredService<WininDbMigrationService>()
.MigrateAsync();
await application.ShutdownAsync();
_hostApplicationLifetime.StopApplication();
}
}
public Task StopAsync(CancellationToken cancellationToken)
{
return Task.CompletedTask;
}
}

45
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.DbMigrator/Faster.Zheng.Winin.DbMigrator.csproj

@ -0,0 +1,45 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<None Remove="appsettings.json" />
<Content Include="appsettings.json">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Remove="appsettings.secrets.json" />
<Content Include="appsettings.secrets.json">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Serilog.Extensions.Logging" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Autofac" Version="7.2.1" />
<ProjectReference Include="..\Faster.Zheng.Winin.Application.Contracts\Faster.Zheng.Winin.Application.Contracts.csproj" />
<ProjectReference Include="..\Faster.Zheng.Winin.EntityFrameworkCore\Faster.Zheng.Winin.EntityFrameworkCore.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Logs\**" />
<Content Remove="Logs\**" />
<EmbeddedResource Remove="Logs\**" />
<None Remove="Logs\**" />
</ItemGroup>
</Project>

41
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.DbMigrator/Program.cs

@ -0,0 +1,41 @@
using System.IO;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Serilog;
using Serilog.Events;
namespace Faster.Zheng.Winin.DbMigrator;
class Program
{
static async Task Main(string[] args)
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Information()
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
.MinimumLevel.Override("Volo.Abp", LogEventLevel.Warning)
#if DEBUG
.MinimumLevel.Override("Faster.Zheng.Winin", LogEventLevel.Debug)
#else
.MinimumLevel.Override("Faster.Zheng.Winin", LogEventLevel.Information)
#endif
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
.WriteTo.Async(c => c.Console())
.CreateLogger();
await CreateHostBuilder(args).RunConsoleAsync();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.AddAppSettingsSecretsJson()
.ConfigureLogging((context, logging) => logging.ClearProviders())
.ConfigureServices((hostContext, services) =>
{
services.AddHostedService<DbMigratorHostedService>();
});
}

15
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.DbMigrator/WininDbMigratorModule.cs

@ -0,0 +1,15 @@
using Faster.Zheng.Winin.EntityFrameworkCore;
using Volo.Abp.Autofac;
using Volo.Abp.Modularity;
namespace Faster.Zheng.Winin.DbMigrator;
[DependsOn(
typeof(AbpAutofacModule),
typeof(WininEntityFrameworkCoreModule),
typeof(WininApplicationContractsModule)
)]
public class WininDbMigratorModule : AbpModule
{
}

27
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.DbMigrator/appsettings.json

@ -0,0 +1,27 @@
{
"ConnectionStrings": {
"Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=Winin;Trusted_Connection=True;TrustServerCertificate=True"
},
"OpenIddict": {
"Applications": {
"Winin_Web": {
"ClientId": "Winin_Web",
"ClientSecret": "1q2w3e*",
"RootUrl": "https://localhost:44392"
},
"Winin_App": {
"ClientId": "Winin_App",
"RootUrl": "http://localhost:4200"
},
"Winin_BlazorServerTiered": {
"ClientId": "Winin_BlazorServerTiered",
"ClientSecret": "1q2w3e*",
"RootUrl": "https://localhost:44367"
},
"Winin_Swagger": {
"ClientId": "Winin_Swagger",
"RootUrl": "https://localhost:44380"
}
}
}
}

2
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.DbMigrator/appsettings.secrets.json

@ -0,0 +1,2 @@
{
}

32
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Faster.Zheng.Winin.Domain.Shared.csproj

@ -0,0 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Nullable>enable</Nullable>
<RootNamespace>Faster.Zheng.Winin</RootNamespace>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Identity.Domain.Shared" Version="7.2.1" />
<PackageReference Include="Volo.Abp.BackgroundJobs.Domain.Shared" Version="7.2.1" />
<PackageReference Include="Volo.Abp.AuditLogging.Domain.Shared" Version="7.2.1" />
<PackageReference Include="Volo.Abp.TenantManagement.Domain.Shared" Version="7.2.1" />
<PackageReference Include="Volo.Abp.FeatureManagement.Domain.Shared" Version="7.2.1" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Shared" Version="7.2.1" />
<PackageReference Include="Volo.Abp.SettingManagement.Domain.Shared" Version="7.2.1" />
<PackageReference Include="Volo.Abp.OpenIddict.Domain.Shared" Version="7.2.1" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Localization\Winin\*.json" />
<Content Remove="Localization\Winin\*.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="7.0.0" />
</ItemGroup>
</Project>

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/ar.json

@ -0,0 +1,8 @@
{
"culture": "ar",
"texts": {
"Menu:Home": "الرئيسية",
"Menu:Home": "الصفحة الرئيسية",
"LongWelcomeMessage": "مرحبا بكم في التطبيق. هذا مشروع بدء تشغيل يعتمد على إطار عمل ABP. لمزيد من المعلومات ، يرجى زيارة abp.io."
}
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/cs.json

@ -0,0 +1,8 @@
{
"culture": "cs",
"texts": {
"Menu:Home": "Úvod",
"Welcome": "Vítejte",
"LongWelcomeMessage": "Vítejte v aplikaci. Toto je startovací projekt založený na ABP frameworku. Pro více informací, navštivte abp.io."
}
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/de.json

@ -0,0 +1,8 @@
{
"culture": "de",
"texts": {
"Menu:Home": "Home",
"Welcome": "Willkommen",
"LongWelcomeMessage": "Willkommen bei der Anwendung. Dies ist ein Startup-Projekt, das auf dem ABP-Framework basiert. Weitere Informationen finden Sie unter abp.io."
}
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/en-GB.json

@ -0,0 +1,8 @@
{
"culture": "en-GB",
"texts": {
"Menu:Home": "Home",
"Welcome": "Welcome",
"LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io."
}
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/en.json

@ -0,0 +1,8 @@
{
"culture": "en",
"texts": {
"Menu:Home": "Home",
"Welcome": "Welcome",
"LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io."
}
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/es.json

@ -0,0 +1,8 @@
{
"culture": "es",
"texts": {
"Menu:Home": "Inicio",
"Welcome": "Bienvenido",
"LongWelcomeMessage": "Bienvenido a la aplicación, este es un proyecto base basado en el framework ABP. Para más información, visita abp.io."
}
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/fi.json

@ -0,0 +1,8 @@
{
"culture": "fi",
"texts": {
"Menu:Home": "Koti",
"Welcome": "Tervetuloa",
"LongWelcomeMessage": "Tervetuloa sovellukseen. Tämä on ABP-kehykseen perustuva käynnistysprojekti. Lisätietoja on osoitteessa abp.io."
}
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/fr.json

@ -0,0 +1,8 @@
{
"culture": "fr",
"texts": {
"Menu:Home": "Accueil",
"Welcome": "Bienvenue",
"LongWelcomeMessage": "Bienvenue dans l'application. Il s'agit d'un projet de démarrage basé sur le framework ABP. Pour plus d'informations, visitez abp.io."
}
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/hi.json

@ -0,0 +1,8 @@
{
"culture": "hi",
"texts": {
"Menu:Home": "घर",
"Welcome": "स्वागत हे",
"LongWelcomeMessage": "आवेदन करने के लिए आपका स्वागत है। यह एबीपी ढांचे पर आधारित एक स्टार्टअप परियोजना है। अधिक जानकारी के लिए, abp.io पर जाएं।"
}
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/hr.json

@ -0,0 +1,8 @@
{
"culture": "hr",
"texts": {
"Menu:Home": "Početna",
"Welcome": "Dobrodošli",
"LongWelcomeMessage": "Dobrodošli u aplikaciju. Ovo je startup projekt temeljen na ABP framework-u. Za više informacija posjetite abp.io."
}
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/hu.json

@ -0,0 +1,8 @@
{
"culture": "hu",
"texts": {
"Menu:Home": "Kezdőlap",
"Welcome": "Üdvözlöm",
"LongWelcomeMessage": "Üdvözöljük az alkalmazásban. Ez egy ABP keretrendszeren alapuló startup projekt. További információkért látogasson el az abp.io oldalra."
}
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/is.json

@ -0,0 +1,8 @@
{
"culture": "is",
"texts": {
"Menu:Home": "Heim",
"Welcome": "Velkomin",
"LongWelcomeMessage": "Verið velkomin í forritið. Þetta er startup verkefni sem byggir á ABP. Nánari upplýsingar er að finna á abp.io."
}
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/it.json

@ -0,0 +1,8 @@
{
"culture": "it",
"texts": {
"Menu:Home": "Home",
"Welcome": "Benvenuto",
"LongWelcomeMessage": "Benvenuto nell'applicazione. Questo è un progetto di avvio basato sul framework ABP. Per ulteriori informazioni, visita abp.io."
}
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/nl.json

@ -0,0 +1,8 @@
{
"culture": "nl",
"texts": {
"Menu:Home": "Home",
"Welcome": "Welkom",
"LongWelcomeMessage": "Welkom bij de applicatie. Dit is een startup-project gebaseerd op het ABP-framework. Bezoek abp.io voor meer informatie."
}
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/pl-PL.json

@ -0,0 +1,8 @@
{
"culture": "pl-PL",
"texts": {
"Menu:Home": "Home",
"Welcome": "Witaj",
"LongWelcomeMessage": "Witaj w aplikacji. To jest inicjalny projekt bazujący na ABP framework. Po więcej informacji odwiedź stronę abp.io."
}
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/pt-BR.json

@ -0,0 +1,8 @@
{
"culture": "pt-BR",
"texts": {
"Menu:Home": "Principal",
"Welcome": "Seja bem-vindo!",
"LongWelcomeMessage": "Bem-vindo a esta aplicação. Este é um projeto inicial baseado no ABP framework. Para mais informações, visite abp.io."
}
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/ro-RO.json

@ -0,0 +1,8 @@
{
"culture": "ro-RO",
"texts": {
"Menu:Home": "Acasă",
"Welcome": "Bun venit",
"LongWelcomeMessage": "Bun venit la aplicaţie. Acesta este un proiect de pornire bazat pe framework-ul ABP. Pentru mai multe informaţii, vizitaţi, visit abp.io."
}
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/ru.json

@ -0,0 +1,8 @@
{
"culture": "ru",
"texts": {
"Menu:Home": "Главная",
"Welcome": "Добро пожаловать",
"LongWelcomeMessage": "Добро пожаловать в приложение. Этот запущенный проект основан на фреймворке ABP. Для получения дополнительной информации посетите сайт abp.io."
}
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/sk.json

@ -0,0 +1,8 @@
{
"culture": "sk",
"texts": {
"Menu:Home": "Domov",
"Welcome": "Vitajte",
"LongWelcomeMessage": "Vitajte v aplikácii. Toto je štartovací projekt založený na ABP frameworku. Viac informácií nájdete na stránke abp.io."
}
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/sl.json

@ -0,0 +1,8 @@
{
"culture": "sl",
"texts": {
"Menu:Home": "Domov",
"Welcome": "Dobrodošli",
"LongWelcomeMessage": "Dobrodošli v aplikaciji. To je začetni projekt na osnovi okolja ABP. Za več informacij obiščite abp.io."
}
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/tr.json

@ -0,0 +1,8 @@
{
"culture": "tr",
"texts": {
"Menu:Home": "Ana sayfa",
"Welcome": "Hoşgeldiniz",
"LongWelcomeMessage": "Uygulamaya hoşgeldiniz. Bu, ABP framework'ü üzerine bina edilmiş bir başlangıç projesidir. Daha fazla bilgi için abp.io adresini ziyaret edebilirsiniz."
}
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/vi.json

@ -0,0 +1,8 @@
{
"culture": "vi",
"texts": {
"Menu:Home": "Trang chủ",
"Welcome": "Chào mừng bạn",
"LongWelcomeMessage": "Chào mừng bạn đến ứng dụng. Đây là một dự án khởi nghiệp dựa trên khung ABP. Để biết thêm thông tin, hãy truy cập abp.io."
}
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/zh-Hans.json

@ -0,0 +1,8 @@
{
"culture": "zh-Hans",
"texts": {
"Menu:Home": "首页",
"Welcome": "欢迎",
"LongWelcomeMessage": "欢迎来到该应用程序. 这是一个基于ABP框架的启动项目. 有关更多信息, 请访问 abp.io."
}
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/Winin/zh-Hant.json

@ -0,0 +1,8 @@
{
"culture": "zh-Hant",
"texts": {
"Menu:Home": "首頁",
"Welcome": "歡迎",
"LongWelcomeMessage": "歡迎來到此應用程式. 這是一個基於ABP框架的起始專案. 有關更多訊息, 請瀏覽 abp.io."
}
}

9
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/Localization/WininResource.cs

@ -0,0 +1,9 @@
using Volo.Abp.Localization;
namespace Faster.Zheng.Winin.Localization;
[LocalizationResourceName("Winin")]
public class WininResource
{
}

10
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs

@ -0,0 +1,10 @@
namespace Faster.Zheng.Winin.MultiTenancy;
public static class MultiTenancyConsts
{
/* Enable/disable multi-tenancy easily in a single point.
* If you will never need to multi-tenancy, you can remove
* related modules and code parts, including this file.
*/
public const bool IsEnabled = true;
}

6
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/WininDomainErrorCodes.cs

@ -0,0 +1,6 @@
namespace Faster.Zheng.Winin;
public static class WininDomainErrorCodes
{
/* You can add your business exception error codes here, as constants */
}

58
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/WininDomainSharedModule.cs

@ -0,0 +1,58 @@
using Faster.Zheng.Winin.Localization;
using Volo.Abp.AuditLogging;
using Volo.Abp.BackgroundJobs;
using Volo.Abp.FeatureManagement;
using Volo.Abp.Identity;
using Volo.Abp.Localization;
using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Modularity;
using Volo.Abp.OpenIddict;
using Volo.Abp.PermissionManagement;
using Volo.Abp.SettingManagement;
using Volo.Abp.TenantManagement;
using Volo.Abp.Validation.Localization;
using Volo.Abp.VirtualFileSystem;
namespace Faster.Zheng.Winin;
[DependsOn(
typeof(AbpAuditLoggingDomainSharedModule),
typeof(AbpBackgroundJobsDomainSharedModule),
typeof(AbpFeatureManagementDomainSharedModule),
typeof(AbpIdentityDomainSharedModule),
typeof(AbpOpenIddictDomainSharedModule),
typeof(AbpPermissionManagementDomainSharedModule),
typeof(AbpSettingManagementDomainSharedModule),
typeof(AbpTenantManagementDomainSharedModule)
)]
public class WininDomainSharedModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
WininGlobalFeatureConfigurator.Configure();
WininModuleExtensionConfigurator.Configure();
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<WininDomainSharedModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Add<WininResource>("en")
.AddBaseTypes(typeof(AbpValidationResource))
.AddVirtualJson("/Localization/Winin");
options.DefaultResourceType = typeof(WininResource);
});
Configure<AbpExceptionLocalizationOptions>(options =>
{
options.MapCodeNamespace("Winin", typeof(WininResource));
});
}
}

22
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/WininGlobalFeatureConfigurator.cs

@ -0,0 +1,22 @@
using Volo.Abp.Threading;
namespace Faster.Zheng.Winin;
public static class WininGlobalFeatureConfigurator
{
private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner();
public static void Configure()
{
OneTimeRunner.Run(() =>
{
/* You can configure (enable/disable) global features of the used modules here.
*
* YOU CAN SAFELY DELETE THIS CLASS AND REMOVE ITS USAGES IF YOU DON'T NEED TO IT!
*
* Please refer to the documentation to lear more about the Global Features System:
* https://docs.abp.io/en/abp/latest/Global-Features
*/
});
}
}

73
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain.Shared/WininModuleExtensionConfigurator.cs

@ -0,0 +1,73 @@
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Identity;
using Volo.Abp.ObjectExtending;
using Volo.Abp.Threading;
namespace Faster.Zheng.Winin;
public static class WininModuleExtensionConfigurator
{
private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner();
public static void Configure()
{
OneTimeRunner.Run(() =>
{
ConfigureExistingProperties();
ConfigureExtraProperties();
});
}
private static void ConfigureExistingProperties()
{
/* You can change max lengths for properties of the
* entities defined in the modules used by your application.
*
* Example: Change user and role name max lengths
IdentityUserConsts.MaxNameLength = 99;
IdentityRoleConsts.MaxNameLength = 99;
* Notice: It is not suggested to change property lengths
* unless you really need it. Go with the standard values wherever possible.
*
* If you are using EF Core, you will need to run the add-migration command after your changes.
*/
}
private static void ConfigureExtraProperties()
{
/* You can configure extra properties for the
* entities defined in the modules used by your application.
*
* This class can be used to define these extra properties
* with a high level, easy to use API.
*
* Example: Add a new property to the user entity of the identity module
ObjectExtensionManager.Instance.Modules()
.ConfigureIdentity(identity =>
{
identity.ConfigureUser(user =>
{
user.AddOrUpdateProperty<string>( //property type: string
"SocialSecurityNumber", //property name
property =>
{
//validation rules
property.Attributes.Add(new RequiredAttribute());
property.Attributes.Add(new StringLengthAttribute(64) {MinimumLength = 4});
property.Configuration[IdentityModuleExtensionConsts.ConfigurationNames.AllowUserToEdit] = true;
//...other configurations for this property
}
);
});
});
* See the documentation for more:
* https://docs.abp.io/en/abp/latest/Module-Entity-Extensions
*/
}
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain/Data/IWininDbSchemaMigrator.cs

@ -0,0 +1,8 @@
using System.Threading.Tasks;
namespace Faster.Zheng.Winin.Data;
public interface IWininDbSchemaMigrator
{
Task MigrateAsync();
}

15
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain/Data/NullWininDbSchemaMigrator.cs

@ -0,0 +1,15 @@
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
namespace Faster.Zheng.Winin.Data;
/* This is used if database provider does't define
* IWininDbSchemaMigrator implementation.
*/
public class NullWininDbSchemaMigrator : IWininDbSchemaMigrator, ITransientDependency
{
public Task MigrateAsync()
{
return Task.CompletedTask;
}
}

218
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain/Data/WininDbMigrationService.cs

@ -0,0 +1,218 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Identity;
using Volo.Abp.MultiTenancy;
using Volo.Abp.TenantManagement;
namespace Faster.Zheng.Winin.Data;
public class WininDbMigrationService : ITransientDependency
{
public ILogger<WininDbMigrationService> Logger { get; set; }
private readonly IDataSeeder _dataSeeder;
private readonly IEnumerable<IWininDbSchemaMigrator> _dbSchemaMigrators;
private readonly ITenantRepository _tenantRepository;
private readonly ICurrentTenant _currentTenant;
public WininDbMigrationService(
IDataSeeder dataSeeder,
IEnumerable<IWininDbSchemaMigrator> dbSchemaMigrators,
ITenantRepository tenantRepository,
ICurrentTenant currentTenant)
{
_dataSeeder = dataSeeder;
_dbSchemaMigrators = dbSchemaMigrators;
_tenantRepository = tenantRepository;
_currentTenant = currentTenant;
Logger = NullLogger<WininDbMigrationService>.Instance;
}
public async Task MigrateAsync()
{
var initialMigrationAdded = AddInitialMigrationIfNotExist();
if (initialMigrationAdded)
{
return;
}
Logger.LogInformation("Started database migrations...");
await MigrateDatabaseSchemaAsync();
await SeedDataAsync();
Logger.LogInformation($"Successfully completed host database migrations.");
var tenants = await _tenantRepository.GetListAsync(includeDetails: true);
var migratedDatabaseSchemas = new HashSet<string>();
foreach (var tenant in tenants)
{
using (_currentTenant.Change(tenant.Id))
{
if (tenant.ConnectionStrings.Any())
{
var tenantConnectionStrings = tenant.ConnectionStrings
.Select(x => x.Value)
.ToList();
if (!migratedDatabaseSchemas.IsSupersetOf(tenantConnectionStrings))
{
await MigrateDatabaseSchemaAsync(tenant);
migratedDatabaseSchemas.AddIfNotContains(tenantConnectionStrings);
}
}
await SeedDataAsync(tenant);
}
Logger.LogInformation($"Successfully completed {tenant.Name} tenant database migrations.");
}
Logger.LogInformation("Successfully completed all database migrations.");
Logger.LogInformation("You can safely end this process...");
}
private async Task MigrateDatabaseSchemaAsync(Tenant? tenant = null)
{
Logger.LogInformation(
$"Migrating schema for {(tenant == null ? "host" : tenant.Name + " tenant")} database...");
foreach (var migrator in _dbSchemaMigrators)
{
await migrator.MigrateAsync();
}
}
private async Task SeedDataAsync(Tenant? tenant = null)
{
Logger.LogInformation($"Executing {(tenant == null ? "host" : tenant.Name + " tenant")} database seed...");
await _dataSeeder.SeedAsync(new DataSeedContext(tenant?.Id)
.WithProperty(IdentityDataSeedContributor.AdminEmailPropertyName, IdentityDataSeedContributor.AdminEmailDefaultValue)
.WithProperty(IdentityDataSeedContributor.AdminPasswordPropertyName, IdentityDataSeedContributor.AdminPasswordDefaultValue)
);
}
private bool AddInitialMigrationIfNotExist()
{
try
{
if (!DbMigrationsProjectExists())
{
return false;
}
}
catch (Exception)
{
return false;
}
try
{
if (!MigrationsFolderExists())
{
AddInitialMigration();
return true;
}
else
{
return false;
}
}
catch (Exception e)
{
Logger.LogWarning("Couldn't determinate if any migrations exist : " + e.Message);
return false;
}
}
private bool DbMigrationsProjectExists()
{
var dbMigrationsProjectFolder = GetEntityFrameworkCoreProjectFolderPath();
return dbMigrationsProjectFolder != null;
}
private bool MigrationsFolderExists()
{
var dbMigrationsProjectFolder = GetEntityFrameworkCoreProjectFolderPath();
return dbMigrationsProjectFolder != null && Directory.Exists(Path.Combine(dbMigrationsProjectFolder, "Migrations"));
}
private void AddInitialMigration()
{
Logger.LogInformation("Creating initial migration...");
string argumentPrefix;
string fileName;
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
argumentPrefix = "-c";
fileName = "/bin/bash";
}
else
{
argumentPrefix = "/C";
fileName = "cmd.exe";
}
var procStartInfo = new ProcessStartInfo(fileName,
$"{argumentPrefix} \"abp create-migration-and-run-migrator \"{GetEntityFrameworkCoreProjectFolderPath()}\"\""
);
try
{
Process.Start(procStartInfo);
}
catch (Exception)
{
throw new Exception("Couldn't run ABP CLI...");
}
}
private string? GetEntityFrameworkCoreProjectFolderPath()
{
var slnDirectoryPath = GetSolutionDirectoryPath();
if (slnDirectoryPath == null)
{
throw new Exception("Solution folder not found!");
}
var srcDirectoryPath = Path.Combine(slnDirectoryPath, "src");
return Directory.GetDirectories(srcDirectoryPath)
.FirstOrDefault(d => d.EndsWith(".EntityFrameworkCore"));
}
private string? GetSolutionDirectoryPath()
{
var currentDirectory = new DirectoryInfo(Directory.GetCurrentDirectory());
while (currentDirectory != null && Directory.GetParent(currentDirectory.FullName) != null)
{
currentDirectory = Directory.GetParent(currentDirectory.FullName);
if (currentDirectory != null && Directory.GetFiles(currentDirectory.FullName).FirstOrDefault(f => f.EndsWith(".sln")) != null)
{
return currentDirectory.FullName;
}
}
return null;
}
}

28
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain/Faster.Zheng.Winin.Domain.csproj

@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<RootNamespace>Faster.Zheng.Winin</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Faster.Zheng.Winin.Domain.Shared\Faster.Zheng.Winin.Domain.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Emailing" Version="7.2.1" />
<PackageReference Include="Volo.Abp.Identity.Domain" Version="7.2.1" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Identity" Version="7.2.1" />
<PackageReference Include="Volo.Abp.BackgroundJobs.Domain" Version="7.2.1" />
<PackageReference Include="Volo.Abp.AuditLogging.Domain" Version="7.2.1" />
<PackageReference Include="Volo.Abp.TenantManagement.Domain" Version="7.2.1" />
<PackageReference Include="Volo.Abp.FeatureManagement.Domain" Version="7.2.1" />
<PackageReference Include="Volo.Abp.SettingManagement.Domain" Version="7.2.1" />
<PackageReference Include="Volo.Abp.OpenIddict.Domain" Version="7.2.1" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.OpenIddict" Version="7.2.1" />
</ItemGroup>
</Project>

405
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain/OpenIddict/OpenIddictDataSeedContributor.cs

@ -0,0 +1,405 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Localization;
using OpenIddict.Abstractions;
using Volo.Abp;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.OpenIddict.Applications;
using Volo.Abp.PermissionManagement;
using Volo.Abp.Uow;
namespace Faster.Zheng.Winin.OpenIddict;
/* Creates initial data that is needed to property run the application
* and make client-to-server communication possible.
*/
public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDependency
{
private readonly IConfiguration _configuration;
private readonly IAbpApplicationManager _applicationManager;
private readonly IOpenIddictScopeManager _scopeManager;
private readonly IPermissionDataSeeder _permissionDataSeeder;
private readonly IStringLocalizer<OpenIddictResponse> L;
public OpenIddictDataSeedContributor(
IConfiguration configuration,
IAbpApplicationManager applicationManager,
IOpenIddictScopeManager scopeManager,
IPermissionDataSeeder permissionDataSeeder,
IStringLocalizer<OpenIddictResponse> l)
{
_configuration = configuration;
_applicationManager = applicationManager;
_scopeManager = scopeManager;
_permissionDataSeeder = permissionDataSeeder;
L = l;
}
[UnitOfWork]
public virtual async Task SeedAsync(DataSeedContext context)
{
await CreateScopesAsync();
await CreateApplicationsAsync();
}
private async Task CreateScopesAsync()
{
if (await _scopeManager.FindByNameAsync("Winin") == null)
{
await _scopeManager.CreateAsync(new OpenIddictScopeDescriptor
{
Name = "Winin",
DisplayName = "Winin API",
Resources =
{
"Winin"
}
});
}
}
private async Task CreateApplicationsAsync()
{
var commonScopes = new List<string>
{
OpenIddictConstants.Permissions.Scopes.Address,
OpenIddictConstants.Permissions.Scopes.Email,
OpenIddictConstants.Permissions.Scopes.Phone,
OpenIddictConstants.Permissions.Scopes.Profile,
OpenIddictConstants.Permissions.Scopes.Roles,
"Winin"
};
var configurationSection = _configuration.GetSection("OpenIddict:Applications");
//Web Client
var webClientId = configurationSection["Winin_Web:ClientId"];
if (!webClientId.IsNullOrWhiteSpace())
{
var webClientRootUrl = configurationSection["Winin_Web:RootUrl"].EnsureEndsWith('/');
/* Winin_Web client is only needed if you created a tiered
* solution. Otherwise, you can delete this client. */
await CreateApplicationAsync(
name: webClientId!,
type: OpenIddictConstants.ClientTypes.Confidential,
consentType: OpenIddictConstants.ConsentTypes.Implicit,
displayName: "Web Application",
secret: configurationSection["Winin_Web:ClientSecret"] ?? "1q2w3e*",
grantTypes: new List<string> //Hybrid flow
{
OpenIddictConstants.GrantTypes.AuthorizationCode,
OpenIddictConstants.GrantTypes.Implicit
},
scopes: commonScopes,
redirectUri: $"{webClientRootUrl}signin-oidc",
clientUri: webClientRootUrl,
postLogoutRedirectUri: $"{webClientRootUrl}signout-callback-oidc"
);
}
//Console Test / Angular Client
var consoleAndAngularClientId = configurationSection["Winin_App:ClientId"];
if (!consoleAndAngularClientId.IsNullOrWhiteSpace())
{
var consoleAndAngularClientRootUrl = configurationSection["Winin_App:RootUrl"]?.TrimEnd('/');
await CreateApplicationAsync(
name: consoleAndAngularClientId!,
type: OpenIddictConstants.ClientTypes.Public,
consentType: OpenIddictConstants.ConsentTypes.Implicit,
displayName: "Console Test / Angular Application",
secret: null,
grantTypes: new List<string>
{
OpenIddictConstants.GrantTypes.AuthorizationCode,
OpenIddictConstants.GrantTypes.Password,
OpenIddictConstants.GrantTypes.ClientCredentials,
OpenIddictConstants.GrantTypes.RefreshToken
},
scopes: commonScopes,
redirectUri: consoleAndAngularClientRootUrl,
clientUri: consoleAndAngularClientRootUrl,
postLogoutRedirectUri: consoleAndAngularClientRootUrl
);
}
// Blazor Client
var blazorClientId = configurationSection["Winin_Blazor:ClientId"];
if (!blazorClientId.IsNullOrWhiteSpace())
{
var blazorRootUrl = configurationSection["Winin_Blazor:RootUrl"]?.TrimEnd('/');
await CreateApplicationAsync(
name: blazorClientId!,
type: OpenIddictConstants.ClientTypes.Public,
consentType: OpenIddictConstants.ConsentTypes.Implicit,
displayName: "Blazor Application",
secret: null,
grantTypes: new List<string>
{
OpenIddictConstants.GrantTypes.AuthorizationCode,
},
scopes: commonScopes,
redirectUri: $"{blazorRootUrl}/authentication/login-callback",
clientUri: blazorRootUrl,
postLogoutRedirectUri: $"{blazorRootUrl}/authentication/logout-callback"
);
}
// Blazor Server Tiered Client
var blazorServerTieredClientId = configurationSection["Winin_BlazorServerTiered:ClientId"];
if (!blazorServerTieredClientId.IsNullOrWhiteSpace())
{
var blazorServerTieredRootUrl = configurationSection["Winin_BlazorServerTiered:RootUrl"].EnsureEndsWith('/');
await CreateApplicationAsync(
name: blazorServerTieredClientId!,
type: OpenIddictConstants.ClientTypes.Confidential,
consentType: OpenIddictConstants.ConsentTypes.Implicit,
displayName: "Blazor Server Application",
secret: configurationSection["Winin_BlazorServerTiered:ClientSecret"] ?? "1q2w3e*",
grantTypes: new List<string> //Hybrid flow
{
OpenIddictConstants.GrantTypes.AuthorizationCode,
OpenIddictConstants.GrantTypes.Implicit
},
scopes: commonScopes,
redirectUri: $"{blazorServerTieredRootUrl}signin-oidc",
clientUri: blazorServerTieredRootUrl,
postLogoutRedirectUri: $"{blazorServerTieredRootUrl}signout-callback-oidc"
);
}
// Swagger Client
var swaggerClientId = configurationSection["Winin_Swagger:ClientId"];
if (!swaggerClientId.IsNullOrWhiteSpace())
{
var swaggerRootUrl = configurationSection["Winin_Swagger:RootUrl"]?.TrimEnd('/');
await CreateApplicationAsync(
name: swaggerClientId!,
type: OpenIddictConstants.ClientTypes.Public,
consentType: OpenIddictConstants.ConsentTypes.Implicit,
displayName: "Swagger Application",
secret: null,
grantTypes: new List<string>
{
OpenIddictConstants.GrantTypes.AuthorizationCode,
},
scopes: commonScopes,
redirectUri: $"{swaggerRootUrl}/swagger/oauth2-redirect.html",
clientUri: swaggerRootUrl
);
}
}
private async Task CreateApplicationAsync(
[NotNull] string name,
[NotNull] string type,
[NotNull] string consentType,
string displayName,
string? secret,
List<string> grantTypes,
List<string> scopes,
string? clientUri = null,
string? redirectUri = null,
string? postLogoutRedirectUri = null,
List<string>? permissions = null)
{
if (!string.IsNullOrEmpty(secret) && string.Equals(type, OpenIddictConstants.ClientTypes.Public, StringComparison.OrdinalIgnoreCase))
{
throw new BusinessException(L["NoClientSecretCanBeSetForPublicApplications"]);
}
if (string.IsNullOrEmpty(secret) && string.Equals(type, OpenIddictConstants.ClientTypes.Confidential, StringComparison.OrdinalIgnoreCase))
{
throw new BusinessException(L["TheClientSecretIsRequiredForConfidentialApplications"]);
}
if (!string.IsNullOrEmpty(name) && await _applicationManager.FindByClientIdAsync(name) != null)
{
return;
//throw new BusinessException(L["TheClientIdentifierIsAlreadyTakenByAnotherApplication"]);
}
var client = await _applicationManager.FindByClientIdAsync(name);
if (client == null)
{
var application = new AbpApplicationDescriptor
{
ClientId = name,
Type = type,
ClientSecret = secret,
ConsentType = consentType,
DisplayName = displayName,
ClientUri = clientUri,
};
Check.NotNullOrEmpty(grantTypes, nameof(grantTypes));
Check.NotNullOrEmpty(scopes, nameof(scopes));
if (new [] { OpenIddictConstants.GrantTypes.AuthorizationCode, OpenIddictConstants.GrantTypes.Implicit }.All(grantTypes.Contains))
{
application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.CodeIdToken);
if (string.Equals(type, OpenIddictConstants.ClientTypes.Public, StringComparison.OrdinalIgnoreCase))
{
application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.CodeIdTokenToken);
application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.CodeToken);
}
}
if (!redirectUri.IsNullOrWhiteSpace() || !postLogoutRedirectUri.IsNullOrWhiteSpace())
{
application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Logout);
}
var buildInGrantTypes = new []
{
OpenIddictConstants.GrantTypes.Implicit,
OpenIddictConstants.GrantTypes.Password,
OpenIddictConstants.GrantTypes.AuthorizationCode,
OpenIddictConstants.GrantTypes.ClientCredentials,
OpenIddictConstants.GrantTypes.DeviceCode,
OpenIddictConstants.GrantTypes.RefreshToken
};
foreach (var grantType in grantTypes)
{
if (grantType == OpenIddictConstants.GrantTypes.AuthorizationCode)
{
application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode);
application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.Code);
}
if (grantType == OpenIddictConstants.GrantTypes.AuthorizationCode || grantType == OpenIddictConstants.GrantTypes.Implicit)
{
application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Authorization);
}
if (grantType == OpenIddictConstants.GrantTypes.AuthorizationCode ||
grantType == OpenIddictConstants.GrantTypes.ClientCredentials ||
grantType == OpenIddictConstants.GrantTypes.Password ||
grantType == OpenIddictConstants.GrantTypes.RefreshToken ||
grantType == OpenIddictConstants.GrantTypes.DeviceCode)
{
application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Token);
application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Revocation);
application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Introspection);
}
if (grantType == OpenIddictConstants.GrantTypes.ClientCredentials)
{
application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.ClientCredentials);
}
if (grantType == OpenIddictConstants.GrantTypes.Implicit)
{
application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.Implicit);
}
if (grantType == OpenIddictConstants.GrantTypes.Password)
{
application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.Password);
}
if (grantType == OpenIddictConstants.GrantTypes.RefreshToken)
{
application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.RefreshToken);
}
if (grantType == OpenIddictConstants.GrantTypes.DeviceCode)
{
application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.DeviceCode);
application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Device);
}
if (grantType == OpenIddictConstants.GrantTypes.Implicit)
{
application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.IdToken);
if (string.Equals(type, OpenIddictConstants.ClientTypes.Public, StringComparison.OrdinalIgnoreCase))
{
application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.IdTokenToken);
application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.Token);
}
}
if (!buildInGrantTypes.Contains(grantType))
{
application.Permissions.Add(OpenIddictConstants.Permissions.Prefixes.GrantType + grantType);
}
}
var buildInScopes = new []
{
OpenIddictConstants.Permissions.Scopes.Address,
OpenIddictConstants.Permissions.Scopes.Email,
OpenIddictConstants.Permissions.Scopes.Phone,
OpenIddictConstants.Permissions.Scopes.Profile,
OpenIddictConstants.Permissions.Scopes.Roles
};
foreach (var scope in scopes)
{
if (buildInScopes.Contains(scope))
{
application.Permissions.Add(scope);
}
else
{
application.Permissions.Add(OpenIddictConstants.Permissions.Prefixes.Scope + scope);
}
}
if (redirectUri != null)
{
if (!redirectUri.IsNullOrEmpty())
{
if (!Uri.TryCreate(redirectUri, UriKind.Absolute, out var uri) || !uri.IsWellFormedOriginalString())
{
throw new BusinessException(L["InvalidRedirectUri", redirectUri]);
}
if (application.RedirectUris.All(x => x != uri))
{
application.RedirectUris.Add(uri);
}
}
}
if (postLogoutRedirectUri != null)
{
if (!postLogoutRedirectUri.IsNullOrEmpty())
{
if (!Uri.TryCreate(postLogoutRedirectUri, UriKind.Absolute, out var uri) || !uri.IsWellFormedOriginalString())
{
throw new BusinessException(L["InvalidPostLogoutRedirectUri", postLogoutRedirectUri]);
}
if (application.PostLogoutRedirectUris.All(x => x != uri))
{
application.PostLogoutRedirectUris.Add(uri);
}
}
}
if (permissions != null)
{
await _permissionDataSeeder.SeedAsync(
ClientPermissionValueProvider.ProviderName,
name,
permissions,
null
);
}
await _applicationManager.CreateAsync(application);
}
}
}

3
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain/Properties/AssemblyInfo.cs

@ -0,0 +1,3 @@
using System.Runtime.CompilerServices;
[assembly:InternalsVisibleToAttribute("Faster.Zheng.Winin.Domain.Tests")]
[assembly:InternalsVisibleToAttribute("Faster.Zheng.Winin.TestBase")]

12
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain/Settings/WininSettingDefinitionProvider.cs

@ -0,0 +1,12 @@
using Volo.Abp.Settings;
namespace Faster.Zheng.Winin.Settings;
public class WininSettingDefinitionProvider : SettingDefinitionProvider
{
public override void Define(ISettingDefinitionContext context)
{
//Define your own settings here. Example:
//context.Add(new SettingDefinition(WininSettings.MySetting1));
}
}

9
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain/Settings/WininSettings.cs

@ -0,0 +1,9 @@
namespace Faster.Zheng.Winin.Settings;
public static class WininSettings
{
private const string Prefix = "Winin";
//Add your own setting names here. Example:
//public const string MySetting1 = Prefix + ".MySetting1";
}

8
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain/WininConsts.cs

@ -0,0 +1,8 @@
namespace Faster.Zheng.Winin;
public static class WininConsts
{
public const string DbTablePrefix = "App";
public const string DbSchema = null;
}

68
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Domain/WininDomainModule.cs

@ -0,0 +1,68 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Faster.Zheng.Winin.MultiTenancy;
using Volo.Abp.AuditLogging;
using Volo.Abp.BackgroundJobs;
using Volo.Abp.Emailing;
using Volo.Abp.FeatureManagement;
using Volo.Abp.Identity;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.MultiTenancy;
using Volo.Abp.OpenIddict;
using Volo.Abp.PermissionManagement.Identity;
using Volo.Abp.PermissionManagement.OpenIddict;
using Volo.Abp.SettingManagement;
using Volo.Abp.TenantManagement;
namespace Faster.Zheng.Winin;
[DependsOn(
typeof(WininDomainSharedModule),
typeof(AbpAuditLoggingDomainModule),
typeof(AbpBackgroundJobsDomainModule),
typeof(AbpFeatureManagementDomainModule),
typeof(AbpIdentityDomainModule),
typeof(AbpOpenIddictDomainModule),
typeof(AbpPermissionManagementDomainOpenIddictModule),
typeof(AbpPermissionManagementDomainIdentityModule),
typeof(AbpSettingManagementDomainModule),
typeof(AbpTenantManagementDomainModule),
typeof(AbpEmailingModule)
)]
public class WininDomainModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpLocalizationOptions>(options =>
{
options.Languages.Add(new LanguageInfo("ar", "ar", "العربية", "ae"));
options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština"));
options.Languages.Add(new LanguageInfo("en", "en", "English", "gb"));
options.Languages.Add(new LanguageInfo("en-GB", "en-GB", "English (UK)"));
options.Languages.Add(new LanguageInfo("hu", "hu", "Magyar"));
options.Languages.Add(new LanguageInfo("hr", "hr", "Croatian"));
options.Languages.Add(new LanguageInfo("fi", "fi", "Finnish", "fi"));
options.Languages.Add(new LanguageInfo("fr", "fr", "Français", "fr"));
options.Languages.Add(new LanguageInfo("hi", "hi", "Hindi", "in"));
options.Languages.Add(new LanguageInfo("it", "it", "Italiano", "it"));
options.Languages.Add(new LanguageInfo("pt-BR", "pt-BR", "Português"));
options.Languages.Add(new LanguageInfo("ru", "ru", "Русский", "ru"));
options.Languages.Add(new LanguageInfo("sk", "sk", "Slovak", "sk"));
options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe", "tr"));
options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文"));
options.Languages.Add(new LanguageInfo("zh-Hant", "zh-Hant", "繁體中文"));
options.Languages.Add(new LanguageInfo("de-DE", "de-DE", "Deutsch", "de"));
options.Languages.Add(new LanguageInfo("es", "es", "Español"));
});
Configure<AbpMultiTenancyOptions>(options =>
{
options.IsEnabled = MultiTenancyConsts.IsEnabled;
});
#if DEBUG
context.Services.Replace(ServiceDescriptor.Singleton<IEmailSender, NullEmailSender>());
#endif
}
}

34
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreWininDbSchemaMigrator.cs

@ -0,0 +1,34 @@
using System;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Faster.Zheng.Winin.Data;
using Volo.Abp.DependencyInjection;
namespace Faster.Zheng.Winin.EntityFrameworkCore;
public class EntityFrameworkCoreWininDbSchemaMigrator
: IWininDbSchemaMigrator, ITransientDependency
{
private readonly IServiceProvider _serviceProvider;
public EntityFrameworkCoreWininDbSchemaMigrator(
IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
}
public async Task MigrateAsync()
{
/* We intentionally resolving the WininDbContext
* from IServiceProvider (instead of directly injecting it)
* to properly get the connection string of the current tenant in the
* current scope.
*/
await _serviceProvider
.GetRequiredService<WininDbContext>()
.Database
.MigrateAsync();
}
}

86
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/EntityFrameworkCore/WininDbContext.cs

@ -0,0 +1,86 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.BackgroundJobs.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.FeatureManagement.EntityFrameworkCore;
using Volo.Abp.Identity;
using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.OpenIddict.EntityFrameworkCore;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.SettingManagement.EntityFrameworkCore;
using Volo.Abp.TenantManagement;
using Volo.Abp.TenantManagement.EntityFrameworkCore;
namespace Faster.Zheng.Winin.EntityFrameworkCore;
[ReplaceDbContext(typeof(IIdentityDbContext))]
[ReplaceDbContext(typeof(ITenantManagementDbContext))]
[ConnectionStringName("Default")]
public class WininDbContext :
AbpDbContext<WininDbContext>,
IIdentityDbContext,
ITenantManagementDbContext
{
/* Add DbSet properties for your Aggregate Roots / Entities here. */
#region Entities from the modules
/* Notice: We only implemented IIdentityDbContext and ITenantManagementDbContext
* and replaced them for this DbContext. This allows you to perform JOIN
* queries for the entities of these modules over the repositories easily. You
* typically don't need that for other modules. But, if you need, you can
* implement the DbContext interface of the needed module and use ReplaceDbContext
* attribute just like IIdentityDbContext and ITenantManagementDbContext.
*
* More info: Replacing a DbContext of a module ensures that the related module
* uses this DbContext on runtime. Otherwise, it will use its own DbContext class.
*/
//Identity
public DbSet<IdentityUser> Users { get; set; }
public DbSet<IdentityRole> Roles { get; set; }
public DbSet<IdentityClaimType> ClaimTypes { get; set; }
public DbSet<OrganizationUnit> OrganizationUnits { get; set; }
public DbSet<IdentitySecurityLog> SecurityLogs { get; set; }
public DbSet<IdentityLinkUser> LinkUsers { get; set; }
public DbSet<IdentityUserDelegation> UserDelegations { get; set; }
// Tenant Management
public DbSet<Tenant> Tenants { get; set; }
public DbSet<TenantConnectionString> TenantConnectionStrings { get; set; }
#endregion
public WininDbContext(DbContextOptions<WininDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
/* Include modules to your migration db context */
builder.ConfigurePermissionManagement();
builder.ConfigureSettingManagement();
builder.ConfigureBackgroundJobs();
builder.ConfigureAuditLogging();
builder.ConfigureIdentity();
builder.ConfigureOpenIddict();
builder.ConfigureFeatureManagement();
builder.ConfigureTenantManagement();
/* Configure your own tables/entities inside here */
//builder.Entity<YourEntity>(b =>
//{
// b.ToTable(WininConsts.DbTablePrefix + "YourEntities", WininConsts.DbSchema);
// b.ConfigureByConvention(); //auto configure for the base class props
// //...
//});
}
}

33
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/EntityFrameworkCore/WininDbContextFactory.cs

@ -0,0 +1,33 @@
using System;
using System.IO;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.Extensions.Configuration;
namespace Faster.Zheng.Winin.EntityFrameworkCore;
/* This class is needed for EF Core console commands
* (like Add-Migration and Update-Database commands) */
public class WininDbContextFactory : IDesignTimeDbContextFactory<WininDbContext>
{
public WininDbContext CreateDbContext(string[] args)
{
WininEfCoreEntityExtensionMappings.Configure();
var configuration = BuildConfiguration();
var builder = new DbContextOptionsBuilder<WininDbContext>()
.UseSqlServer(configuration.GetConnectionString("Default"));
return new WininDbContext(builder.Options);
}
private static IConfigurationRoot BuildConfiguration()
{
var builder = new ConfigurationBuilder()
.SetBasePath(Path.Combine(Directory.GetCurrentDirectory(), "../Faster.Zheng.Winin.DbMigrator/"))
.AddJsonFile("appsettings.json", optional: false);
return builder.Build();
}
}

44
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/EntityFrameworkCore/WininEfCoreEntityExtensionMappings.cs

@ -0,0 +1,44 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Identity;
using Volo.Abp.ObjectExtending;
using Volo.Abp.Threading;
namespace Faster.Zheng.Winin.EntityFrameworkCore;
public static class WininEfCoreEntityExtensionMappings
{
private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner();
public static void Configure()
{
WininGlobalFeatureConfigurator.Configure();
WininModuleExtensionConfigurator.Configure();
OneTimeRunner.Run(() =>
{
/* You can configure extra properties for the
* entities defined in the modules used by your application.
*
* This class can be used to map these extra properties to table fields in the database.
*
* USE THIS CLASS ONLY TO CONFIGURE EF CORE RELATED MAPPING.
* USE WininModuleExtensionConfigurator CLASS (in the Domain.Shared project)
* FOR A HIGH LEVEL API TO DEFINE EXTRA PROPERTIES TO ENTITIES OF THE USED MODULES
*
* Example: Map a property to a table field:
ObjectExtensionManager.Instance
.MapEfCoreProperty<IdentityUser, string>(
"MyProperty",
(entityBuilder, propertyBuilder) =>
{
propertyBuilder.HasMaxLength(128);
}
);
* See the documentation for more:
* https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities
*/
});
}
}

54
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/EntityFrameworkCore/WininEntityFrameworkCoreModule.cs

@ -0,0 +1,54 @@
using System;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Uow;
using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.BackgroundJobs.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.SqlServer;
using Volo.Abp.FeatureManagement.EntityFrameworkCore;
using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.Modularity;
using Volo.Abp.OpenIddict.EntityFrameworkCore;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.SettingManagement.EntityFrameworkCore;
using Volo.Abp.TenantManagement.EntityFrameworkCore;
namespace Faster.Zheng.Winin.EntityFrameworkCore;
[DependsOn(
typeof(WininDomainModule),
typeof(AbpIdentityEntityFrameworkCoreModule),
typeof(AbpOpenIddictEntityFrameworkCoreModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpEntityFrameworkCoreSqlServerModule),
typeof(AbpBackgroundJobsEntityFrameworkCoreModule),
typeof(AbpAuditLoggingEntityFrameworkCoreModule),
typeof(AbpTenantManagementEntityFrameworkCoreModule),
typeof(AbpFeatureManagementEntityFrameworkCoreModule)
)]
public class WininEntityFrameworkCoreModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
WininEfCoreEntityExtensionMappings.Configure();
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAbpDbContext<WininDbContext>(options =>
{
/* Remove "includeAllEntities: true" to create
* default repositories only for aggregate roots */
options.AddDefaultRepositories(includeAllEntities: true);
});
Configure<AbpDbContextOptions>(options =>
{
/* The main point to change your DBMS.
* See also WininMigrationsDbContextFactory for EF Core tooling. */
options.UseSqlServer();
});
}
}

31
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/Faster.Zheng.Winin.EntityFrameworkCore.csproj

@ -0,0 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<RootNamespace>Faster.Zheng.Winin</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Faster.Zheng.Winin.Domain\Faster.Zheng.Winin.Domain.csproj" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="7.2.1" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="7.2.1" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="7.2.1" />
<PackageReference Include="Volo.Abp.Identity.EntityFrameworkCore" Version="7.2.1" />
<PackageReference Include="Volo.Abp.BackgroundJobs.EntityFrameworkCore" Version="7.2.1" />
<PackageReference Include="Volo.Abp.AuditLogging.EntityFrameworkCore" Version="7.2.1" />
<PackageReference Include="Volo.Abp.TenantManagement.EntityFrameworkCore" Version="7.2.1" />
<PackageReference Include="Volo.Abp.FeatureManagement.EntityFrameworkCore" Version="7.2.1" />
<PackageReference Include="Volo.Abp.OpenIddict.EntityFrameworkCore" Version="7.2.1" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>

1870
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/Migrations/20230614050503_Initial.Designer.cs

File diff suppressed because it is too large

1084
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/Migrations/20230614050503_Initial.cs

File diff suppressed because it is too large

1867
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/Migrations/WininDbContextModelSnapshot.cs

File diff suppressed because it is too large

2
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.EntityFrameworkCore/Properties/AssemblyInfo.cs

@ -0,0 +1,2 @@
using System.Runtime.CompilerServices;
[assembly:InternalsVisibleToAttribute("Faster.Zheng.Winin.EntityFrameworkCore.Tests")]

29
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.HttpApi.Client/Faster.Zheng.Winin.HttpApi.Client.csproj

@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Nullable>enable</Nullable>
<RootNamespace>Faster.Zheng.Winin</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Faster.Zheng.Winin.Application.Contracts\Faster.Zheng.Winin.Application.Contracts.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Account.HttpApi.Client" Version="7.2.1" />
<PackageReference Include="Volo.Abp.Identity.HttpApi.Client" Version="7.2.1" />
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi.Client" Version="7.2.1" />
<PackageReference Include="Volo.Abp.TenantManagement.HttpApi.Client" Version="7.2.1" />
<PackageReference Include="Volo.Abp.FeatureManagement.HttpApi.Client" Version="7.2.1" />
<PackageReference Include="Volo.Abp.SettingManagement.HttpApi.Client" Version="7.2.1" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="**\*generate-proxy.json" />
<Content Remove="**\*generate-proxy.json" />
</ItemGroup>
</Project>

38
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.HttpApi.Client/WininHttpApiClientModule.cs

@ -0,0 +1,38 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Account;
using Volo.Abp.FeatureManagement;
using Volo.Abp.Identity;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement;
using Volo.Abp.TenantManagement;
using Volo.Abp.SettingManagement;
using Volo.Abp.VirtualFileSystem;
namespace Faster.Zheng.Winin;
[DependsOn(
typeof(WininApplicationContractsModule),
typeof(AbpAccountHttpApiClientModule),
typeof(AbpIdentityHttpApiClientModule),
typeof(AbpPermissionManagementHttpApiClientModule),
typeof(AbpTenantManagementHttpApiClientModule),
typeof(AbpFeatureManagementHttpApiClientModule),
typeof(AbpSettingManagementHttpApiClientModule)
)]
public class WininHttpApiClientModule : AbpModule
{
public const string RemoteServiceName = "Default";
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddHttpClientProxies(
typeof(WininApplicationContractsModule).Assembly,
RemoteServiceName
);
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<WininHttpApiClientModule>();
});
}
}

14
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.HttpApi/Controllers/WininController.cs

@ -0,0 +1,14 @@
using Faster.Zheng.Winin.Localization;
using Volo.Abp.AspNetCore.Mvc;
namespace Faster.Zheng.Winin.Controllers;
/* Inherit your controllers from this class.
*/
public abstract class WininController : AbpControllerBase
{
protected WininController()
{
LocalizationResource = typeof(WininResource);
}
}

24
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.HttpApi/Faster.Zheng.Winin.HttpApi.csproj

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<RootNamespace>Faster.Zheng.Winin</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Faster.Zheng.Winin.Application.Contracts\Faster.Zheng.Winin.Application.Contracts.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Account.HttpApi" Version="7.2.1" />
<PackageReference Include="Volo.Abp.Identity.HttpApi" Version="7.2.1" />
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi" Version="7.2.1" />
<PackageReference Include="Volo.Abp.TenantManagement.HttpApi" Version="7.2.1" />
<PackageReference Include="Volo.Abp.FeatureManagement.HttpApi" Version="7.2.1" />
<PackageReference Include="Volo.Abp.SettingManagement.HttpApi" Version="7.2.1" />
</ItemGroup>
</Project>

10
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.HttpApi/Models/Test/TestModel.cs

@ -0,0 +1,10 @@
using System;
namespace Faster.Zheng.Winin.Models.Test;
public class TestModel
{
public string Name { get; set; }
public DateTime BirthDate { get; set; }
}

41
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.HttpApi/WininHttpApiModule.cs

@ -0,0 +1,41 @@
using Localization.Resources.AbpUi;
using Faster.Zheng.Winin.Localization;
using Volo.Abp.Account;
using Volo.Abp.FeatureManagement;
using Volo.Abp.Identity;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement.HttpApi;
using Volo.Abp.SettingManagement;
using Volo.Abp.TenantManagement;
namespace Faster.Zheng.Winin;
[DependsOn(
typeof(WininApplicationContractsModule),
typeof(AbpAccountHttpApiModule),
typeof(AbpIdentityHttpApiModule),
typeof(AbpPermissionManagementHttpApiModule),
typeof(AbpTenantManagementHttpApiModule),
typeof(AbpFeatureManagementHttpApiModule),
typeof(AbpSettingManagementHttpApiModule)
)]
public class WininHttpApiModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
ConfigureLocalization();
}
private void ConfigureLocalization()
{
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<WininResource>()
.AddBaseTypes(
typeof(AbpUiResource)
);
});
}
}

4
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Components/_ViewImports.cshtml

@ -0,0 +1,4 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling

56
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Faster.Zheng.Winin.Web.csproj

@ -0,0 +1,56 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<RootNamespace>Faster.Zheng.Winin.Web</RootNamespace>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>
<PreserveCompilationReferences>true</PreserveCompilationReferences>
<UserSecretsId>Faster.Zheng.Winin-4681b4fd-151f-4221-84a4-929d86723e4c</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Logs\**" />
<Content Remove="Logs\**" />
<EmbeddedResource Remove="Logs\**" />
<None Remove="Logs\**" />
</ItemGroup>
<ItemGroup>
<None Update="Pages\**\*.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Pages\**\*.css">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite" Version="2.2.*-*" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Faster.Zheng.Winin.Application\Faster.Zheng.Winin.Application.csproj" />
<ProjectReference Include="..\Faster.Zheng.Winin.HttpApi\Faster.Zheng.Winin.HttpApi.csproj" />
<ProjectReference Include="..\Faster.Zheng.Winin.EntityFrameworkCore\Faster.Zheng.Winin.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.Autofac" Version="7.2.1" />
<PackageReference Include="Volo.Abp.Swashbuckle" Version="7.2.1" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" Version="7.2.1" />
<PackageReference Include="Volo.Abp.Identity.Web" Version="7.2.1" />
<PackageReference Include="Volo.Abp.Account.Web.OpenIddict" Version="7.2.1" />
<PackageReference Include="Volo.Abp.TenantManagement.Web" Version="7.2.1" />
<PackageReference Include="Volo.Abp.SettingManagement.Web" Version="7.2.1" />
</ItemGroup>
</Project>

51
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Menus/WininMenuContributor.cs

@ -0,0 +1,51 @@
using System.Threading.Tasks;
using Faster.Zheng.Winin.Localization;
using Faster.Zheng.Winin.MultiTenancy;
using Volo.Abp.Identity.Web.Navigation;
using Volo.Abp.SettingManagement.Web.Navigation;
using Volo.Abp.TenantManagement.Web.Navigation;
using Volo.Abp.UI.Navigation;
namespace Faster.Zheng.Winin.Web.Menus;
public class WininMenuContributor : IMenuContributor
{
public async Task ConfigureMenuAsync(MenuConfigurationContext context)
{
if (context.Menu.Name == StandardMenus.Main)
{
await ConfigureMainMenuAsync(context);
}
}
private Task ConfigureMainMenuAsync(MenuConfigurationContext context)
{
var administration = context.Menu.GetAdministration();
var l = context.GetLocalizer<WininResource>();
context.Menu.Items.Insert(
0,
new ApplicationMenuItem(
WininMenus.Home,
l["Menu:Home"],
"~/",
icon: "fas fa-home",
order: 0
)
);
if (MultiTenancyConsts.IsEnabled)
{
administration.SetSubItemOrder(TenantManagementMenuNames.GroupName, 1);
}
else
{
administration.TryRemoveMenuItem(TenantManagementMenuNames.GroupName);
}
administration.SetSubItemOrder(IdentityMenuNames.GroupName, 2);
administration.SetSubItemOrder(SettingManagementMenuNames.GroupName, 3);
return Task.CompletedTask;
}
}

10
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Menus/WininMenus.cs

@ -0,0 +1,10 @@
namespace Faster.Zheng.Winin.Web.Menus;
public class WininMenus
{
private const string Prefix = "Winin";
public const string Home = Prefix + ".Home";
//Add your menu items here...
}

187
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/Index.cshtml

@ -0,0 +1,187 @@
@page
@using Microsoft.AspNetCore.Mvc.Localization
@using Faster.Zheng.Winin.Localization
@using Volo.Abp.Users
@model Faster.Zheng.Winin.Web.Pages.IndexModel
@inject IHtmlLocalizer<WininResource> L
@inject ICurrentUser CurrentUser
@section styles {
<abp-style src="/Pages/Index.css" />
}
@section scripts {
<abp-script src="/Pages/Index.js" />
}
<div class="container">
<div class="p-5 text-center">
<div class="d-inline-block bg-success text-white p-1 h5 rounded mb-4 " role="alert">
<h5 class="m-1"> <i class="fas fa-rocket"></i> Congratulations, <strong>Winin</strong> is successfully running!</h5>
</div>
<h1>Welcome to the Application</h1>
<p class="lead px-lg-5 mx-lg-5">@L["LongWelcomeMessage"]</p>
@if (!CurrentUser.IsAuthenticated)
{
<a abp-button="Primary" href="~/Account/Login"><i class="fa fa-sign-in"></i> @L["Login"]</a>
}
</div>
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-auto text-center">
<img src="https://abp.io/assets/png/mastering-abp-framework.webp" style="max-width: 400px;" class="w-100 mb-5 my-md-3">
</div>
<div class="col-md d-flex align-items-center">
<div class="pe-0 pe-md-4">
<small class="text-uppercase text-muted">THE OFFICIAL GUIDE</small>
<h2 class="mb-4">Mastering ABP Framework</h2>
<p class="mb-4">Written by the creator of the ABP Framework, this book will help you gain a complete understanding of the framework and modern web application development techniques.</p>
<div class="mb-4">
<a href="https://www.amazon.com/gp/product/B097Z2DM8Q/ref=dbs_a_def_rwt_hsch_vapi_tkin_p1_i0" class="btn btn-success mb-1">
Buy on Amazon US
</a>
<a href="https://www.packtpub.com/product/mastering-abp-framework/9781801079242" class="btn btn-primary mb-1">
Buy on PACKT
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="my-3 text-center">
<h3>Let's improve your application!</h3>
<p>Here are some links to help you get started:</p>
</div>
<div class="card mt-4 mb-5">
<div class="card-body">
<div class="row text-center justify-content-md-center">
<div class="col-lg-4">
<div class="p-4">
<h5 class="mb-3"><i class="fas fa-book text-secondary d-block my-3 fa-2x"></i> Learn the ABP Framework</h5>
<p>Explore the compherensive documentation to learn how to build a modern web application.</p>
<a href="https://docs.abp.io/en/abp/latest?ref=tmpl" target="_blank" class="btn btn-link px-1">See Documents <i class="fas fa-chevron-right"></i></a>
</div>
</div>
<div class="col-lg-4 border-start">
<div class="p-4">
<h5 class="mb-3"><i class="fas fa-cubes text-secondary d-block my-3 fa-2x"></i> Samples</h5>
<p>See the example projects built with the ABP Framework.</p>
<a href="https://docs.abp.io/en/abp/latest/Samples/Index?ref=tmpl" target="_blank" class="btn btn-link px-1">All samples <i class="fas fa-chevron-right"></i></a>
</div>
</div>
<div class="col-lg-4 border-start">
<div class="p-4">
<h5 class="mb-3"><i class="fas fa-users text-secondary d-block my-3 fa-2x"></i> ABP Community</h5>
<p>Get involved with a vibrant community and become a contributor.</p>
<a href="https://community.abp.io/" target="_blank" class="btn btn-link px-1">Community <i class="fas fa-chevron-right"></i></a>
<a href="https://docs.abp.io/en/abp/latest/Contribution/Index?ref=tmpl" target="_blank" class="btn btn-link px-1">Contribute <i class="fas fa-chevron-right"></i></a>
</div>
</div>
</div>
<div class="row text-center mt-lg-3 justify-content-md-center">
<div class="col-lg-4">
<div class="p-4">
<h5 class="mb-3"><i class="fas fa-pen-nib text-secondary d-block my-3 fa-2x"></i> ABP Blog</h5>
<p>Take a look at our recently published articles.</p>
<a href="https://blog.abp.io/abp?ref=tmpl" target="_blank" class="btn btn-link px-1">See Blog <i class="fas fa-chevron-right"></i></a>
</div>
</div>
<div class="col-lg-4 border-start">
<div class="p-4">
<h5 class="mb-3"><i class="fab fa-github text-secondary d-block my-3 fa-2x"></i> Github</h5>
<p>Do you love the ABP Framework? Please <strong>give a star</strong> to support it!</p>
<p class="mb-1">
<a class="github-button" href="https://github.com/abpframework/abp" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star abpframework/abp on GitHub">Star</a>
<a class="github-button" href="https://github.com/abpframework/abp/issues" data-icon="octicon-issue-opened" data-size="large" data-show-count="false" aria-label="Issue abpframework/abp on GitHub">Issue</a>
<a class="github-button" href="https://github.com/abpframework/abp/fork" data-icon="octicon-repo-forked" data-size="large" data-show-count="false" aria-label="Fork abpframework/abp on GitHub">Fork</a>
</p>
<a href="https://github.com/abpframework/abp/issues/new?template=feature.md" target="_blank" class="btn btn-link px-1">Request a feature <i class="fas fa-chevron-right"></i></a>
<script async defer src="https://buttons.github.io/buttons.js"></script>
</div>
</div>
<div class="col-lg-4 border-start">
<div class="p-4">
<h5 class="mb-3"><i class="fab fa-stack-overflow text-secondary d-block my-3 fa-2x"></i> Stackoverflow</h5>
<p>See answers to previously asked questions or ask a new one.</p>
<a href="https://stackoverflow.com/questions/tagged/abp" target="_blank" class="btn btn-link px-1">Questions <i class="fas fa-chevron-right"></i></a>
<a href="https://stackoverflow.com/questions/ask" target="_blank" class="btn btn-link px-1">Ask a Question <i class="fas fa-chevron-right"></i></a>
</div>
</div>
</div>
</div>
</div>
<div class="mt-5 my-3 text-center">
<h3>Meet the ABP Commercial</h3>
<p>A Complete Web Application Platform Built on the ABP Framework</p>
</div>
<div class="card mt-4 mb-5">
<div class="card-body">
<p class="px-lg-5 mx-lg-5 py-3 text-center">
<a href="https://commercial.abp.io/" target="_blank">ABP Commercial</a> is a platform based on the open source ABP framework. It provides pre-built application modules,
rapid application development tooling, professional UI themes, premium support and more.
</p>
<div class="row text-center justify-content-md-center">
<div class="col-lg-2">
<div class="p-3">
<h6>
<i class="fas fa-plus d-block mb-3 fa- 2x text-secondary"></i> Startup Templates
<a href="https://commercial.abp.io/startup-templates?ref=tmpl" target="_blank" class="d-block mt-2 btn btn-sm btn-link">Details <i class="fas fa-chevron-right"></i></a>
</h6>
</div>
</div>
<div class="col-lg-2 border-start">
<div class="p-3">
<h6>
<i class="fas fa-plus d-block mb-3 fa- 2x text-secondary"></i> Application Modules
<a href="https://commercial.abp.io/modules?ref=tmpl" target="_blank" class="d-block mt-2 btn btn-sm btn-link">Details <i class="fas fa-chevron-right"></i></a>
</h6>
</div>
</div>
<div class="col-lg-2 border-start">
<div class="p-3">
<h6>
<i class="fas fa-plus d-block mb-3 fa- 2x text-secondary"></i> Developer<br />Tools
<a href="https://commercial.abp.io/tools?ref=tmpl" target="_blank" class="d-block mt-2 btn btn-sm btn-link">Details <i class="fas fa-chevron-right"></i></a>
</h6>
</div>
</div>
<div class="col-lg-2 border-start">
<div class="p-3">
<h6>
<i class="fas fa-plus d-block mb-3 fa- 2x text-secondary"></i> UI<br /> Themes
<a href="https://commercial.abp.io/themes?ref=tmpl" target="_blank" class="d-block mt-2 btn btn-sm btn-link">Details <i class="fas fa-chevron-right"></i></a>
</h6>
</div>
</div>
<div class="col-lg-2 border-start">
<div class="p-3">
<h6>
<i class="fas fa-plus d-block mb-3 fa- 2x text-secondary"></i> Premium Support
<a href="https://support.abp.io/QA/Questions?ref=tmpl" target="_blank" class="d-block mt-2 btn btn-sm btn-link">Details <i class="fas fa-chevron-right"></i></a>
</h6>
</div>
</div>
<div class="col-lg-2 border-start">
<div class="p-3">
<h6>
<i class="fas fa-plus d-block mb-3 fa- 2x text-secondary"></i> Additional Services
<a href="https://commercial.abp.io/additional-services?ref=tmpl" target="_blank" class="d-block mt-2 btn btn-sm btn-link">Details <i class="fas fa-chevron-right"></i></a>
</h6>
</div>
</div>
</div>
</div>
</div>
<div class="mb-5 text-center">
<p class="align-middle">
<a href="https://twitter.com/abpframework" target="_blank" class="mx-2"><i class="fa fa-twitter"></i><span class="text-secondary"> Abp Framework</span></a>
<a href="https://twitter.com/abpcommercial" target="_blank" class="mx-2"><i class="fa fa-twitter"></i><span class="text-secondary"> Abp Commercial</span></a>
<a href="https://github.com/abpframework/abp" target="_blank" class="mx-2"><i class="fa fa-github"></i><span class="text-secondary"> abpframework</span></a>
</p>
</div>
</div>

9
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/Index.cshtml.cs

@ -0,0 +1,9 @@
namespace Faster.Zheng.Winin.Web.Pages;
public class IndexModel : WininPageModel
{
public void OnGet()
{
}
}

3
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/Index.css

@ -0,0 +1,3 @@
body {
}

3
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/Index.js

@ -0,0 +1,3 @@
$(function () {
abp.log.debug('Index.js initialized!');
});

14
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/WininPageModel.cs

@ -0,0 +1,14 @@
using Faster.Zheng.Winin.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
namespace Faster.Zheng.Winin.Web.Pages;
/* Inherit your PageModel classes from this class.
*/
public abstract class WininPageModel : AbpPageModel
{
protected WininPageModel()
{
LocalizationResourceType = typeof(WininResource);
}
}

4
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Pages/_ViewImports.cshtml

@ -0,0 +1,4 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling

56
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Program.cs

@ -0,0 +1,56 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Serilog;
using Serilog.Events;
namespace Faster.Zheng.Winin.Web;
public class Program
{
public async static Task<int> Main(string[] args)
{
Log.Logger = new LoggerConfiguration()
#if DEBUG
.MinimumLevel.Debug()
#else
.MinimumLevel.Information()
#endif
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
.WriteTo.Async(c => c.Console())
.CreateLogger();
try
{
Log.Information("Starting web host.");
var builder = WebApplication.CreateBuilder(args);
builder.Host.AddAppSettingsSecretsJson()
.UseAutofac()
.UseSerilog();
await builder.AddApplicationAsync<WininWebModule>();
var app = builder.Build();
await app.InitializeApplicationAsync();
await app.RunAsync();
return 0;
}
catch (Exception ex)
{
if (ex is HostAbortedException)
{
throw;
}
Log.Fatal(ex, "Host terminated unexpectedly!");
return 1;
}
finally
{
Log.CloseAndFlush();
}
}
}

2
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Properties/AssemblyInfo.cs

@ -0,0 +1,2 @@
using System.Runtime.CompilerServices;
[assembly:InternalsVisibleToAttribute("Faster.Zheng.Winin.Web.Tests")]

27
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Properties/launchSettings.json

@ -0,0 +1,27 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "https://localhost:44392/",
"sslPort": 44392
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Faster.Zheng.Winin.Web": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:44392/"
}
}
}

4
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/Views/_ViewImports.cshtml

@ -0,0 +1,4 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling

10
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/WininBrandingProvider.cs

@ -0,0 +1,10 @@
using Volo.Abp.Ui.Branding;
using Volo.Abp.DependencyInjection;
namespace Faster.Zheng.Winin.Web;
[Dependency(ReplaceServices = true)]
public class WininBrandingProvider : DefaultBrandingProvider
{
public override string AppName => "Winin";
}

11
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/WininWebAutoMapperProfile.cs

@ -0,0 +1,11 @@
using AutoMapper;
namespace Faster.Zheng.Winin.Web;
public class WininWebAutoMapperProfile : Profile
{
public WininWebAutoMapperProfile()
{
//Define your AutoMapper configuration here for the Web project.
}
}

215
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/WininWebModule.cs

@ -0,0 +1,215 @@
using System.IO;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Faster.Zheng.Winin.EntityFrameworkCore;
using Faster.Zheng.Winin.Localization;
using Faster.Zheng.Winin.MultiTenancy;
using Faster.Zheng.Winin.Web.Menus;
using Microsoft.OpenApi.Models;
using OpenIddict.Validation.AspNetCore;
using Volo.Abp;
using Volo.Abp.Account.Web;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.Autofac;
using Volo.Abp.AutoMapper;
using Volo.Abp.FeatureManagement;
using Volo.Abp.Identity.Web;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement.Web;
using Volo.Abp.SettingManagement.Web;
using Volo.Abp.Swashbuckle;
using Volo.Abp.TenantManagement.Web;
using Volo.Abp.UI.Navigation.Urls;
using Volo.Abp.UI;
using Volo.Abp.UI.Navigation;
using Volo.Abp.VirtualFileSystem;
namespace Faster.Zheng.Winin.Web;
[DependsOn(
typeof(WininHttpApiModule),
typeof(WininApplicationModule),
typeof(WininEntityFrameworkCoreModule),
typeof(AbpAutofacModule),
typeof(AbpIdentityWebModule),
typeof(AbpSettingManagementWebModule),
typeof(AbpAccountWebOpenIddictModule),
typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule),
typeof(AbpTenantManagementWebModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpSwashbuckleModule)
)]
public class WininWebModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
context.Services.PreConfigure<AbpMvcDataAnnotationsLocalizationOptions>(options =>
{
options.AddAssemblyResource(
typeof(WininResource),
typeof(WininDomainModule).Assembly,
typeof(WininDomainSharedModule).Assembly,
typeof(WininApplicationModule).Assembly,
typeof(WininApplicationContractsModule).Assembly,
typeof(WininWebModule).Assembly
);
});
PreConfigure<OpenIddictBuilder>(builder =>
{
builder.AddValidation(options =>
{
options.AddAudiences("Winin");
options.UseLocalServer();
options.UseAspNetCore();
});
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.GetConfiguration();
ConfigureAuthentication(context);
ConfigureUrls(configuration);
ConfigureBundles();
ConfigureAutoMapper();
ConfigureVirtualFileSystem(hostingEnvironment);
ConfigureNavigationServices();
ConfigureAutoApiControllers();
ConfigureSwaggerServices(context.Services);
}
private void ConfigureAuthentication(ServiceConfigurationContext context)
{
context.Services.ForwardIdentityAuthenticationForBearer(OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme);
}
private void ConfigureUrls(IConfiguration configuration)
{
Configure<AppUrlOptions>(options =>
{
options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"];
});
}
private void ConfigureBundles()
{
Configure<AbpBundlingOptions>(options =>
{
options.StyleBundles.Configure(
LeptonXLiteThemeBundles.Styles.Global,
bundle =>
{
bundle.AddFiles("/global-styles.css");
}
);
});
}
private void ConfigureAutoMapper()
{
Configure<AbpAutoMapperOptions>(options =>
{
options.AddMaps<WininWebModule>();
});
}
private void ConfigureVirtualFileSystem(IWebHostEnvironment hostingEnvironment)
{
if (hostingEnvironment.IsDevelopment())
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.ReplaceEmbeddedByPhysical<WininDomainSharedModule>(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}Faster.Zheng.Winin.Domain.Shared"));
options.FileSets.ReplaceEmbeddedByPhysical<WininDomainModule>(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}Faster.Zheng.Winin.Domain"));
options.FileSets.ReplaceEmbeddedByPhysical<WininApplicationContractsModule>(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}Faster.Zheng.Winin.Application.Contracts"));
options.FileSets.ReplaceEmbeddedByPhysical<WininApplicationModule>(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}Faster.Zheng.Winin.Application"));
options.FileSets.ReplaceEmbeddedByPhysical<WininWebModule>(hostingEnvironment.ContentRootPath);
});
}
}
private void ConfigureNavigationServices()
{
Configure<AbpNavigationOptions>(options =>
{
options.MenuContributors.Add(new WininMenuContributor());
});
}
private void ConfigureAutoApiControllers()
{
Configure<AbpAspNetCoreMvcOptions>(options =>
{
options.ConventionalControllers.Create(typeof(WininApplicationModule).Assembly);
});
}
private void ConfigureSwaggerServices(IServiceCollection services)
{
services.AddAbpSwaggerGen(
options =>
{
options.SwaggerDoc("v1", new OpenApiInfo { Title = "Winin API", Version = "v1" });
options.DocInclusionPredicate((docName, description) => true);
options.CustomSchemaIds(type => type.FullName);
}
);
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseAbpRequestLocalization();
if (!env.IsDevelopment())
{
app.UseErrorPage();
}
app.UseCorrelationId();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAbpOpenIddictValidation();
if (MultiTenancyConsts.IsEnabled)
{
app.UseMultiTenancy();
}
app.UseUnitOfWork();
app.UseAuthorization();
app.UseSwagger();
app.UseAbpSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Winin API");
});
app.UseAuditing();
app.UseAbpSerilogEnrichers();
app.UseConfiguredEndpoints();
}
}

11
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/abp.resourcemapping.js

@ -0,0 +1,11 @@
module.exports = {
aliases: {
},
clean: [
],
mappings: {
}
};

2
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/appsettings.Development.json

@ -0,0 +1,2 @@
{
}

11
Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/appsettings.json

@ -0,0 +1,11 @@
{
"App": {
"SelfUrl": "https://localhost:44392"
},
"ConnectionStrings": {
"Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=Winin;Trusted_Connection=True;TrustServerCertificate=True"
},
"StringEncryption": {
"DefaultPassPhrase": "Aj66rJI3krHbVhS6"
}
}

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

Loading…
Cancel
Save