Repository: yupingyong/kite.gateway Branch: master Commit: 9f31083395a2 Files: 224 Total size: 414.1 KB Directory structure: gitextract_jlijv6d0/ ├── .dockerignore ├── .gitignore ├── Kite.Gateway.sln ├── README.en.md ├── README.md ├── admin/ │ └── Kite.Gateway.Admin/ │ ├── .config/ │ │ └── dotnet-tools.json │ ├── App.razor │ ├── Controllers/ │ │ └── RefreshController.cs │ ├── Core/ │ │ └── AuthorizationServerStorage.cs │ ├── Dockerfile │ ├── GatewayAdminModule.cs │ ├── Kite.Gateway.Admin.csproj │ ├── Pages/ │ │ ├── Administrator/ │ │ │ ├── Administrator.razor │ │ │ ├── Login.razor │ │ │ ├── Login.razor.css │ │ │ ├── Logout.razor │ │ │ ├── Logout.razor.css │ │ │ ├── NewAdministrator.razor │ │ │ └── UpdateAdministrator.razor │ │ ├── Authorization/ │ │ │ └── Authentication.razor │ │ ├── Error.cshtml │ │ ├── Error.cshtml.cs │ │ ├── Home.razor │ │ ├── Middleware/ │ │ │ ├── Middleware.razor │ │ │ ├── NewMiddleware.razor │ │ │ └── UpdateMiddleware.razor │ │ ├── Node/ │ │ │ ├── NewNode.razor │ │ │ ├── Node.razor │ │ │ ├── RefreshConfigure.razor │ │ │ └── UpdateNode.razor │ │ ├── PaginationComponent.razor │ │ ├── ServiceGovernance/ │ │ │ └── ServiceGovernance.razor │ │ ├── Whitelist/ │ │ │ ├── NewWhitelist.razor │ │ │ ├── UpdateWhitelist.razor │ │ │ └── WhiteList.razor │ │ ├── Yarp/ │ │ │ ├── NewRoute.razor │ │ │ ├── Route.razor │ │ │ └── UpdateRoute.razor │ │ ├── _Host.cshtml │ │ └── _Layout.cshtml │ ├── Program.cs │ ├── Properties/ │ │ └── launchSettings.json │ ├── Shared/ │ │ ├── MainLayout.razor │ │ ├── MainLayout.razor.cs │ │ ├── MainLayout.razor.css │ │ └── SimpleLayout.razor │ ├── _Imports.razor │ ├── appsettings.json │ └── wwwroot/ │ └── css/ │ ├── open-iconic/ │ │ ├── FONT-LICENSE │ │ ├── ICON-LICENSE │ │ ├── README.md │ │ └── font/ │ │ └── fonts/ │ │ └── open-iconic.otf │ ├── signin.css │ └── site.css ├── simples/ │ ├── Kite.Simple.Account/ │ │ ├── Authorization/ │ │ │ ├── ClaimModel.cs │ │ │ ├── IJwtTokenManager.cs │ │ │ ├── JwtTokenAuthenticateResult.cs │ │ │ ├── JwtTokenManager.cs │ │ │ ├── JwtTokenOptions.cs │ │ │ └── JwtTokenResult.cs │ │ ├── Controllers/ │ │ │ ├── AccountController.cs │ │ │ ├── LoginController.cs │ │ │ ├── MiddlewareController.cs │ │ │ └── WeatherForecastController.cs │ │ ├── Kite.Simple.Account.csproj │ │ ├── Models/ │ │ │ ├── AccountLoginDto.cs │ │ │ ├── AccountLoginResultDto.cs │ │ │ └── CreateAccountDto.cs │ │ ├── Program.cs │ │ ├── Properties/ │ │ │ └── launchSettings.json │ │ ├── WeatherForecast.cs │ │ └── appsettings.json │ ├── Kite.Simple.Order/ │ │ ├── Controllers/ │ │ │ ├── OrderController.cs │ │ │ └── WeatherForecastController.cs │ │ ├── Kite.Simple.Order.csproj │ │ ├── Models/ │ │ │ └── CreateOrderDto.cs │ │ ├── Program.cs │ │ ├── Properties/ │ │ │ └── launchSettings.json │ │ ├── WeatherForecast.cs │ │ └── appsettings.json │ └── Kite.SimpleServices.sln └── src/ ├── Kite.Gateway.Application/ │ ├── AdministratorAppService.cs │ ├── ApplicationModule.cs │ ├── AuthorizationAppService.cs │ ├── BaseApplicationService.cs │ ├── ConfigureAppService.cs │ ├── Kite.Gateway.Application.csproj │ ├── MiddlewareAppService.cs │ ├── NodeAppService.cs │ ├── RefreshAppService.cs │ ├── RouteAppService.cs │ ├── ServiceGovernanceAppService.cs │ └── WhitelistAppService.cs ├── Kite.Gateway.Application.Contracts/ │ ├── ApplicationContractsModule.cs │ ├── Dtos/ │ │ ├── Administrator/ │ │ │ ├── AdministratorDto.cs │ │ │ ├── CreateAdministratorDto.cs │ │ │ ├── LoginAdministratorDto.cs │ │ │ └── UpdateAdministratorDto.cs │ │ ├── Authorization/ │ │ │ └── SaveAuthenticationDto.cs │ │ ├── Middleware/ │ │ │ ├── CreateMiddlewareDto.cs │ │ │ ├── MiddlewareDto.cs │ │ │ ├── MiddlewareListDto.cs │ │ │ └── UpdateMiddlewareDto.cs │ │ ├── Node/ │ │ │ ├── CreateNodeDto.cs │ │ │ ├── NodeDto.cs │ │ │ ├── ReloadConfigureDto.cs │ │ │ └── UpdateNodeDto.cs │ │ ├── RefreshConfigureDto.cs │ │ ├── ReverseProxy/ │ │ │ ├── ClusterDestinationDto.cs │ │ │ ├── ClusterDto.cs │ │ │ ├── ClusterHealthCheckDto.cs │ │ │ ├── CreateRouteDto.cs │ │ │ ├── RouteDto.cs │ │ │ ├── RouteMainDto.cs │ │ │ ├── RoutePageDto.cs │ │ │ ├── RouteTransformDto.cs │ │ │ └── UpdateRouteDto.cs │ │ ├── ServiceGovernance/ │ │ │ └── ServiceGovernanceConfigureDto.cs │ │ ├── ValidateTokenDto.cs │ │ └── Whitelist/ │ │ ├── CreateWhitelistDto.cs │ │ ├── UpdateWhitelistDto.cs │ │ └── WhitelistDto.cs │ ├── Http/ │ │ └── SimpleHttpException.cs │ ├── IAdministratorAppService.cs │ ├── IAuthorizationAppService.cs │ ├── IConfigureAppService.cs │ ├── IMiddlewareAppService.cs │ ├── INodeAppService.cs │ ├── IRefreshAppService.cs │ ├── IRouteAppService.cs │ ├── IServiceGovernanceAppService.cs │ ├── IWhitelistAppService.cs │ ├── Kite.Gateway.Application.Contracts.csproj │ ├── KitePageResult.cs │ └── KiteResult.cs ├── Kite.Gateway.Domain/ │ ├── Administrator/ │ │ ├── AdministratorManager.cs │ │ └── IAdministratorManager.cs │ ├── Authorization/ │ │ ├── AuthenticationManager.cs │ │ ├── ClaimModel.cs │ │ ├── IAuthenticationManager.cs │ │ ├── IJwtTokenManager.cs │ │ ├── JwtTokenManager.cs │ │ ├── JwtTokenOptions.cs │ │ └── JwtTokenValidationResult.cs │ ├── ConfigureManager.cs │ ├── DomainModule.cs │ ├── Entities/ │ │ ├── Administrator.cs │ │ ├── AuthenticationConfigure.cs │ │ ├── Cluster.cs │ │ ├── ClusterDestination.cs │ │ ├── ClusterHealthCheck.cs │ │ ├── Middleware.cs │ │ ├── Node.cs │ │ ├── Route.cs │ │ ├── RouteTransform.cs │ │ ├── ServiceGovernanceConfigure.cs │ │ └── Whitelist.cs │ ├── IConfigureManager.cs │ ├── Kite.Gateway.Domain.csproj │ ├── Middlewares/ │ │ ├── IMiddlewareContext.cs │ │ ├── IMiddlewareManager.cs │ │ ├── MiddlewareManager.cs │ │ └── MiddlewareResult.cs │ ├── Node/ │ │ ├── INodeManager.cs │ │ └── NodeManager.cs │ ├── ReverseProxy/ │ │ ├── ClusterManager.cs │ │ ├── GatewayOptions.cs │ │ ├── IClusterManager.cs │ │ ├── IRefreshManager.cs │ │ ├── IReverseProxyDatabaseStore.cs │ │ ├── IRouteManager.cs │ │ ├── IYarpManager.cs │ │ ├── InDatabaseReloadToken.cs │ │ ├── InDatabaseStoreConfig.cs │ │ ├── InDatabaseStoreConfigProvider.cs │ │ ├── InDatabaseStoreReloadToken.cs │ │ ├── Models/ │ │ │ ├── NacosServiceHostModel.cs │ │ │ ├── NacosServiceModel.cs │ │ │ └── ServiceGovernanceModel.cs │ │ ├── RefreshManager.cs │ │ ├── ReverseProxyDatabaseStore.cs │ │ ├── RouteManager.cs │ │ └── YarpManager.cs │ └── Whitelist/ │ ├── IWhiteListManager.cs │ └── WhiteListManager.cs ├── Kite.Gateway.Domain.Shared/ │ ├── DomainSharedModule.cs │ ├── Enums/ │ │ ├── FilterTypeEnum.cs │ │ ├── ServiceGovernanceType.cs │ │ └── SignalTypeEnum.cs │ ├── Kite.Gateway.Domain.Shared.csproj │ ├── Options/ │ │ ├── AuthenticationOption.cs │ │ ├── ClusterDestinationOption.cs │ │ ├── ClusterHealthCheckOption.cs │ │ ├── ClusterOption.cs │ │ ├── KiteGatewayOption.cs │ │ ├── MiddlewareOption.cs │ │ ├── RouteOption.cs │ │ ├── RouteTransformOption.cs │ │ ├── WhitelistOption.cs │ │ └── YarpOption.cs │ └── TextHelper.cs ├── Kite.Gateway.EntityFrameworkCore/ │ ├── EntityFrameworkCoreModule.cs │ ├── Kite.Gateway.EntityFrameworkCore.csproj │ ├── KiteDbContext.cs │ └── Migrations/ │ ├── 20220726095023_Migration_v1.0.0.Designer.cs │ ├── 20220726095023_Migration_v1.0.0.cs │ ├── 20220727061321_Migration_v1.0.1.Designer.cs │ ├── 20220727061321_Migration_v1.0.1.cs │ ├── 20220731131935_Migration_v1.0.2.Designer.cs │ ├── 20220731131935_Migration_v1.0.2.cs │ ├── 20220801073938_Migration_v1.0.3.Designer.cs │ ├── 20220801073938_Migration_v1.0.3.cs │ └── KiteDbContextModelSnapshot.cs └── Kite.Gateway.Web/ ├── Controllers/ │ └── RefreshController.cs ├── Dockerfile ├── Filters/ │ ├── AbpCoreExceptionFilter.cs │ └── KiteCoreActionFilter.cs ├── Kite.Gateway.Web.csproj ├── Middlewares/ │ ├── KiteAuthorizationMiddleware.cs │ └── KiteExternalMiddleware.cs ├── Program.cs ├── Properties/ │ └── launchSettings.json ├── WebModule.cs └── appsettings.json ================================================ FILE CONTENTS ================================================ ================================================ FILE: .dockerignore ================================================ **/.classpath **/.dockerignore **/.env **/.git **/.gitignore **/.project **/.settings **/.toolstarget **/.vs **/.vscode **/*.*proj.user **/*.dbmdl **/*.jfm **/azds.yaml **/bin **/charts **/docker-compose* **/Dockerfile* **/node_modules **/npm-debug.log **/obj **/secrets.dev.yaml **/values.dev.yaml LICENSE README.md ================================================ FILE: .gitignore ================================================ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. # Logs logs/ # User-specific files *.suo *.user *.userosscache *.sln.docstates #屏蔽本地配置文件 appsettings.Development.json # 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/ node_modules/ # 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 # Gateway src/Pterosaur.Gateway.Web/Logs/* src/Pterosaur.Gateway.Web.Host/Logs/* src/Pterosaur.Gateway.IdentityServer/Logs/* src/Pterosaur.Gateway.HttpApi.Host/Logs/* src/Pterosaur.Gateway.HttpApi.Host/Logs/* src/Pterosaur.Gateway.DbMigrator/Logs/* src/Pterosaur.Gateway.Blazor.Server/Logs/* src/Pterosaur.Gateway.Blazor.Server.Tiered/Logs/* ================================================ FILE: Kite.Gateway.sln ================================================  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.1.32328.378 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kite.Gateway.EntityFrameworkCore", "src\Kite.Gateway.EntityFrameworkCore\Kite.Gateway.EntityFrameworkCore.csproj", "{22772D7B-C655-491D-8CED-3DD6961D59F8}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kite.Gateway.Application", "src\Kite.Gateway.Application\Kite.Gateway.Application.csproj", "{FCECED16-7C02-47CC-A325-5D710C9C57D7}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kite.Gateway.Domain", "src\Kite.Gateway.Domain\Kite.Gateway.Domain.csproj", "{28CE009E-4E3D-4F06-9811-9A083637A5DC}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kite.Gateway.Domain.Shared", "src\Kite.Gateway.Domain.Shared\Kite.Gateway.Domain.Shared.csproj", "{C8BF159F-19BC-4E05-BA6C-BD3BB1D4A397}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{CD55B1DC-925D-4B8D-8B43-47AE9A9661BD}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "admin", "admin", "{5DCEB584-F097-4769-8172-4FFBA9E1898D}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kite.Gateway.Application.Contracts", "src\Kite.Gateway.Application.Contracts\Kite.Gateway.Application.Contracts.csproj", "{E50AB14E-6DB5-4DE3-95EA-BECF1ED6AB75}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kite.Gateway.Admin", "admin\Kite.Gateway.Admin\Kite.Gateway.Admin.csproj", "{45989E3A-AFC8-46B2-A4B7-E38D22E8D93A}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kite.Gateway.Web", "src\Kite.Gateway.Web\Kite.Gateway.Web.csproj", "{BA1CBE4F-E321-453F-94D7-F6CE7117851D}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {22772D7B-C655-491D-8CED-3DD6961D59F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {22772D7B-C655-491D-8CED-3DD6961D59F8}.Debug|Any CPU.Build.0 = Debug|Any CPU {22772D7B-C655-491D-8CED-3DD6961D59F8}.Release|Any CPU.ActiveCfg = Release|Any CPU {22772D7B-C655-491D-8CED-3DD6961D59F8}.Release|Any CPU.Build.0 = Release|Any CPU {FCECED16-7C02-47CC-A325-5D710C9C57D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FCECED16-7C02-47CC-A325-5D710C9C57D7}.Debug|Any CPU.Build.0 = Debug|Any CPU {FCECED16-7C02-47CC-A325-5D710C9C57D7}.Release|Any CPU.ActiveCfg = Release|Any CPU {FCECED16-7C02-47CC-A325-5D710C9C57D7}.Release|Any CPU.Build.0 = Release|Any CPU {28CE009E-4E3D-4F06-9811-9A083637A5DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {28CE009E-4E3D-4F06-9811-9A083637A5DC}.Debug|Any CPU.Build.0 = Debug|Any CPU {28CE009E-4E3D-4F06-9811-9A083637A5DC}.Release|Any CPU.ActiveCfg = Release|Any CPU {28CE009E-4E3D-4F06-9811-9A083637A5DC}.Release|Any CPU.Build.0 = Release|Any CPU {C8BF159F-19BC-4E05-BA6C-BD3BB1D4A397}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C8BF159F-19BC-4E05-BA6C-BD3BB1D4A397}.Debug|Any CPU.Build.0 = Debug|Any CPU {C8BF159F-19BC-4E05-BA6C-BD3BB1D4A397}.Release|Any CPU.ActiveCfg = Release|Any CPU {C8BF159F-19BC-4E05-BA6C-BD3BB1D4A397}.Release|Any CPU.Build.0 = Release|Any CPU {E50AB14E-6DB5-4DE3-95EA-BECF1ED6AB75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E50AB14E-6DB5-4DE3-95EA-BECF1ED6AB75}.Debug|Any CPU.Build.0 = Debug|Any CPU {E50AB14E-6DB5-4DE3-95EA-BECF1ED6AB75}.Release|Any CPU.ActiveCfg = Release|Any CPU {E50AB14E-6DB5-4DE3-95EA-BECF1ED6AB75}.Release|Any CPU.Build.0 = Release|Any CPU {45989E3A-AFC8-46B2-A4B7-E38D22E8D93A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {45989E3A-AFC8-46B2-A4B7-E38D22E8D93A}.Debug|Any CPU.Build.0 = Debug|Any CPU {45989E3A-AFC8-46B2-A4B7-E38D22E8D93A}.Release|Any CPU.ActiveCfg = Release|Any CPU {45989E3A-AFC8-46B2-A4B7-E38D22E8D93A}.Release|Any CPU.Build.0 = Release|Any CPU {BA1CBE4F-E321-453F-94D7-F6CE7117851D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BA1CBE4F-E321-453F-94D7-F6CE7117851D}.Debug|Any CPU.Build.0 = Debug|Any CPU {BA1CBE4F-E321-453F-94D7-F6CE7117851D}.Release|Any CPU.ActiveCfg = Release|Any CPU {BA1CBE4F-E321-453F-94D7-F6CE7117851D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {22772D7B-C655-491D-8CED-3DD6961D59F8} = {CD55B1DC-925D-4B8D-8B43-47AE9A9661BD} {FCECED16-7C02-47CC-A325-5D710C9C57D7} = {CD55B1DC-925D-4B8D-8B43-47AE9A9661BD} {28CE009E-4E3D-4F06-9811-9A083637A5DC} = {CD55B1DC-925D-4B8D-8B43-47AE9A9661BD} {C8BF159F-19BC-4E05-BA6C-BD3BB1D4A397} = {CD55B1DC-925D-4B8D-8B43-47AE9A9661BD} {E50AB14E-6DB5-4DE3-95EA-BECF1ED6AB75} = {CD55B1DC-925D-4B8D-8B43-47AE9A9661BD} {45989E3A-AFC8-46B2-A4B7-E38D22E8D93A} = {5DCEB584-F097-4769-8172-4FFBA9E1898D} {BA1CBE4F-E321-453F-94D7-F6CE7117851D} = {CD55B1DC-925D-4B8D-8B43-47AE9A9661BD} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {43E3871F-1034-4291-B5C2-FA50167CC09D} EndGlobalSection EndGlobal ================================================ FILE: README.en.md ================================================ # 基于Yarp的API网关 #### Description 基于Yarp的API网关 #### Software Architecture Software architecture description #### Installation 1. xxxx 2. xxxx 3. xxxx #### Instructions 1. xxxx 2. xxxx 3. xxxx #### Contribution 1. Fork the repository 2. Create Feat_xxx branch 3. Commit your code 4. Create Pull Request #### Gitee Feature 1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md 2. Gitee blog [blog.gitee.com](https://blog.gitee.com) 3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) 4. The most valuable open source project [GVP](https://gitee.com/gvp) 5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) 6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) ================================================ FILE: README.md ================================================ # Kite Api网关 #### 介绍 基于微软反向代理组件Yarp开发的Api网关 #### 软件架构 开发框架 .Net 7 + Abp Vnext 7.0.1 + Blazor(UI框架:BootstrapBlazor) admin 目录为网关管理后台 simples 目录为服务案例 src 目录为项目源代码目录 #### 使用说明 Supervision #### 参与贡献 1. Fork 本仓库 2. 新建 dev_xxx 分支 3. 提交代码 4. 新建 Pull Request ================================================ FILE: admin/Kite.Gateway.Admin/.config/dotnet-tools.json ================================================ { "version": 1, "isRoot": true, "tools": { "dotnet-ef": { "version": "6.0.8", "commands": [ "dotnet-ef" ] } } } ================================================ FILE: admin/Kite.Gateway.Admin/App.razor ================================================  Kite Gateway System Manager Not found

