├── Web.MVC ├── Views │ ├── _ViewStart.cshtml │ ├── _ViewImports.cshtml │ ├── Home │ │ ├── Privacy.cshtml │ │ └── Index.cshtml │ └── Shared │ │ ├── _ValidationScriptsPartial.cshtml │ │ ├── Error.cshtml │ │ └── _Layout.cshtml ├── Startup.cs ├── wwwroot │ ├── favicon.ico │ ├── js │ │ └── site.js │ ├── lib │ │ ├── jquery-validation-unobtrusive │ │ │ └── LICENSE.txt │ │ ├── jquery-validation │ │ │ └── LICENSE.md │ │ ├── bootstrap │ │ │ └── LICENSE │ │ └── jquery │ │ │ └── LICENSE.txt │ └── css │ │ └── site.css ├── appsettings.Development.json ├── Models │ └── ErrorViewModel.cs ├── appsettings.json ├── Properties │ └── launchSettings.json ├── Web.MVC.csproj ├── Dockerfile ├── Helper │ ├── IServiceHelper.cs │ ├── GatewayServiceHelper.cs │ └── ServiceHelper.cs ├── Program.cs └── Controllers │ └── HomeController.cs ├── IDS4.AuthCenter ├── Views │ ├── _ViewStart.cshtml │ ├── _ViewImports.cshtml │ ├── Account │ │ ├── AccessDenied.cshtml │ │ ├── Logout.cshtml │ │ └── LoggedOut.cshtml │ ├── Device │ │ ├── Success.cshtml │ │ └── UserCodeCapture.cshtml │ ├── Shared │ │ ├── _ValidationSummary.cshtml │ │ ├── Redirect.cshtml │ │ ├── _Layout.cshtml │ │ ├── _Nav.cshtml │ │ ├── _ScopeListItem.cshtml │ │ └── Error.cshtml │ ├── Home │ │ └── Index.cshtml │ ├── Diagnostics │ │ └── Index.cshtml │ └── Grants │ │ └── Index.cshtml ├── wwwroot │ ├── lib │ │ ├── bootstrap │ │ │ └── scss │ │ │ │ ├── utilities │ │ │ │ ├── _clearfix.scss │ │ │ │ ├── _overflow.scss │ │ │ │ ├── _screenreaders.scss │ │ │ │ ├── _visibility.scss │ │ │ │ ├── _shadows.scss │ │ │ │ ├── _float.scss │ │ │ │ ├── _align.scss │ │ │ │ ├── _background.scss │ │ │ │ ├── _stretched-link.scss │ │ │ │ ├── _sizing.scss │ │ │ │ ├── _position.scss │ │ │ │ ├── _display.scss │ │ │ │ ├── _embed.scss │ │ │ │ ├── _borders.scss │ │ │ │ ├── _text.scss │ │ │ │ ├── _spacing.scss │ │ │ │ └── _flex.scss │ │ │ │ ├── _media.scss │ │ │ │ ├── mixins │ │ │ │ ├── _clearfix.scss │ │ │ │ ├── _size.scss │ │ │ │ ├── _lists.scss │ │ │ │ ├── _text-truncate.scss │ │ │ │ ├── _resize.scss │ │ │ │ ├── _visibility.scss │ │ │ │ ├── _alert.scss │ │ │ │ ├── _text-hide.scss │ │ │ │ ├── _badge.scss │ │ │ │ ├── _nav-divider.scss │ │ │ │ ├── _transition.scss │ │ │ │ ├── _float.scss │ │ │ │ ├── _list-group.scss │ │ │ │ ├── _reset-text.scss │ │ │ │ ├── _text-emphasis.scss │ │ │ │ ├── _pagination.scss │ │ │ │ ├── _box-shadow.scss │ │ │ │ ├── _deprecate.scss │ │ │ │ ├── _background-variant.scss │ │ │ │ ├── _hover.scss │ │ │ │ ├── _screen-reader.scss │ │ │ │ ├── _table-row.scss │ │ │ │ ├── _image.scss │ │ │ │ ├── _border-radius.scss │ │ │ │ ├── _caret.scss │ │ │ │ ├── _grid-framework.scss │ │ │ │ ├── _gradients.scss │ │ │ │ └── _grid.scss │ │ │ │ ├── _transitions.scss │ │ │ │ ├── bootstrap-reboot.scss │ │ │ │ ├── _jumbotron.scss │ │ │ │ ├── _utilities.scss │ │ │ │ ├── _root.scss │ │ │ │ ├── bootstrap-grid.scss │ │ │ │ ├── bootstrap.scss │ │ │ │ ├── _close.scss │ │ │ │ ├── _toasts.scss │ │ │ │ ├── _code.scss │ │ │ │ ├── _mixins.scss │ │ │ │ ├── _spinners.scss │ │ │ │ ├── _images.scss │ │ │ │ ├── _progress.scss │ │ │ │ ├── _badge.scss │ │ │ │ ├── _alert.scss │ │ │ │ ├── _breadcrumb.scss │ │ │ │ ├── _grid.scss │ │ │ │ ├── _pagination.scss │ │ │ │ ├── _nav.scss │ │ │ │ ├── _type.scss │ │ │ │ ├── _tooltip.scss │ │ │ │ ├── _buttons.scss │ │ │ │ └── _print.scss │ │ └── jquery │ │ │ ├── LICENSE.txt │ │ │ └── README.md │ ├── icon.jpg │ ├── icon.png │ ├── favicon.ico │ ├── js │ │ ├── signin-redirect.js │ │ └── signout-redirect.js │ └── css │ │ ├── site.min.css │ │ ├── site.css │ │ └── site.scss ├── Quickstart │ ├── Account │ │ ├── LogoutInputModel.cs │ │ ├── RedirectViewModel.cs │ │ ├── LogoutViewModel.cs │ │ ├── ExternalProvider.cs │ │ ├── LoginInputModel.cs │ │ ├── AccountOptions.cs │ │ ├── LoggedOutViewModel.cs │ │ └── LoginViewModel.cs │ ├── Device │ │ ├── DeviceAuthorizationInputModel.cs │ │ └── DeviceAuthorizationViewModel.cs │ ├── Consent │ │ ├── ScopeViewModel.cs │ │ ├── ConsentInputModel.cs │ │ ├── ConsentViewModel.cs │ │ ├── ProcessConsentResult.cs │ │ └── ConsentOptions.cs │ ├── Home │ │ ├── ErrorViewModel.cs │ │ └── HomeController.cs │ ├── Grants │ │ ├── GrantsViewModel.cs │ │ └── GrantsController.cs │ ├── Extensions.cs │ ├── Diagnostics │ │ ├── DiagnosticsController.cs │ │ └── DiagnosticsViewModel.cs │ ├── SecurityHeadersAttribute.cs │ └── TestUsers.cs ├── Properties │ └── launchSettings.json ├── IDS4.AuthCenter.csproj ├── Dockerfile ├── tempkey.jwk ├── Program.cs ├── Config.cs └── Startup.cs ├── Order.API ├── Startup.cs ├── appsettings.json ├── appsettings.Development.json ├── MessageDto │ └── CreateOrderMessageDto.cs ├── Controllers │ ├── HealthCheckController.cs │ └── OrdersController.cs ├── Models │ ├── OrderContext.cs │ └── Order.cs ├── Properties │ └── launchSettings.json ├── Migrations │ ├── 20200618143038_Initial1.cs │ ├── 20200618053407_Initial.cs │ ├── 20200618053407_Initial.Designer.cs │ ├── OrderContextModelSnapshot.cs │ └── 20200618143038_Initial1.Designer.cs ├── Dockerfile ├── Program.cs ├── Order.API.csproj └── Helper │ └── ConsulHelper.cs ├── Product.API ├── Startup.cs ├── appsettings.json ├── appsettings.Development.json ├── MessageDto │ └── CreateOrderMessageDto.cs ├── Controllers │ ├── HealthCheckController.cs │ └── ProductsController.cs ├── Properties │ └── launchSettings.json ├── Dockerfile ├── Models │ ├── Product.cs │ └── ProductContext.cs ├── Program.cs ├── Product.API.csproj ├── Migrations │ ├── 20200625023345_Initial.cs │ ├── ProductContextModelSnapshot.cs │ └── 20200625023345_Initial.Designer.cs └── Helper │ └── ConsulHelper.cs ├── README.md ├── Ocelot.APIGateway ├── Startup.cs ├── ocelot.json ├── appsettings.Development.json ├── appsettings.json ├── Properties │ └── launchSettings.json ├── Dockerfile ├── Ocelot.APIGateway.csproj └── Program.cs ├── .dockerignore └── .gitattributes /Web.MVC/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /IDS4.AuthCenter/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /Web.MVC/Startup.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiajingren/NetCoreMicroserviceDemo/HEAD/Web.MVC/Startup.cs -------------------------------------------------------------------------------- /Order.API/Startup.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiajingren/NetCoreMicroserviceDemo/HEAD/Order.API/Startup.cs -------------------------------------------------------------------------------- /IDS4.AuthCenter/wwwroot/lib/bootstrap/scss/utilities/_clearfix.scss: -------------------------------------------------------------------------------- 1 | .clearfix { 2 | @include clearfix(); 3 | } 4 | -------------------------------------------------------------------------------- /Product.API/Startup.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiajingren/NetCoreMicroserviceDemo/HEAD/Product.API/Startup.cs -------------------------------------------------------------------------------- /Order.API/appsettings.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiajingren/NetCoreMicroserviceDemo/HEAD/Order.API/appsettings.json -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NetCoreMicroserviceDemo 2 | 3 | .Net Core微服务入门 4 | 5 | 博客园:https://www.cnblogs.com/xhznl/p/13071260.html 6 | -------------------------------------------------------------------------------- /Ocelot.APIGateway/Startup.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiajingren/NetCoreMicroserviceDemo/HEAD/Ocelot.APIGateway/Startup.cs -------------------------------------------------------------------------------- /Ocelot.APIGateway/ocelot.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiajingren/NetCoreMicroserviceDemo/HEAD/Ocelot.APIGateway/ocelot.json -------------------------------------------------------------------------------- /Product.API/appsettings.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiajingren/NetCoreMicroserviceDemo/HEAD/Product.API/appsettings.json -------------------------------------------------------------------------------- /Web.MVC/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiajingren/NetCoreMicroserviceDemo/HEAD/Web.MVC/wwwroot/favicon.ico -------------------------------------------------------------------------------- /IDS4.AuthCenter/wwwroot/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiajingren/NetCoreMicroserviceDemo/HEAD/IDS4.AuthCenter/wwwroot/icon.jpg -------------------------------------------------------------------------------- /IDS4.AuthCenter/wwwroot/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiajingren/NetCoreMicroserviceDemo/HEAD/IDS4.AuthCenter/wwwroot/icon.png -------------------------------------------------------------------------------- /Web.MVC/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using Web.MVC 2 | @using Web.MVC.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /IDS4.AuthCenter/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using IdentityServerHost.Quickstart.UI 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /IDS4.AuthCenter/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiajingren/NetCoreMicroserviceDemo/HEAD/IDS4.AuthCenter/wwwroot/favicon.ico -------------------------------------------------------------------------------- /IDS4.AuthCenter/wwwroot/js/signin-redirect.js: -------------------------------------------------------------------------------- 1 | window.location.href = document.querySelector("meta[http-equiv=refresh]").getAttribute("data-url"); 2 | -------------------------------------------------------------------------------- /IDS4.AuthCenter/wwwroot/lib/bootstrap/scss/_media.scss: -------------------------------------------------------------------------------- 1 | .media { 2 | display: flex; 3 | align-items: flex-start; 4 | } 5 | 6 | .media-body { 7 | flex: 1; 8 | } 9 | -------------------------------------------------------------------------------- /IDS4.AuthCenter/wwwroot/lib/bootstrap/scss/mixins/_clearfix.scss: -------------------------------------------------------------------------------- 1 | @mixin clearfix() { 2 | &::after { 3 | display: block; 4 | clear: both; 5 | content: ""; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Web.MVC/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |
Use this page to detail your site's privacy policy.
7 | -------------------------------------------------------------------------------- /IDS4.AuthCenter/wwwroot/lib/bootstrap/scss/utilities/_overflow.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | @each $value in $overflows { 4 | .overflow-#{$value} { overflow: $value !important; } 5 | } 6 | -------------------------------------------------------------------------------- /IDS4.AuthCenter/Views/Account/AccessDenied.cshtml: -------------------------------------------------------------------------------- 1 | 2 |You do not have access to that resource.
6 |You have successfully authorized the device
6 |8 | @ViewBag.OrderData 9 |
10 |11 | @ViewBag.ProductData 12 |
13 |Once complete, you may close this tab.
7 |Would you like to logut of IdentityServer?
7 |Please enter the code displayed on your device.
7 |
12 | Request ID: @Model.RequestId
13 |
18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |
20 |21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |
26 | -------------------------------------------------------------------------------- /Ocelot.APIGateway/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Ocelot.APIGateway 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureAppConfiguration((hostingContext, config) => 22 | { 23 | config.AddJsonFile("ocelot.json"); 24 | }) 25 | .ConfigureWebHostDefaults(webBuilder => 26 | { 27 | webBuilder.UseStartup