正在玩命开发中 ...

================================================ FILE: admin/Kite.Gateway.Admin/Controllers/RefreshController.cs ================================================ using Kite.Gateway.Application; using Kite.Gateway.Application.Contracts; using Microsoft.Extensions.Configuration; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System.Linq; using Kite.Gateway.Application.Contracts.Dtos; using Kite.Gateway.Application.Contracts.Dtos.Node; namespace Kite.Gateway.Admin.Controllers { [Route("api/[controller]")] [ApiController] public class RefreshController : ControllerBase { private readonly IConfigureAppService _configureAppService; public RefreshController(IConfigureAppService configureAppService) { _configureAppService = configureAppService; } [HttpGet("/api/kite/refresh/configure")] public async Task> GetConfigureAsync() { var result= await _configureAppService.GetConfigureAsync(new ReloadConfigureDto() { IsReloadAuthentication = true, IsReloadMiddleware = true, IsReloadWhitelist = true, IsReloadYarp = true, }); return result; } } } ================================================ FILE: admin/Kite.Gateway.Admin/Core/AuthorizationServerStorage.cs ================================================ using Kite.Gateway.Application.Contracts.Dtos.Administrator; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage; using System; using System.Linq; using Microsoft.Extensions.Caching.Memory; namespace Kite.Gateway.Admin.Core { public class AuthorizationServerStorage { private readonly IMemoryCache _memoryCache; public AuthorizationServerStorage(IMemoryCache memoryCache) { _memoryCache = memoryCache; } /// /// 判断是否已经登录 /// /// public bool IsLogin() { if (_memoryCache.TryGetValue("administrator", out AdministratorDto administrator)) { return true; } else { return false; } } /// /// 删除登录会话信息 /// /// public void DeleteServerStorage() { if (_memoryCache.TryGetValue("administrator", out AdministratorDto administrator)) { _memoryCache.Remove("administrator"); } } /// /// 设置登录会话信息 /// /// /// public void SetServerStorage(AdministratorDto value) { if (_memoryCache.TryGetValue("administrator", out AdministratorDto administrator)) { _memoryCache.Remove("administrator"); } _memoryCache.Set("administrator", value, DateTimeOffset.Now.AddMinutes(120)); } /// /// 获取登录会话 /// /// public AdministratorDto GetServerStorage() { if (_memoryCache.TryGetValue("administrator", out AdministratorDto administrator)) { return administrator; } else { return new AdministratorDto(); } } } } ================================================ FILE: admin/Kite.Gateway.Admin/Dockerfile ================================================ #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base WORKDIR /app EXPOSE 80 FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build WORKDIR /src COPY ["admin/Kite.Gateway.Admin/Kite.Gateway.Admin.csproj", "admin/Kite.Gateway.Admin/"] COPY ["src/Kite.Gateway.EntityFrameworkCore/Kite.Gateway.EntityFrameworkCore.csproj", "src/Kite.Gateway.EntityFrameworkCore/"] COPY ["src/Kite.Gateway.Domain/Kite.Gateway.Domain.csproj", "src/Kite.Gateway.Domain/"] COPY ["src/Kite.Gateway.Domain.Shared/Kite.Gateway.Domain.Shared.csproj", "src/Kite.Gateway.Domain.Shared/"] COPY ["src/Kite.Gateway.Application/Kite.Gateway.Application.csproj", "src/Kite.Gateway.Application/"] COPY ["src/Kite.Gateway.Application.Contracts/Kite.Gateway.Application.Contracts.csproj", "src/Kite.Gateway.Application.Contracts/"] RUN dotnet restore "admin/Kite.Gateway.Admin/Kite.Gateway.Admin.csproj" COPY . . WORKDIR "/src/admin/Kite.Gateway.Admin" RUN dotnet build "Kite.Gateway.Admin.csproj" -c Release -o /app/build FROM build AS publish RUN dotnet publish "Kite.Gateway.Admin.csproj" -c Release -o /app/publish FROM base AS final WORKDIR /app COPY --from=publish /app/publish . ENTRYPOINT ["dotnet", "Kite.Gateway.Admin.dll"] ================================================ FILE: admin/Kite.Gateway.Admin/GatewayAdminModule.cs ================================================ using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Kite.Gateway.Application; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Volo.Abp; using Volo.Abp.Autofac; using Volo.Abp.Modularity; using Microsoft.AspNetCore.Http; using System.Security.Cryptography.X509Certificates; using System.Text; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using Volo.Abp.Json; using Kite.Gateway.Admin.Core; using Volo.Abp.AspNetCore; using Kite.Gateway.Application.Contracts; using Kite.Gateway.EntityFrameworkCore; using BootstrapBlazor.Components; using Microsoft.Extensions.Options; namespace Kite.Gateway.Admin { [DependsOn( typeof(AbpAspNetCoreModule), typeof(AbpAutofacModule), typeof(ApplicationModule), typeof(EntityFrameworkCoreModule) )] public class GatewayAdminModule:AbpModule { #region 中间件注入 public override void ConfigureServices(ServiceConfigurationContext context) { context.Services.AddMemoryCache(); context.Services.AddHttpClient(); ConfigureBlazor(context); ConfigureMvc(context); } private void ConfigureMvc(ServiceConfigurationContext context) { context.Services.AddControllers(); } /// /// Blazor /// /// private void ConfigureBlazor(ServiceConfigurationContext context) { context.Services.AddRazorPages(); context.Services.AddServerSideBlazor(); context.Services.AddBootstrapBlazor(options => { // 统一设置 Toast 组件自动消失时间 options.ToastDelay = 4000; options.ToastPlacement = Placement.TopEnd; options.SupportedCultures = new List { "zh" }; options.FallbackCulture = "zh"; options.DefaultCultureInfo = "zh"; }); // 增加多语言支持配置信息 context.Services.AddRequestLocalization>((localizerOption, blazorOption) => { blazorOption.OnChange(op => Invoke(op)); Invoke(blazorOption.CurrentValue); void Invoke(BootstrapBlazorOptions option) { var supportedCultures = option.GetSupportedCultures(); localizerOption.SupportedCultures = supportedCultures; localizerOption.SupportedUICultures = supportedCultures; } }); } #endregion public override void OnApplicationInitialization(ApplicationInitializationContext context) { var app = context.GetApplicationBuilder(); var env = context.GetEnvironment(); var option = app.ApplicationServices.GetService>(); if (option != null) { app.UseRequestLocalization(option.Value); } app.UseStaticFiles(); app.UseRouting(); app.UseExceptionHandler("/Error"); app.UseEndpoints(endpoints => { endpoints.MapControllers(); endpoints.MapBlazorHub(); endpoints.MapFallbackToPage("/_Host"); }); } } } ================================================ FILE: admin/Kite.Gateway.Admin/Kite.Gateway.Admin.csproj ================================================ net7.0 enable enable Linux ..\.. 1701;1702;8601;8602;8618;8625; 1701;1702;8601;8602;8618;8625; all runtime; build; native; contentfiles; analyzers; buildtransitive all runtime; build; native; contentfiles; analyzers; buildtransitive ================================================ FILE: admin/Kite.Gateway.Admin/Pages/Administrator/Administrator.razor ================================================ @page "/Administrator" @using Kite.Gateway.Application.Contracts @using Kite.Gateway.Application.Contracts.Dtos.Administrator @using Mapster @using Kite.Gateway.Domain.Shared.Enums @inject ToastService ToastService @inject IAdministratorAppService AdministratorAppService
@if(Administrators!=null&&Administrators.Any()) { foreach(var item in Administrators) { } }
管理员名 昵称 创建时间 更新时间 操作
@item.AdminName @item.NickName @item.Created @item.Updated
@code { private Modal Modal; private Modal UpdateModal; public UpdateAdministratorDto UpdateModel { get; set; } //分页数据 private List? Administrators { get; set; } private int TotalCount { get; set; } = 0; private int PageSize { get; set; } = 10; private int PageIndex { get; set; } = 1; /// /// OnInitialized 方法 /// protected override void OnInitialized() { OnQueryAsync(); base.OnInitialized(); } #region 管理员编辑更新 private async void OnUpdateAsync(Guid id) { UpdateModel= await GetAsync(id); await UpdateModal.Toggle(); } private async Task GetAsync(Guid id) { var result = await AdministratorAppService.GetAsync(id); if (result.Code != 0 || result.Data == null) { await ToastService.Warning("系统警告", "数据不存在"); } var model= TypeAdapter.Adapt(result.Data); return model; } private async void OnUpdateCallbackAsync() { await UpdateModal.Close(); OnQueryAsync(); } #endregion #region 新增管理员 private async void OnAddAsync() { await Modal.Toggle(); } private async void OnAddCallbackAsync() { await Modal.Close(); OnQueryAsync(); } #endregion private async Task OnDeleteAsync(Guid id) { var result= await AdministratorAppService.DeleteAsync(id); if (result.Code == 0) { OnQueryAsync(); await ToastService.Success("系统通知","数据删除成功!"); return; } await ToastService.Warning("系统警告","数据删除失败"); } private Task OnPageClick(int pageIndex, int pageItems) { PageIndex = pageIndex; OnQueryAsync(); return Task.CompletedTask; } private Task OnPageItemsChanged(int pageItems) { PageIndex=1; PageSize = pageItems; OnQueryAsync(); return Task.CompletedTask; } private async void OnQueryAsync() { var result = await AdministratorAppService.GetListAsync(PageIndex, PageSize); if (result.Code == 0) { Administrators = result.Data; TotalCount = result.Count; StateHasChanged(); } else { await ToastService.Warning("系统警告", "数据加载失败"); } } } ================================================ FILE: admin/Kite.Gateway.Admin/Pages/Administrator/Login.razor ================================================ @page "/Login" @layout SimpleLayout @using Kite.Gateway.Admin.Core @using Kite.Gateway.Application.Contracts @using Kite.Gateway.Application.Contracts.Dtos.Administrator @using Mapster @using Kite.Gateway.Domain.Shared.Enums @inject ToastService ToastService @inject NavigationManager NavigationManager @inject IAdministratorAppService AdministratorAppService @inject AuthorizationServerStorage AuthorizationServerStorage

Kite Gateway

@* *@
@code { //表单数据 private LoginAdministratorDto LoginAdministrator { get; set; }= new LoginAdministratorDto(); private EditContext? editContext; /// /// OnInitialized 方法 /// protected override void OnInitialized() { editContext = new(LoginAdministrator); base.OnInitialized(); } private Task OnInvalidSubmitAsync(EditContext editContext) { return Task.CompletedTask; } private async Task OnLoginAsync(EditContext editContext) { try { if (string.IsNullOrEmpty(LoginAdministrator.AdminName) || LoginAdministrator.AdminName.Trim() == "") { await ToastService.Warning("系统警告","管理员账号名不能为空"); return; } if (string.IsNullOrEmpty(LoginAdministrator.Password) || LoginAdministrator.Password.Trim() == "") { await ToastService.Warning("系统警告","管理员密码不能为空"); return; } var result = await AdministratorAppService.LoginAsync(LoginAdministrator); if (result.Code != 0) { await ToastService.Warning("系统警告",result.Message); } else { AuthorizationServerStorage.SetServerStorage(result.Data); NavigationManager.NavigateTo("/"); } await Task.CompletedTask; } catch (Exception ex) { await ToastService.Warning("系统警告", ex.Message); } } } ================================================ FILE: admin/Kite.Gateway.Admin/Pages/Administrator/Login.razor.css ================================================ html, body { height: 100%; } body { display: flex; align-items: center; padding-top: 40px; padding-bottom: 40px; background-color: #f5f5f5; } .form-signin { width: 100%; max-width: 330px; padding: 15px; margin: auto; margin-top:260px; } .form-signin .checkbox { font-weight: 400; } .form-signin .form-floating:focus-within { z-index: 2; } .form-signin input[type="email"] { margin-bottom: -1px; border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .form-signin input[type="password"] { margin-bottom: 10px; border-top-left-radius: 0; border-top-right-radius: 0; } .bd-placeholder-img { font-size: 1.125rem; text-anchor: middle; -webkit-user-select: none; -moz-user-select: none; user-select: none; } @media (min-width: 768px) { .bd-placeholder-img-lg { font-size: 3.5rem; } } ================================================ FILE: admin/Kite.Gateway.Admin/Pages/Administrator/Logout.razor ================================================ @page "/Logout" @using System @layout SimpleLayout @using Kite.Gateway.Admin.Core @using Mapster @using Kite.Gateway.Domain.Shared.Enums @inject ToastService ToastService @inject NavigationManager NavigationManager @inject AuthorizationServerStorage AuthorizationServerStorage

正在退出登录...

@code { protected override void OnInitialized() { base.OnInitialized(); //如果没有登录则跳转到登录页面 if (!AuthorizationServerStorage.IsLogin()) { NavigationManager.NavigateTo("/Login"); } else { //清理服务器登录存储信息 AuthorizationServerStorage.DeleteServerStorage(); //跳转到登录页面 NavigationManager.NavigateTo("/Login"); } } } ================================================ FILE: admin/Kite.Gateway.Admin/Pages/Administrator/Logout.razor.css ================================================ html, body { height: 100%; } body { display: flex; align-items: center; padding-top: 40px; padding-bottom: 40px; background-color: #f5f5f5; } .form-signin { width: 100%; max-width: 330px; padding: 15px; margin: auto; margin-top: 260px; } .form-signin .checkbox { font-weight: 400; } .form-signin .form-floating:focus-within { z-index: 2; } .form-signin input[type="email"] { margin-bottom: -1px; border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .form-signin input[type="password"] { margin-bottom: 10px; border-top-left-radius: 0; border-top-right-radius: 0; } .bd-placeholder-img { font-size: 1.125rem; text-anchor: middle; -webkit-user-select: none; -moz-user-select: none; user-select: none; } @media (min-width: 768px) { .bd-placeholder-img-lg { font-size: 3.5rem; } } ================================================ FILE: admin/Kite.Gateway.Admin/Pages/Administrator/NewAdministrator.razor ================================================ @using Kite.Gateway.Application.Contracts @using Kite.Gateway.Application.Contracts.Dtos.Administrator @inject ToastService ToastService @inject IAdministratorAppService AdministratorAppService
@code { [Parameter] public EventCallback OnClickCallback { get; set; } //表单数据 private CreateAdministratorDto Model { get; set; } /// /// OnInitialized 方法 /// protected override void OnInitialized() { base.OnInitialized(); Model = new CreateAdministratorDto(); } private Task OnInvalidSubmitAsync(EditContext context) { return Task.CompletedTask; } private async Task OnSaveAsync(EditContext context) { var result= await AdministratorAppService.CreateAsync(Model); if (result.Code != 0) { await ToastService.Warning(result.Message); } else { await OnClickCallback.InvokeAsync(); await ToastService.Success("保存成功"); Model = new CreateAdministratorDto(); } } } ================================================ FILE: admin/Kite.Gateway.Admin/Pages/Administrator/UpdateAdministrator.razor ================================================ @using Kite.Gateway.Application.Contracts @using Kite.Gateway.Application.Contracts.Dtos.Administrator @inject ToastService ToastService @inject IAdministratorAppService AdministratorAppService
@code { [Parameter] public EventCallback OnClickCallback { get; set; } //表单数据 [Parameter] public UpdateAdministratorDto Model { get; set; } /// /// OnInitialized 方法 /// protected override void OnInitialized() { base.OnInitialized(); } private Task OnInvalidSubmitAsync(EditContext context) { return Task.CompletedTask; } private async Task OnSaveAsync(EditContext context) { var result= await AdministratorAppService.UpdateAsync(Model); if (result.Code != 0) { await ToastService.Warning(result.Message); } else { await OnClickCallback.InvokeAsync(); await ToastService.Success("保存成功"); } } } ================================================ FILE: admin/Kite.Gateway.Admin/Pages/Authorization/Authentication.razor ================================================ @page "/Authentication" @using System.IO; @using Kite.Gateway.Application.Contracts @using Kite.Gateway.Application.Contracts.Dtos.Authorization @inject ToastService ToastService @inject IAuthorizationAppService AuthorizationAppService @inject IWebHostEnvironment WebHostEnvironment;
@code { [Parameter] public EventCallback OnClickCallback { get; set; } //表单数据 private SaveAuthenticationDto Model { get; set; } private bool IsDisabledUseSSL { get; set; } private bool IsDisabledSecurityKey { get; set; } /// /// OnInitialized 方法 /// protected override async void OnInitialized() { base.OnInitialized(); var result = await AuthorizationAppService.GetAuthenticationAsync(); if (result.Code == 0) { Model = result.Data; IsDisabledUseSSL = Model.UseSSL ? false : true; IsDisabledSecurityKey = Model.UseSSL; } } private Task OnUseSSLSwitch(bool val) { IsDisabledSecurityKey = val; IsDisabledUseSSL = val ? false : true; return Task.FromResult(true); } private async Task OnFileChange(UploadFile file) { if (file.File != null) { //保存证书文件 var filePath = Path.Combine(WebHostEnvironment.WebRootPath, $"upload/{file.File.Name}"); await file.SaveToFile(filePath); //读取文件并且转换为BASE64字符串存储 using var fs = new FileStream(filePath, FileMode.Open); fs.Seek(0, SeekOrigin.Begin); var buffer = new byte[fs.Length]; fs.Read(buffer, 0, buffer.Length); Model.CertificateFileName = file.File.Name; Model.CertificateFile = Convert.ToBase64String(buffer); } else { Model.CertificateFileName = ""; Model.CertificateFile = ""; } } private Task OnInvalidSubmitAsync(EditContext context) { return Task.CompletedTask; } private async Task OnSaveAsync(EditContext context) { var result= await AuthorizationAppService.SaveAuthenticationAsync(Model); if (result.Code != 0) { await ToastService.Warning(result.Message); } else { await OnClickCallback.InvokeAsync(); await ToastService.Success("保存成功"); } } } ================================================ FILE: admin/Kite.Gateway.Admin/Pages/Error.cshtml ================================================ @page @model Kite.Gateway.Admin.Pages.ErrorModel Error

Error.

An error occurred while processing your request.

@if (Model.ShowRequestId) {

Request ID: @Model.RequestId

}

Development Mode

Swapping to the Development environment displays detailed information about the error that occurred.

The Development environment shouldn't be enabled for deployed applications. It can result in displaying sensitive information from exceptions to end users. For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development and restarting the app.

================================================ FILE: admin/Kite.Gateway.Admin/Pages/Error.cshtml.cs ================================================ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using System.Diagnostics; namespace Kite.Gateway.Admin.Pages { [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] [IgnoreAntiforgeryToken] public class ErrorModel : PageModel { public string? RequestId { get; set; } public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); private readonly ILogger _logger; public ErrorModel(ILogger logger) { _logger = logger; } public void OnGet() { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; } } } ================================================ FILE: admin/Kite.Gateway.Admin/Pages/Home.razor ================================================ @page "/" @code { private List AlternateTimelineItems { get; set; } protected override void OnInitialized() { base.OnInitialized(); AlternateTimelineItems = new List() { new TimelineItem() { Description="2022-09-21", Content="升级到.NET 7" } , new TimelineItem() { Description="2022-07-28", Content="第一个小迭代版本(数据库更换成Sqlite、调整配置数据热更新功能)" } , new TimelineItem() { Description="2022-07-21", Content="完成第一个版本的更替,并且分享源代码到github上" } }; } } ================================================ FILE: admin/Kite.Gateway.Admin/Pages/Middleware/Middleware.razor ================================================ @page "/Middleware" @using Kite.Gateway.Application.Contracts @using Kite.Gateway.Application.Contracts.Dtos.Middleware @using Mapster @using Kite.Gateway.Domain.Shared.Enums @inject ToastService ToastService @inject IMiddlewareAppService MiddlewareAppService
@if(Middlewares!=null&&Middlewares.Any()) { foreach(var item in Middlewares) { } }
中间件名称 服务端 通信类型 执行权重 状态 描述 创建时间 更新时间 操作
@item.Name @item.Server @switch(item.SignalType) { case SignalTypeEnum.Http:
http
break; default:
grpc
break; }
@item.ExecWeight @item.Description @item.Created @item.Updated
@code { private Modal Modal; private Modal UpdateModal; public UpdateMiddlewareDto UpdateModel { get; set; } //分页数据 private List? Middlewares { get; set; } private int TotalCount { get; set; } = 0; private int PageSize { get; set; } = 10; private int PageIndex { get; set; } = 1; private string SearchKw { get; set; } = ""; /// /// OnInitialized 方法 /// protected override void OnInitialized() { OnQueryAsync(); base.OnInitialized(); } #region 中间件编辑更新 private async void OnUpdateStateAsync(Guid id,bool val) { var result = await MiddlewareAppService.UpdateUseStateAsync(id, val); if (result.Code != 0) { await ToastService.Warning("系统警告",result.Message); } else { await ToastService.Success("系统通知","保存成功"); } } private async void OnUpdateAsync(Guid id) { UpdateModel= await GetAsync(id); await UpdateModal.Toggle(); } private async Task GetAsync(Guid id) { var result = await MiddlewareAppService.GetAsync(id); if (result.Code != 0 || result.Data == null) { await ToastService.Warning("系统警告", "数据不存在"); } var model= TypeAdapter.Adapt(result.Data); return model; } private async void OnUpdateCallbackAsync() { await UpdateModal.Close(); OnQueryAsync(); } #endregion #region 新增中间件 private async void OnAddAsync() { await Modal.Toggle(); } private async void OnAddCallbackAsync() { await Modal.Close(); OnQueryAsync(); } #endregion private async Task OnDeleteAsync(Guid id) { var result= await MiddlewareAppService.DeleteAsync(id); if (result.Code == 0) { OnQueryAsync(); await ToastService.Success("系统通知","数据删除成功!"); return; } await ToastService.Warning("系统警告","数据删除失败"); } private Task OnPageClick(int pageIndex, int pageItems) { PageIndex = pageIndex; OnQueryAsync(); return Task.CompletedTask; } private Task OnPageItemsChanged(int pageItems) { PageIndex=1; PageSize = pageItems; OnQueryAsync(); return Task.CompletedTask; } private void OnSearchAsync() { PageIndex=1; OnQueryAsync(); } private async void OnQueryAsync() { var result = await MiddlewareAppService.GetListAsync(SearchKw, PageIndex, PageSize); if (result.Code == 0) { Middlewares = result.Data; TotalCount = result.Count; StateHasChanged(); } else { await ToastService.Warning("系统警告", "数据加载失败"); } } } ================================================ FILE: admin/Kite.Gateway.Admin/Pages/Middleware/NewMiddleware.razor ================================================ @using Kite.Gateway.Application.Contracts @using Kite.Gateway.Application.Contracts.Dtos.Middleware @inject ToastService ToastService @inject IMiddlewareAppService MiddlewareAppService