Browse Source

Merge branch 'master' into Translate

pull/902/head
maliming 7 years ago
committed by GitHub
parent
commit
596b60a9f1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      abp_io/src/Volo.AbpWebSite.Web/Pages/Templates.cshtml
  2. 17
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/datatables/datatables-extensions.js
  3. 2
      framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpDictionaryBasedStringLocalizer.cs
  4. 11
      framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json
  5. 11
      framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/tr.json
  6. 9
      framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/zh-Hans.json
  7. 6
      modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/AccountController.cs
  8. 5
      modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/zh-Hans.json
  9. 2
      modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs
  10. 10
      modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hans.json
  11. 26
      modules/docs/src/Volo.Docs.Admin.Web/Localization/Resources/Docs/Web/zh-Hans.json
  12. 15
      modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/zh-Hans.json
  13. 6
      modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Localization/ApplicationContracts/zh-Hans.json
  14. 2
      modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs
  15. 2
      modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContextModelBuilderExtensions.cs
  16. 1
      modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml
  17. 1
      modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml
  18. 4
      modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/zh-Hans.json
  19. 25
      modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml
  20. 15
      modules/setting-management/src/Volo.Abp.SettingManagement.Web/AbpSettingManagementWebModule.cs
  21. 10
      modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/AbpSettingManagementResource.cs
  22. 6
      modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/Resources/AbpSettingManagement/en.json
  23. 6
      modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/Resources/AbpSettingManagement/tr.json
  24. 6
      modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/Resources/AbpSettingManagement/zh-Hans.json
  25. 7
      modules/setting-management/src/Volo.Abp.SettingManagement.Web/Navigation/SettingManagementMainMenuContributor.cs
  26. 37
      modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml
  27. 2
      modules/setting-management/src/Volo.Abp.SettingManagement.Web/Volo.Abp.SettingManagement.Web.csproj
  28. 3
      modules/users/src/Volo.Abp.Users.EntityFrameworkCore/Volo/Abp/Users/EntityFrameworkCore/AbpUsersDbContextModelCreatingExtensions.cs
  29. 44
      samples/MicroserviceDemo/k8s/auth-server-deployment.yaml
  30. 15
      samples/MicroserviceDemo/k8s/auth-server-service.yaml
  31. 44
      samples/MicroserviceDemo/k8s/backend-admin-app-deployment.yaml
  32. 68
      samples/MicroserviceDemo/k8s/backend-admin-app-gateway-deployment.yaml
  33. 15
      samples/MicroserviceDemo/k8s/backend-admin-app-gateway-service.yaml
  34. 15
      samples/MicroserviceDemo/k8s/backend-admin-app-service.yaml
  35. 56
      samples/MicroserviceDemo/k8s/blogging-service-deployment.yaml
  36. 15
      samples/MicroserviceDemo/k8s/blogging-service-service.yaml
  37. 3
      samples/MicroserviceDemo/k8s/dbdata-persistentvolumeclaim.yaml
  38. 12
      samples/MicroserviceDemo/k8s/expose-service.yaml
  39. 48
      samples/MicroserviceDemo/k8s/identity-service-deployment.yaml
  40. 15
      samples/MicroserviceDemo/k8s/identity-service-service.yaml
  41. 72
      samples/MicroserviceDemo/k8s/internal-gateway-deployment.yaml
  42. 15
      samples/MicroserviceDemo/k8s/internal-gateway-service.yaml
  43. 21
      samples/MicroserviceDemo/k8s/mongodb-deployment.yaml
  44. 12
      samples/MicroserviceDemo/k8s/mongodb-service.yaml
  45. 54
      samples/MicroserviceDemo/k8s/product-service-deployment.yaml
  46. 15
      samples/MicroserviceDemo/k8s/product-service-service.yaml
  47. 44
      samples/MicroserviceDemo/k8s/public-website-deployment.yaml
  48. 64
      samples/MicroserviceDemo/k8s/public-website-gateway-deployment.yaml
  49. 15
      samples/MicroserviceDemo/k8s/public-website-gateway-service.yaml
  50. 15
      samples/MicroserviceDemo/k8s/public-website-service.yaml
  51. 23
      samples/MicroserviceDemo/k8s/rabbitmq-deployment.yaml
  52. 12
      samples/MicroserviceDemo/k8s/rabbitmq-service.yaml
  53. 21
      samples/MicroserviceDemo/k8s/redis-deployment.yaml
  54. 14
      samples/MicroserviceDemo/k8s/redis-service.yaml
  55. 2
      samples/MicroserviceDemo/k8s/restore-database-job.yaml
  56. 34
      samples/MicroserviceDemo/k8s/sqlserver-deployment.yaml
  57. 15
      samples/MicroserviceDemo/k8s/sqlserver-service.yaml
  58. 2
      templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20190320125012_Initial.Designer.cs
  59. 0
      templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20190320125012_Initial.cs
  60. 4
      templates/module/app/MyCompanyName.MyProjectName.DemoApp/MyCompanyName.MyProjectName.DemoApp.csproj
  61. 4
      templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyProjectNameConsts.cs
  62. 2
      templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyProjectNameDomainModule.cs
  63. 53
      templates/mvc/src/MyCompanyName.MyProjectName.Domain/Users/AppUser.cs
  64. 12
      templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/MyProjectNameMigrationsDbContext.cs
  65. 22
      templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContext.cs
  66. 29
      templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContextFactory.cs
  67. 30
      templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContextModelCreatingExtensions.cs
  68. 16
      templates/mvc/src/MyCompanyName.MyProjectName.MongoDB/MongoDb/MyProjectNameMongoDbContext.cs
  69. 2
      templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/MyCompanyName.MyProjectName.Application.Tests.csproj
  70. 4
      templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/MyProjectNameApplicationTestModule.cs
  71. 26
      templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/Samples/SampleTest.cs
  72. 59
      templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/Samples/SampleTests.cs
  73. 6
      templates/service/host/IdentityServerHost/DemoAppDbContext.cs
  74. 8
      templates/service/host/IdentityServerHost/IdentityServerHost.csproj
  75. 299
      templates/service/host/IdentityServerHost/Migrations/20190320142333_Initial.Designer.cs
  76. 220
      templates/service/host/IdentityServerHost/Migrations/20190320142333_Initial.cs
  77. 297
      templates/service/host/IdentityServerHost/Migrations/DemoAppDbContextModelSnapshot.cs
  78. 5
      templates/service/host/IdentityServerHost/appsettings.json
  79. 3
      templates/service/host/MyCompanyName.MyProjectName.Host/DemoAppDbContext.cs
  80. 2
      templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20190320142412_Initial.Designer.cs
  81. 0
      templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20190320142412_Initial.cs
  82. 2
      templates/service/host/MyCompanyName.MyProjectName.Host/_CreateSqlServerCacheDatabase.bat
  83. 9
      templates/service/host/MyCompanyName.MyProjectName.Host/appsettings.json

4
abp_io/src/Volo.AbpWebSite.Web/Pages/Templates.cshtml

@ -14,7 +14,7 @@
@using (Html.BeginForm(FormMethod.Post))
{
<div class="row border">
<div class="col p-5 ">
<div class="col-lg-7 p-5 ">
<h2>
<span class="text-primary">Create</span>
<span class="text-success">New Project</span>
@ -64,7 +64,7 @@
</div>
</div>
<div class="col-md-5 bg-light p-5">
<div class="col-lg-5 bg-light p-5">
<h4>The Startup Project</h4>
<p>See <a href="/documents/abp/latest/Getting-Started-AspNetCore-MVC-Template" target="_blank">the documentation</a> to understand how to run the downloaded project.</p>

17
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/datatables/datatables-extensions.js

@ -338,6 +338,23 @@
}
}
configuration.language = {
info: localize("PagerInfo"),
infoFiltered: localize("PagerInfoFiltered"),
infoEmpty: localize("PagerInfoEmpty"),
search: localize("PagerSearch"),
processing: localize("ProcessingWithThreeDot"),
loadingRecords: localize("LoadingWithThreeDot"),
lengthMenu: localize("PagerShowMenuEntries"),
emptyTable: localize("NoDataAvailableInDatatable"),
paginate: {
first: localize("PagerFirst"),
last: localize("PagerLast"),
previous: localize("PagerPrevious"),
next: localize("PagerNext")
}
};
configuration.dom = '<"dataTable_filters"f>rt<"row dataTable_footer"<"col-auto"l><"col-auto"i><"col"p>>';
return configuration;

2
framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpDictionaryBasedStringLocalizer.cs

@ -206,7 +206,7 @@ namespace Volo.Abp.Localization
public IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures, bool includeBaseLocalizers)
{
return _innerLocalizer.GetAllStrings(includeParentCultures, includeBaseLocalizers);
return _innerLocalizer.GetAllStrings(_cultureName, includeParentCultures, includeBaseLocalizers);
}
}
}

11
framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json

@ -25,14 +25,23 @@
"Delete": "Delete",
"Edit": "Edit",
"ProcessingWithThreeDot": "Processing...",
"LoadingWithThreeDot": "Loading...",
"Welcome": "Welcome",
"Login": "Login",
"Register": "Register",
"Logout": "Log out",
"Submit": "Submit",
"Back": "Back",
"PagerSearch": "Search",
"PagerNext": "Next",
"PagerPrevious": "Previous",
"PagerInfo": "Showing {0} to {1} of {2} entries.",
"PagerFirst": "First",
"PagerLast": "Last",
"PagerInfo": "Showing _START_ to _END_ of _TOTAL_ entries",
"PagerInfoEmpty": "Showing 0 to 0 of 0 entries",
"PagerInfoFiltered": "(filtered from _MAX_ total entries)",
"NoDataAvailableInDatatable": "No data available in table",
"PagerShowMenuEntries": "Show _MENU_ entries",
"DatatableActionDropdownDefaultText": "Actions",
"ChangePassword": "Change password",
"PersonalInfo": "My profile"

11
framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/tr.json

@ -25,14 +25,23 @@
"Delete": "Sil",
"Edit": "Düzenle",
"ProcessingWithThreeDot": "İşleniyor...",
"LoadingWithThreeDot": "Yükleniyor...",
"Welcome": "Hoşgeldiniz",
"Login": "Giriş",
"Register": "Kaydol",
"Logout": "Çıkış",
"Submit": "Gönder",
"Back": "Geri",
"PagerSearch": "Ara",
"PagerNext": "Sonraki",
"PagerPrevious": "Önceki",
"PagerInfo": "{2} kayıttan {0} ile {1} arası gösteriliyor.",
"PagerFirst": "İlk",
"PagerLast": "Son",
"PagerInfo": "_TOTAL_ kayıttan _START_ ile _END_ arası gösteriliyor.",
"PagerInfoEmpty": "0 kayıttan 0 ile 0 arası gösteriliyor.",
"PagerInfoFiltered": "(_MAX_ kayıt arasından filtrelendi)",
"NoDataAvailableInDatatable": "Tabloda kayır mevcut değil.",
"PagerShowMenuEntries": "Sayfada _MENU_ kayıt göster.",
"DatatableActionDropdownDefaultText": "İşlemler",
"ChangePassword": "Şifre değiştir",
"PersonalInfo": "Profilim"

9
framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/zh-Hans.json

@ -25,14 +25,23 @@
"Delete": "删除",
"Edit": "修改",
"ProcessingWithThreeDot": "处理中...",
"LoadingWithThreeDot": "加载中...",
"Welcome": "欢迎",
"Login": "登录",
"Register": "注册",
"Logout": "注销",
"Submit": "提交",
"Back": "返回",
"PagerSearch": "搜索",
"PagerNext": "下一页",
"PagerPrevious": "上一页",
"PagerFirst": "首页",
"PagerLast": "尾页",
"PagerInfo": "显示 {0} 到 {1} 个 {2} 条目.",
"PagerInfoEmpty": "显示0个条目中的0到0",
"PagerInfoFiltered": "(从 _MAX_ 总条目中过滤掉)",
"NoDataAvailableInDatatable": "表中没有数据",
"PagerShowMenuEntries": "显示 _MENU_ 实体",
"DatatableActionDropdownDefaultText": "操作",
"ChangePassword": "修改密码",
"PersonalInfo": "个人信息"

6
modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/AccountController.cs

@ -47,6 +47,12 @@ namespace Volo.Abp.Account.Web.Areas.Account.Controllers
{
ValidateLoginInfo(login);
var identityUser = await _userManager.FindByNameAsync(login.UserNameOrEmailAddress);
if (identityUser == null)
{
return new AbpLoginResult(LoginResultType.InvalidUserNameOrPassword);
}
return GetAbpLoginResult(await _signInManager.CheckPasswordSignInAsync(identityUser, login.Password, true));
}

5
modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/zh-Hans.json

@ -14,8 +14,9 @@
"Login": "登录",
"Cancel": "取消",
"Register": "注册",
"InvalidLoginRequest": "无效的登录请求",
"UseAnotherServiceToLogIn.": "使用其他服务登录.",
"InvalidLoginRequest": "登录请求无效",
"ThereAreNoLoginSchemesConfiguredForThisClient": "没有为此客户端配置登录方案.",
"LogInUsingYourProviderAccount": "使用你的 {0} 账号登录"
"LogInUsingYourProviderAccount": "使用你的{0}帐户登录"
}
}

2
modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs

@ -27,7 +27,7 @@ namespace Volo.Blogging.EntityFrameworkCore
{
b.ToTable(options.TablePrefix + "Users", options.Schema);
b.ConfigureAbpUser(options);
b.ConfigureAbpUser();
b.ConfigureExtraProperties();
});

10
modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hans.json

@ -0,0 +1,10 @@
{
"culture": "zh-Hans",
"texts": {
"Permission:DocumentManagement": "文档管理",
"Permission:Projects": "项目",
"Permission:Edit": "编辑",
"Permission:Delete": "删除",
"Permission:Create": "创建"
}
}

26
modules/docs/src/Volo.Docs.Admin.Web/Localization/Resources/Docs/Web/zh-Hans.json

@ -0,0 +1,26 @@
{
"culture": "zh-Hans",
"texts": {
"Menu:DocumentManagement": "文档",
"Menu:ProjectManagement": "项目",
"CreateANewProject": "创建新项目",
"Edit": "编辑",
"Create": "创建",
"Projects": "项目",
"Name": "名称",
"ShortName": "简称",
"DocumentStoreType": "文件存储类型",
"Format": "格式",
"ShortNameInfoText": "将用于唯一的URL.",
"DisplayName:Name": "名称",
"DisplayName:ShortName": "简称",
"DisplayName:Format": "格式",
"DisplayName:DefaultDocumentName": "默认文档名称",
"DisplayName:NavigationDocumentName": "导航文档名称",
"DisplayName:MinimumVersion": "最低版本",
"DisplayName:MainWebsiteUrl": "主网站网址",
"DisplayName:LatestVersionBranchName": "最新版本的分支名称",
"DisplayName:GitHubRootUrl": "GitHub根网址",
"DisplayName:GitHubAccessToken": "GitHub访问令牌"
}
}

15
modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/zh-Hans.json

@ -2,14 +2,17 @@
"culture": "zh-Hans",
"texts": {
"Documents": "文档",
"BackToWebsite": "返回网站",
"BackToWebsite": "返回主网站",
"Contributors": "贡献者",
"ShareOn": "分享到",
"Version": "版本",
"Edit": "编辑",
"InThisDocument": "在这个文档中",
"GoToTop": "返回顶部",
"Delete": "删除",
"InThisDocument": "在本文中",
"GoToTop": "到顶部",
"Projects": "项目",
"NoProjectWarning": "当前并没有项目!",
"DocumentNotFound": "抱歉,您请求的文档不存在!",
"NavigationDocumentNotFound": "此版本并没有导航文档!"
"NoProjectWarning": "没有项目!",
"DocumentNotFound": "找不到请求的文档!",
"NavigationDocumentNotFound": "这个版本没有导航文件!"
}
}

6
modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Localization/ApplicationContracts/zh-Hans.json

@ -1,12 +1,14 @@
{
"culture": "zh-Hans",
"texts": {
"Permission:IdentityManagement": "身份认证管理",
"Volo.Abp.Identity:010001": "您无法删除自己的帐户!",
"Permission:IdentityManagement": "身份标识管理",
"Permission:RoleManagement": "角色管理",
"Permission:Create": "创建",
"Permission:Edit": "编辑",
"Permission:Delete": "删除",
"Permission:ChangePermissions": "更改权限",
"Permission:UserManagement": "用户管理"
"Permission:UserManagement": "用户管理",
"Permission:UserLookup": "用户查询"
}
}

2
modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs

@ -80,7 +80,7 @@ namespace Volo.Abp.Identity
[Authorize(IdentityPermissions.Users.Delete)]
public async Task DeleteAsync(Guid id)
{
if (CurrentUser.Id.Value == id)
if (CurrentUser.Id == id)
{
throw new BusinessException(code: IdentityErrorCodes.UserSelfDeletion);
}

2
modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContextModelBuilderExtensions.cs

@ -25,7 +25,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
b.ConfigureFullAudited();
b.ConfigureExtraProperties();
b.ConfigureConcurrencyStamp();
b.ConfigureAbpUser(options);
b.ConfigureAbpUser();
b.Property(u => u.NormalizedUserName).IsRequired().HasMaxLength(IdentityUserConsts.MaxNormalizedUserNameLength).HasColumnName(nameof(IdentityUser.NormalizedUserName));
b.Property(u => u.NormalizedEmail).HasMaxLength(IdentityUserConsts.MaxNormalizedEmailLength).HasColumnName(nameof(IdentityUser.NormalizedEmail));

1
modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml

@ -31,7 +31,6 @@
}
</abp-tab>
</abp-tabs>
<div asp-validation-summary="All"></div>
</abp-modal-body>
<abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)"></abp-modal-footer>
</abp-modal>

1
modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml

@ -32,7 +32,6 @@
}
</abp-tab>
</abp-tabs>
<div asp-validation-summary="All"></div>
</abp-modal-body>
<abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)"></abp-modal-footer>
</abp-modal>

4
modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/zh-Hans.json

@ -1,6 +1,8 @@
{
"culture": "zh-Hans",
"texts": {
"Permissions": "权限"
"Permissions": "权限",
"OnlyProviderPermissons": "只有这个提供商",
"All": "所有"
}
}

25
modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml

@ -14,23 +14,24 @@
<abp-modal-body>
<input asp-for="@Model.ProviderKey" />
<input asp-for="@Model.ProviderName" />
<abp-tabs tab-style="PillVertical" vertical-header-size="_4">
<abp-tabs name="PermissionsTabs" tab-style="PillVertical" vertical-header-size="_4">
@for (var i = 0; i < Model.Groups.Count; i++)
{
<abp-tab title="@Model.Groups[i].DisplayName" name="v-pills-tab-@Model.Groups[i].GetNormalizedGroupName()">
<h4>@Model.Groups[i].DisplayName</h4>
<hr class="mt-3 mb-4" />
@for (var j = 0; j < Model.Groups[i].Permissions.Count; j++)
{
<abp-input asp-for="@Model.Groups[i].Permissions[j].IsGranted"
label="@Model.Groups[i].Permissions[j].GetShownName(Model.ProviderName)"
disabled="@Model.Groups[i].Permissions[j].IsDisabled(Model.ProviderName)"
group-data-permission-name="@Model.Groups[i].Permissions[j].Name"
group-data-parent-name="@(Model.Groups[i].Permissions[j].ParentName ?? "")"
group-style="margin-left: @(Model.Groups[i].Permissions[j].Depth * 20)px" />
<input asp-for="@Model.Groups[i].Permissions[j].Name" />
}
<div class="pl-1 pt-1" style="height: 450px; overflow: auto;">
@for (var j = 0; j < Model.Groups[i].Permissions.Count; j++)
{
<abp-input asp-for="@Model.Groups[i].Permissions[j].IsGranted"
label="@Model.Groups[i].Permissions[j].GetShownName(Model.ProviderName)"
disabled="@Model.Groups[i].Permissions[j].IsDisabled(Model.ProviderName)"
group-data-permission-name="@Model.Groups[i].Permissions[j].Name"
group-data-parent-name="@(Model.Groups[i].Permissions[j].ParentName ?? "")"
group-style="margin-left: @(Model.Groups[i].Permissions[j].Depth * 20)px" />
<input asp-for="@Model.Groups[i].Permissions[j].Name" />
}
</div>
</abp-tab>
}
</abp-tabs>

15
modules/setting-management/src/Volo.Abp.SettingManagement.Web/AbpSettingManagementWebModule.cs

@ -1,5 +1,7 @@
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.SettingManagement.Localization;
using Volo.Abp.SettingManagement.Web.Navigation;
using Volo.Abp.UI.Navigation;
using Volo.Abp.VirtualFileSystem;
@ -22,6 +24,19 @@ namespace Volo.Abp.SettingManagement.Web
{
options.FileSets.AddEmbedded<AbpSettingManagementWebModule>("Volo.Abp.SettingManagement.Web");
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Add<AbpSettingManagementResource>("en");
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<AbpSettingManagementResource>()
.AddVirtualJson("/Localization/Resources/AbpSettingManagement");
});
}
}
}

10
modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/AbpSettingManagementResource.cs

@ -0,0 +1,10 @@
using Volo.Abp.Localization;
namespace Volo.Abp.SettingManagement.Localization
{
[LocalizationResourceName("AbpSettingManagement")]
public class AbpSettingManagementResource
{
}
}

6
modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/Resources/AbpSettingManagement/en.json

@ -0,0 +1,6 @@
{
"culture": "en",
"texts": {
"Settings": "Settings"
}
}

6
modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/Resources/AbpSettingManagement/tr.json

@ -0,0 +1,6 @@
{
"culture": "tr",
"texts": {
"Settings": "Ayarlar"
}
}

6
modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/Resources/AbpSettingManagement/zh-Hans.json

@ -0,0 +1,6 @@
{
"culture": "zh-Hans",
"texts": {
"Settings": "设置"
}
}

7
modules/setting-management/src/Volo.Abp.SettingManagement.Web/Navigation/SettingManagementMainMenuContributor.cs

@ -1,7 +1,9 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Options;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.SettingManagement.Localization;
using Volo.Abp.SettingManagement.Web.Pages.SettingManagement;
using Volo.Abp.UI.Navigation;
@ -22,15 +24,14 @@ namespace Volo.Abp.SettingManagement.Web.Navigation
return Task.CompletedTask;
}
//TODO: Localize
//var l = context.ServiceProvider.GetRequiredService<IStringLocalizer<IdentityResource>>();
var l = context.ServiceProvider.GetRequiredService<IStringLocalizer<AbpSettingManagementResource>>();
context.Menu
.GetAdministration()
.AddItem(
new ApplicationMenuItem(
SettingManagementMenuNames.GroupName,
"Settings",
l["Settings"],
"/SettingManagement",
icon: "fa fa-cog"
)

37
modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml

@ -1,11 +1,14 @@
@page
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.SettingManagement.Localization
@using Volo.Abp.SettingManagement.Web.Navigation
@using Volo.Abp.SettingManagement.Web.Pages.SettingManagement
@model IndexModel
@inject IHtmlLocalizer<AbpSettingManagementResource> L
@inject IPageLayout PageLayout
@{
PageLayout.Content.Title = /*L["Settings"].Value*/ "Settings";
PageLayout.Content.Title = L["Settings"].Value;
PageLayout.Content.MenuItemName = SettingManagementMenuNames.GroupName;
}
@section scripts {
@ -14,21 +17,21 @@
</abp-script-bundle>
}
<div id="SettingManagementWrapper">
<abp-card>
<abp-card-body>
<div id="SettingManagementWrapper">
<abp-card>
<abp-card-body>
<abp-tabs tab-style="PillVertical" vertical-header-size="_3">
@foreach (var group in Model.SettingPageCreationContext.Groups)
{
<abp-tab title="@group.DisplayName">
<abp-tabs tab-style="PillVertical" vertical-header-size="_3">
@foreach (var group in Model.SettingPageCreationContext.Groups)
{
<abp-tab title="@group.DisplayName">
<h2>@group.DisplayName</h2>
<hr class="my-4" />
@await Component.InvokeAsync(group.ComponentType)
</abp-tab>
}
</abp-tabs>
</abp-card-body>
</abp-card>
</div>
<h2>@group.DisplayName</h2>
<hr class="my-4" />
@await Component.InvokeAsync(group.ComponentType)
</abp-tab>
}
</abp-tabs>
</abp-card-body>
</abp-card>
</div>

2
modules/setting-management/src/Volo.Abp.SettingManagement.Web/Volo.Abp.SettingManagement.Web.csproj

@ -14,6 +14,7 @@
<ItemGroup>
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared\Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Localization\Volo.Abp.Localization.csproj" />
</ItemGroup>
<ItemGroup>
@ -25,7 +26,6 @@
<Content Remove="Pages\**\*.cshtml" />
<Content Remove="Pages\**\*.js" />
<Content Remove="Pages\**\*.css" />
<Content Remove="Localization\Resources\**\*.json" />
<Content Remove="Properties\launchSettings.json" />
<None Remove="Pages\Identity\Shared\personal-settings-modal.js" />
<None Include="Properties\launchSettings.json" />

3
modules/users/src/Volo.Abp.Users.EntityFrameworkCore/Volo/Abp/Users/EntityFrameworkCore/AbpUsersDbContextModelCreatingExtensions.cs

@ -1,12 +1,11 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace Volo.Abp.Users.EntityFrameworkCore
{
public static class AbpUsersDbContextModelCreatingExtensions
{
public static void ConfigureAbpUser<TUser>(this EntityTypeBuilder<TUser> b, ModelBuilderConfigurationOptions options)
public static void ConfigureAbpUser<TUser>(this EntityTypeBuilder<TUser> b)
where TUser : class, IUser
{
b.Property(u => u.TenantId).HasColumnName(nameof(IUser.TenantId));

44
samples/MicroserviceDemo/k8s/auth-server-deployment.yaml

@ -1,33 +1,31 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
io.kompose.service: auth-server
name: auth-server
spec:
selector:
matchLabels:
app: auth-server
replicas: 1
strategy: {}
template:
metadata:
labels:
io.kompose.service: auth-server
app: auth-server
spec:
containers:
- env:
- name: ASPNETCORE_ENVIRONMENT
value: Development
- name: ASPNETCORE_URLS
value: http://0.0.0.0:51511
- name: ConnectionStrings__Default
value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
- name: RabbitMQ__Connections__Default__HostName
value: rabbitmq
- name: Redis__Configuration
value: redis
image: volosoft/microservice-demo-auth-server
name: auth-server
ports:
- containerPort: 51511
resources: {}
restartPolicy: Always
status: {}
- name: auth-server
image: "volosoft/microservice-demo-auth-server"
env:
- name: ASPNETCORE_ENVIRONMENT
value: Development
- name: ASPNETCORE_URLS
value: http://0.0.0.0:51511
- name: ConnectionStrings__Default
value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
- name: RabbitMQ__Connections__Default__HostName
value: rabbitmq
- name: Redis__Configuration
value: redis
ports:
- name: http
containerPort: 51511

15
samples/MicroserviceDemo/k8s/auth-server-service.yaml

@ -1,14 +1,11 @@
apiVersion: v1
kind: Service
apiVersion: v1
metadata:
labels:
io.kompose.service: auth-server
name: auth-server
spec:
ports:
- port: 51511
targetPort: 51511
selector:
io.kompose.service: auth-server
status:
loadBalancer: {}
app: auth-server
ports:
- protocol: TCP
port: 51511
targetPort: http

44
samples/MicroserviceDemo/k8s/backend-admin-app-deployment.yaml

@ -1,33 +1,31 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
io.kompose.service: backend-admin-app
name: backend-admin-app
spec:
selector:
matchLabels:
app: backend-admin-app
replicas: 1
strategy: {}
template:
metadata:
labels:
io.kompose.service: backend-admin-app
app: backend-admin-app
spec:
containers:
- env:
- name: ASPNETCORE_ENVIRONMENT
value: Development
- name: ASPNETCORE_URLS
value: http://0.0.0.0:80
- name: AuthServer__Authority
value: http://auth-server:51511
- name: Redis__Configuration
value: redis
- name: RemoteServices__Default__BaseUrl
value: http://backend-admin-app-gateway/
image: volosoft/microservice-demo-backend-admin-app
name: backend-admin-app
ports:
- containerPort: 80
resources: {}
restartPolicy: Always
status: {}
- name: backend-admin-app
image: "volosoft/microservice-demo-backend-admin-app"
env:
- name: ASPNETCORE_ENVIRONMENT
value: Development
- name: ASPNETCORE_URLS
value: http://0.0.0.0:80
- name: AuthServer__Authority
value: http://auth-server:51511
- name: Redis__Configuration
value: redis
- name: RemoteServices__Default__BaseUrl
value: http://backend-admin-app-gateway/
ports:
- name: http
containerPort: 80

68
samples/MicroserviceDemo/k8s/backend-admin-app-gateway-deployment.yaml

@ -1,45 +1,43 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
io.kompose.service: backend-admin-app-gateway
name: backend-admin-app-gateway
spec:
selector:
matchLabels:
app: backend-admin-app-gateway
replicas: 1
strategy: {}
template:
metadata:
labels:
io.kompose.service: backend-admin-app-gateway
app: backend-admin-app-gateway
spec:
containers:
- env:
- name: ASPNETCORE_ENVIRONMENT
value: Development
- name: ASPNETCORE_URLS
value: http://0.0.0.0:80
- name: AuthServer__Authority
value: http://auth-server:51511
- name: ConnectionStrings__Default
value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
- name: GlobalConfiguration__BaseUrl
value: http://backend-admin-app-gateway
- name: ReRoutes__0__DownstreamHostAndPorts__0__Host
value: identity-service
- name: ReRoutes__0__DownstreamHostAndPorts__0__Port
value: "80"
- name: ReRoutes__1__DownstreamHostAndPorts__0__Host
value: product-service
- name: ReRoutes__1__DownstreamHostAndPorts__0__Port
value: "80"
- name: Redis__Configuration
value: redis
- name: RemoteServices__Default__BaseUrl
value: http://backend-admin-app-gateway/
image: volosoft/microservice-demo-backend-admin-app-gateway
name: backend-admin-app-gateway
ports:
- containerPort: 80
resources: {}
restartPolicy: Always
status: {}
- name: backend-admin-app-gateway
image: "volosoft/microservice-demo-backend-admin-app-gateway"
env:
- name: ASPNETCORE_ENVIRONMENT
value: Development
- name: ASPNETCORE_URLS
value: http://0.0.0.0:80
- name: AuthServer__Authority
value: http://auth-server:51511
- name: ConnectionStrings__Default
value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
- name: GlobalConfiguration__BaseUrl
value: http://backend-admin-app-gateway
- name: ReRoutes__0__DownstreamHostAndPorts__0__Host
value: identity-service
- name: ReRoutes__0__DownstreamHostAndPorts__0__Port
value: "80"
- name: ReRoutes__1__DownstreamHostAndPorts__0__Host
value: product-service
- name: ReRoutes__1__DownstreamHostAndPorts__0__Port
value: "80"
- name: Redis__Configuration
value: redis
- name: RemoteServices__Default__BaseUrl
value: http://backend-admin-app-gateway/
ports:
- name: http
containerPort: 80

15
samples/MicroserviceDemo/k8s/backend-admin-app-gateway-service.yaml

@ -1,14 +1,11 @@
apiVersion: v1
kind: Service
apiVersion: v1
metadata:
labels:
io.kompose.service: backend-admin-app-gateway
name: backend-admin-app-gateway
spec:
ports:
- port: 80
targetPort: 80
selector:
io.kompose.service: backend-admin-app-gateway
status:
loadBalancer: {}
app: backend-admin-app-gateway
ports:
- protocol: TCP
port: 80
targetPort: http

15
samples/MicroserviceDemo/k8s/backend-admin-app-service.yaml

@ -1,14 +1,11 @@
apiVersion: v1
kind: Service
apiVersion: v1
metadata:
labels:
io.kompose.service: backend-admin-app
name: backend-admin-app
spec:
ports:
- port: 80
targetPort: 80
selector:
io.kompose.service: backend-admin-app
status:
loadBalancer: {}
app: backend-admin-app
ports:
- protocol: TCP
port: 80
targetPort: http

56
samples/MicroserviceDemo/k8s/blogging-service-deployment.yaml

@ -1,39 +1,37 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
io.kompose.service: blogging-service
name: blogging-service
spec:
selector:
matchLabels:
app: blogging-service
replicas: 1
strategy: {}
template:
metadata:
labels:
io.kompose.service: blogging-service
app: blogging-service
spec:
containers:
- env:
- name: ASPNETCORE_ENVIRONMENT
value: Development
- name: ASPNETCORE_URLS
value: http://0.0.0.0:80
- name: AuthServer__Authority
value: http://auth-server:51511
- name: ConnectionStrings__Blogging
value: mongodb://mongodb|MsDemo_Blogging
- name: ConnectionStrings__Default
value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
- name: RabbitMQ__Connections__Default__HostName
value: rabbitmq
- name: Redis__Configuration
value: redis
- name: RemoteServices__Default__BaseUrl
value: http://internal-gateway/
image: volosoft/microservice-demo-blogging-service
name: blogging-service
ports:
- containerPort: 80
resources: {}
restartPolicy: Always
status: {}
- name: blogging-service
image: "volosoft/microservice-demo-blogging-service"
env:
- name: ASPNETCORE_ENVIRONMENT
value: Development
- name: ASPNETCORE_URLS
value: http://0.0.0.0:80
- name: AuthServer__Authority
value: http://auth-server:51511
- name: ConnectionStrings__Blogging
value: mongodb://mongodb|MsDemo_Blogging
- name: ConnectionStrings__Default
value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
- name: RabbitMQ__Connections__Default__HostName
value: rabbitmq
- name: Redis__Configuration
value: redis
- name: RemoteServices__Default__BaseUrl
value: http://internal-gateway/
ports:
- name: http
containerPort: 80

15
samples/MicroserviceDemo/k8s/blogging-service-service.yaml

@ -1,14 +1,11 @@
apiVersion: v1
kind: Service
apiVersion: v1
metadata:
labels:
io.kompose.service: blogging-service
name: blogging-service
spec:
ports:
- port: 80
targetPort: 80
selector:
io.kompose.service: blogging-service
status:
loadBalancer: {}
app: blogging-service
ports:
- protocol: TCP
port: 80
targetPort: http

3
samples/MicroserviceDemo/k8s/dbdata-persistentvolumeclaim.yaml

@ -1,8 +1,6 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
io.kompose.service: dbdata
name: dbdata
spec:
accessModes:
@ -10,4 +8,3 @@ spec:
resources:
requests:
storage: 500Mi
status: {}

12
samples/MicroserviceDemo/k8s/expose-service.yaml

@ -1,13 +1,11 @@
apiVersion: v1
kind: Service
metadata:
labels:
io.kompose.service: auth-server
name: auth-server-expose
spec:
type: LoadBalancer
selector:
io.kompose.service: auth-server
app: auth-server
ports:
- protocol: TCP
port: 51511
@ -17,13 +15,11 @@ spec:
apiVersion: v1
kind: Service
metadata:
labels:
io.kompose.service: backend-admin-app
name: backend-admin-app-expose
spec:
type: LoadBalancer
selector:
io.kompose.service: backend-admin-app
app: backend-admin-app
ports:
- protocol: TCP
port: 80
@ -33,13 +29,11 @@ spec:
apiVersion: v1
kind: Service
metadata:
labels:
io.kompose.service: public-website
name: public-website-expose
spec:
type: LoadBalancer
selector:
io.kompose.service: public-website
app: public-website
ports:
- protocol: TCP
port: 80

48
samples/MicroserviceDemo/k8s/identity-service-deployment.yaml

@ -1,35 +1,33 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
io.kompose.service: identity-service
name: identity-service
spec:
selector:
matchLabels:
app: identity-service
replicas: 1
strategy: {}
template:
metadata:
labels:
io.kompose.service: identity-service
app: identity-service
spec:
containers:
- env:
- name: ASPNETCORE_ENVIRONMENT
value: Development
- name: ASPNETCORE_URLS
value: http://0.0.0.0:80
- name: AuthServer__Authority
value: http://auth-server:51511
- name: ConnectionStrings__Default
value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
- name: RabbitMQ__Connections__Default__HostName
value: rabbitmq
- name: Redis__Configuration
value: redis
image: volosoft/microservice-demo-identity-service
name: identity-service
ports:
- containerPort: 80
resources: {}
restartPolicy: Always
status: {}
- name: identity-service
image: "volosoft/microservice-demo-identity-service"
env:
- name: ASPNETCORE_ENVIRONMENT
value: Development
- name: ASPNETCORE_URLS
value: http://0.0.0.0:80
- name: AuthServer__Authority
value: http://auth-server:51511
- name: ConnectionStrings__Default
value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
- name: RabbitMQ__Connections__Default__HostName
value: rabbitmq
- name: Redis__Configuration
value: redis
ports:
- name: http
containerPort: 80

15
samples/MicroserviceDemo/k8s/identity-service-service.yaml

@ -1,14 +1,11 @@
apiVersion: v1
kind: Service
apiVersion: v1
metadata:
labels:
io.kompose.service: identity-service
name: identity-service
spec:
ports:
- port: 80
targetPort: 80
selector:
io.kompose.service: identity-service
status:
loadBalancer: {}
app: identity-service
ports:
- protocol: TCP
port: 80
targetPort: http

72
samples/MicroserviceDemo/k8s/internal-gateway-deployment.yaml

@ -1,47 +1,45 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
io.kompose.service: internal-gateway
name: internal-gateway
spec:
selector:
matchLabels:
app: internal-gateway
replicas: 1
strategy: {}
template:
metadata:
labels:
io.kompose.service: internal-gateway
app: internal-gateway
spec:
containers:
- env:
- name: ASPNETCORE_ENVIRONMENT
value: Development
- name: ASPNETCORE_URLS
value: http://0.0.0.0:80
- name: AuthServer__Authority
value: http://auth-server:51511
- name: ConnectionStrings__Default
value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
- name: GlobalConfiguration__BaseUrl
value: http://internal-gateway
- name: ReRoutes__0__DownstreamHostAndPorts__0__Host
value: identity-service
- name: ReRoutes__0__DownstreamHostAndPorts__0__Port
value: "80"
- name: ReRoutes__1__DownstreamHostAndPorts__0__Host
value: product-service
- name: ReRoutes__1__DownstreamHostAndPorts__0__Port
value: "80"
- name: ReRoutes__2__DownstreamHostAndPorts__0__Host
value: blogging-service
- name: ReRoutes__2__DownstreamHostAndPorts__0__Port
value: "80"
- name: Redis__Configuration
value: redis
image: volosoft/microservice-demo-internal-gateway
name: internal-gateway
ports:
- containerPort: 80
resources: {}
restartPolicy: Always
status: {}
- name: internal-gateway
image: "volosoft/microservice-demo-internal-gateway"
env:
- name: ASPNETCORE_ENVIRONMENT
value: Development
- name: ASPNETCORE_URLS
value: http://0.0.0.0:80
- name: AuthServer__Authority
value: http://auth-server:51511
- name: ConnectionStrings__Default
value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
- name: GlobalConfiguration__BaseUrl
value: http://internal-gateway
- name: ReRoutes__0__DownstreamHostAndPorts__0__Host
value: identity-service
- name: ReRoutes__0__DownstreamHostAndPorts__0__Port
value: "80"
- name: ReRoutes__1__DownstreamHostAndPorts__0__Host
value: product-service
- name: ReRoutes__1__DownstreamHostAndPorts__0__Port
value: "80"
- name: ReRoutes__2__DownstreamHostAndPorts__0__Host
value: blogging-service
- name: ReRoutes__2__DownstreamHostAndPorts__0__Port
value: "80"
- name: Redis__Configuration
value: redis
ports:
- name: http
containerPort: 80

15
samples/MicroserviceDemo/k8s/internal-gateway-service.yaml

@ -1,14 +1,11 @@
apiVersion: v1
kind: Service
apiVersion: v1
metadata:
labels:
io.kompose.service: internal-gateway
name: internal-gateway
spec:
ports:
- port: 80
targetPort: 80
selector:
io.kompose.service: internal-gateway
status:
loadBalancer: {}
app: internal-gateway
ports:
- protocol: TCP
port: 80
targetPort: http

21
samples/MicroserviceDemo/k8s/mongodb-deployment.yaml

@ -1,22 +1,19 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
io.kompose.service: mongodb
name: mongodb
spec:
selector:
matchLabels:
app: mongodb
replicas: 1
strategy: {}
template:
metadata:
labels:
io.kompose.service: mongodb
app: mongodb
spec:
containers:
- image: mongo
name: mongodb
ports:
- containerPort: 27017
resources: {}
restartPolicy: Always
status: {}
- name: mongodb
image: "mongo"
ports:
- containerPort: 27017

12
samples/MicroserviceDemo/k8s/mongodb-service.yaml

@ -1,14 +1,10 @@
apiVersion: v1
kind: Service
apiVersion: v1
metadata:
labels:
io.kompose.service: mongodb
name: mongodb
spec:
selector:
app: mongodb
ports:
- port: 27017
targetPort: 27017
selector:
io.kompose.service: mongodb
status:
loadBalancer: {}
targetPort: 27017

54
samples/MicroserviceDemo/k8s/product-service-deployment.yaml

@ -1,38 +1,36 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
io.kompose.service: product-service
name: product-service
spec:
selector:
matchLabels:
app: product-service
replicas: 1
strategy: {}
template:
metadata:
labels:
io.kompose.service: product-service
app: product-service
spec:
containers:
- env:
- name: ASPNETCORE_ENVIRONMENT
value: Development
- name: ASPNETCORE_URLS
value: http://0.0.0.0:80
- name: AuthServer__Authority
value: http://auth-server:51511
- name: ConnectionStrings__Default
value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated
Security=false
- name: ConnectionStrings__ProductManagement
value: Server=sqlserver;Database=MsDemo_ProductManagement;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
- name: RabbitMQ__Connections__Default__HostName
value: rabbitmq
- name: Redis__Configuration
value: redis
image: volosoft/microservice-demo-product-service
name: product-service
ports:
- containerPort: 80
resources: {}
restartPolicy: Always
status: {}
- name: product-service
image: "volosoft/microservice-demo-product-service"
env:
- name: ASPNETCORE_ENVIRONMENT
value: Development
- name: ASPNETCORE_URLS
value: http://0.0.0.0:80
- name: AuthServer__Authority
value: http://auth-server:51511
- name: ConnectionStrings__Default
value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated
Security=false
- name: ConnectionStrings__ProductManagement
value: Server=sqlserver;Database=MsDemo_ProductManagement;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
- name: RabbitMQ__Connections__Default__HostName
value: rabbitmq
- name: Redis__Configuration
value: redis
ports:
- name: http
containerPort: 80

15
samples/MicroserviceDemo/k8s/product-service-service.yaml

@ -1,14 +1,11 @@
apiVersion: v1
kind: Service
apiVersion: v1
metadata:
labels:
io.kompose.service: product-service
name: product-service
spec:
ports:
- port: 80
targetPort: 80
selector:
io.kompose.service: product-service
status:
loadBalancer: {}
app: product-service
ports:
- protocol: TCP
port: 80
targetPort: http

44
samples/MicroserviceDemo/k8s/public-website-deployment.yaml

@ -1,33 +1,31 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
io.kompose.service: public-website
name: public-website
spec:
selector:
matchLabels:
app: public-website
replicas: 1
strategy: {}
template:
metadata:
labels:
io.kompose.service: public-website
app: public-website
spec:
containers:
- env:
- name: ASPNETCORE_ENVIRONMENT
value: Development
- name: ASPNETCORE_URLS
value: http://0.0.0.0:80
- name: AuthServer__Authority
value: http://auth-server:51511
- name: Redis__Configuration
value: redis
- name: RemoteServices__Default__BaseUrl
value: http://public-website-gateway/
image: volosoft/microservice-demo-public-website
name: public-website
ports:
- containerPort: 80
resources: {}
restartPolicy: Always
status: {}
- name: public-website
image: "volosoft/microservice-demo-public-website"
env:
- name: ASPNETCORE_ENVIRONMENT
value: Development
- name: ASPNETCORE_URLS
value: http://0.0.0.0:80
- name: AuthServer__Authority
value: http://auth-server:51511
- name: Redis__Configuration
value: redis
- name: RemoteServices__Default__BaseUrl
value: http://public-website-gateway/
ports:
- name: http
containerPort: 80

64
samples/MicroserviceDemo/k8s/public-website-gateway-deployment.yaml

@ -1,43 +1,41 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
io.kompose.service: public-website-gateway
name: public-website-gateway
spec:
selector:
matchLabels:
app: public-website-gateway
replicas: 1
strategy: {}
template:
metadata:
labels:
io.kompose.service: public-website-gateway
app: public-website-gateway
spec:
containers:
- env:
- name: ASPNETCORE_ENVIRONMENT
value: Development
- name: ASPNETCORE_URLS
value: http://0.0.0.0:80
- name: AuthServer__Authority
value: http://auth-server:51511
- name: ConnectionStrings__Default
value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
- name: GlobalConfiguration__BaseUrl
value: http://public-website-gateway
- name: ReRoutes__0__DownstreamHostAndPorts__0__Host
value: product-service
- name: ReRoutes__0__DownstreamHostAndPorts__0__Port
value: "80"
- name: ReRoutes__1__DownstreamHostAndPorts__0__Host
value: blogging-service
- name: ReRoutes__1__DownstreamHostAndPorts__0__Port
value: "80"
- name: Redis__Configuration
value: redis
image: volosoft/microservice-demo-public-website-gateway
name: public-website-gateway
ports:
- containerPort: 80
resources: {}
restartPolicy: Always
status: {}
- name: public-website-gateway
image: "volosoft/microservice-demo-public-website-gateway"
env:
- name: ASPNETCORE_ENVIRONMENT
value: Development
- name: ASPNETCORE_URLS
value: http://0.0.0.0:80
- name: AuthServer__Authority
value: http://auth-server:51511
- name: ConnectionStrings__Default
value: Server=sqlserver;Database=MsDemo_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false
- name: GlobalConfiguration__BaseUrl
value: http://public-website-gateway
- name: ReRoutes__0__DownstreamHostAndPorts__0__Host
value: product-service
- name: ReRoutes__0__DownstreamHostAndPorts__0__Port
value: "80"
- name: ReRoutes__1__DownstreamHostAndPorts__0__Host
value: blogging-service
- name: ReRoutes__1__DownstreamHostAndPorts__0__Port
value: "80"
- name: Redis__Configuration
value: redis
ports:
- name: http
containerPort: 80

15
samples/MicroserviceDemo/k8s/public-website-gateway-service.yaml

@ -1,14 +1,11 @@
apiVersion: v1
kind: Service
apiVersion: v1
metadata:
labels:
io.kompose.service: public-website-gateway
name: public-website-gateway
spec:
ports:
- port: 80
targetPort: 80
selector:
io.kompose.service: public-website-gateway
status:
loadBalancer: {}
app: public-website-gateway
ports:
- protocol: TCP
port: 80
targetPort: http

15
samples/MicroserviceDemo/k8s/public-website-service.yaml

@ -1,14 +1,11 @@
apiVersion: v1
kind: Service
apiVersion: v1
metadata:
labels:
io.kompose.service: public-website
name: public-website
spec:
ports:
- port: 80
targetPort: 80
selector:
io.kompose.service: public-website
status:
loadBalancer: {}
app: public-website
ports:
- protocol: TCP
port: 80
targetPort: http

23
samples/MicroserviceDemo/k8s/rabbitmq-deployment.yaml

@ -1,23 +1,20 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
io.kompose.service: rabbitmq
name: rabbitmq
spec:
selector:
matchLabels:
app: rabbitmq
replicas: 1
strategy: {}
template:
metadata:
labels:
io.kompose.service: rabbitmq
app: rabbitmq
spec:
containers:
- image: rabbitmq:3-management-alpine
name: rabbitmq
ports:
- containerPort: 5672
- containerPort: 15672
resources: {}
restartPolicy: Always
status: {}
- name: rabbitmq
image: "rabbitmq:3-management-alpine"
ports:
- containerPort: 5672
- containerPort: 15672

12
samples/MicroserviceDemo/k8s/rabbitmq-service.yaml

@ -1,18 +1,14 @@
apiVersion: v1
kind: Service
apiVersion: v1
metadata:
labels:
io.kompose.service: rabbitmq
name: rabbitmq
spec:
selector:
app: rabbitmq
ports:
- name: "5672"
port: 5672
targetPort: 5672
- name: "15672"
port: 15672
targetPort: 15672
selector:
io.kompose.service: rabbitmq
status:
loadBalancer: {}
targetPort: 15672

21
samples/MicroserviceDemo/k8s/redis-deployment.yaml

@ -1,22 +1,19 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
io.kompose.service: redis
name: redis
spec:
selector:
matchLabels:
app: redis
replicas: 1
strategy: {}
template:
metadata:
labels:
io.kompose.service: redis
app: redis
spec:
containers:
- image: redis
name: redis
ports:
- containerPort: 6379
resources: {}
restartPolicy: Always
status: {}
- name: redis
image: "redis"
ports:
- containerPort: 6379

14
samples/MicroserviceDemo/k8s/redis-service.yaml

@ -1,14 +1,10 @@
apiVersion: v1
kind: Service
apiVersion: v1
metadata:
labels:
io.kompose.service: redis
name: redis
spec:
ports:
- port: 6379
targetPort: 6379
selector:
io.kompose.service: redis
status:
loadBalancer: {}
app: redis
ports:
- port: 6379
targetPort: 6379

2
samples/MicroserviceDemo/k8s/restore-database-job.yaml

@ -12,7 +12,7 @@ spec:
- name: SA_PASSWORD
value: yourStrong(!)Password
name: restore-database
image: volosoft/microservice-demo-restore-database
image: "volosoft/microservice-demo-restore-database"
volumeMounts:
- mountPath: /var/opt/mssql
name: dbdata

34
samples/MicroserviceDemo/k8s/sqlserver-deployment.yaml

@ -1,35 +1,35 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
io.kompose.service: sqlserver
name: sqlserver
spec:
selector:
matchLabels:
app: sqlserver
replicas: 1
strategy:
type: Recreate
template:
metadata:
labels:
io.kompose.service: sqlserver
app: sqlserver
spec:
containers:
- env:
- name: sqlserver
image: mcr.microsoft.com/mssql/server
ports:
- containerPort: 1433
env:
- name: MSSQL_PID
value: "Developer"
- name: ACCEPT_EULA
value: "Y"
- name: SA_PASSWORD
value: yourStrong(!)Password
image: mcr.microsoft.com/mssql/server
name: sqlserver
ports:
- containerPort: 1433
resources: {}
- name: MSSQL_SA_PASSWORD
value: yourStrong(!)Password
volumeMounts:
- mountPath: /var/opt/mssql
name: dbdata
restartPolicy: Always
- name: dbdata
mountPath: /var/opt/mssql
volumes:
- name: dbdata
persistentVolumeClaim:
claimName: dbdata
status: {}
claimName: dbdata

15
samples/MicroserviceDemo/k8s/sqlserver-service.yaml

@ -1,14 +1,11 @@
apiVersion: v1
kind: Service
apiVersion: v1
metadata:
labels:
io.kompose.service: sqlserver
name: sqlserver
spec:
ports:
- port: 1433
targetPort: 1433
selector:
io.kompose.service: sqlserver
status:
loadBalancer: {}
app: sqlserver
ports:
- protocol: TCP
port: 1433
targetPort: 1433

2
templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20190107113413_Initial.Designer.cs → templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20190320125012_Initial.Designer.cs

@ -10,7 +10,7 @@ using MyCompanyName.MyProjectName.DemoApp;
namespace MyCompanyName.MyProjectName.DemoApp.Migrations
{
[DbContext(typeof(DemoAppDbContext))]
[Migration("20190107113413_Initial")]
[Migration("20190320125012_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)

0
templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20190107113413_Initial.cs → templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20190320125012_Initial.cs

4
templates/module/app/MyCompanyName.MyProjectName.DemoApp/MyCompanyName.MyProjectName.DemoApp.csproj

@ -35,4 +35,8 @@
<None Remove="Logs\**" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Migrations\20190107113413_Initial.cs" />
</ItemGroup>
</Project>

4
templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyProjectNameConsts.cs

@ -2,8 +2,8 @@
{
public static class MyProjectNameConsts
{
public const string DefaultDbTablePrefix = "App";
public const string DbTablePrefix = "App";
public const string DefaultDbSchema = null;
public const string DbSchema = null;
}
}

2
templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyProjectNameDomainModule.cs

@ -1,5 +1,4 @@
using MyCompanyName.MyProjectName.Localization.MyProjectName;
using MyCompanyName.MyProjectName.Settings;
using Volo.Abp.Auditing;
using Volo.Abp.AuditLogging;
using Volo.Abp.BackgroundJobs;
@ -8,7 +7,6 @@ using Volo.Abp.Localization;
using Volo.Abp.Localization.Resources.AbpValidation;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement.Identity;
using Volo.Abp.Settings;
using Volo.Abp.VirtualFileSystem;
namespace MyCompanyName.MyProjectName

53
templates/mvc/src/MyCompanyName.MyProjectName.Domain/Users/AppUser.cs

@ -0,0 +1,53 @@
using System;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.Users;
namespace MyCompanyName.MyProjectName.Users
{
/* This entity shares the same table/collection ("AbpUsers" by default) with the
* IdentityUser entity of the Identity module.
*
* - You can define your custom properties into this class.
* - You never create or delete this entity, becase it is Identity module's job.
* - You can query users from database with this entity.
* - You can update values of your custom properties.
*/
public class AppUser : FullAuditedAggregateRoot<Guid>, IUser
{
#region Base properties
/* These properties are shared with the IdentityUser entity of the Identity module.
* Do not change these properties through this class. Instead, use Identity module
* services (like IdentityUserManager) to change them.
* So, this properties are designed as read only!
*/
public virtual Guid? TenantId { get; private set; }
public virtual string UserName { get; private set; }
public virtual string Name { get; private set; }
public virtual string Surname { get; private set; }
public virtual string Email { get; private set; }
public virtual bool EmailConfirmed { get; private set; }
public virtual string PhoneNumber { get; private set; }
public virtual bool PhoneNumberConfirmed { get; private set; }
#endregion
/* Add your own properties here. Example:
*
* public virtual string MyProperty { get; set; }
*/
private AppUser()
{
}
}
}

12
templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/MyProjectNameMigrationsDbContext.cs

@ -2,6 +2,7 @@
using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.BackgroundJobs.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Identity;
using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.SettingManagement.EntityFrameworkCore;
@ -20,12 +21,23 @@ namespace MyCompanyName.MyProjectName.EntityFrameworkCore
{
base.OnModelCreating(builder);
/* Include modules to your migration db context */
builder.ConfigurePermissionManagement();
builder.ConfigureSettingManagement();
builder.ConfigureBackgroundJobs();
builder.ConfigureAuditLogging();
builder.ConfigureIdentity();
/* Configure customizations for entities from the modules included */
builder.Entity<IdentityUser>(b =>
{
b.ConfigureCustomUserProperties();
});
/* Configure your own tables/entities inside the ConfigureMyProjectName method */
builder.ConfigureMyProjectName();
}
}

22
templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContext.cs

@ -1,12 +1,17 @@
using Microsoft.EntityFrameworkCore;
using MyCompanyName.MyProjectName.Users;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Modeling;
using Volo.Abp.Users.EntityFrameworkCore;
namespace MyCompanyName.MyProjectName.EntityFrameworkCore
{
[ConnectionStringName("Default")]
public class MyProjectNameDbContext : AbpDbContext<MyProjectNameDbContext>
{
public DbSet<AppUser> Users { get; set; }
public MyProjectNameDbContext(DbContextOptions<MyProjectNameDbContext> options)
: base(options)
{
@ -17,6 +22,23 @@ namespace MyCompanyName.MyProjectName.EntityFrameworkCore
{
base.OnModelCreating(builder);
/* Configure the shared tables (with included modules) here */
builder.Entity<AppUser>(b =>
{
b.ToTable("AbpUsers"); //Sharing the same table "AbpUsers" with the IdentityUser
b.ConfigureFullAudited();
b.ConfigureExtraProperties();
b.ConfigureConcurrencyStamp();
b.ConfigureAbpUser();
//Moved customization to a method so we can share it with the MyProjectNameMigrationsDbContext class
b.ConfigureCustomUserProperties();
});
/* Configure your own tables/entities inside the ConfigureMyProjectName method */
builder.ConfigureMyProjectName();
}
}

29
templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContextFactory.cs

@ -1,29 +0,0 @@
using System.IO;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.Extensions.Configuration;
namespace MyCompanyName.MyProjectName.EntityFrameworkCore
{
public class MyProjectNameDbContextFactory : IDesignTimeDbContextFactory<MyProjectNameDbContext>
{
public MyProjectNameDbContext CreateDbContext(string[] args)
{
var configuration = BuildConfiguration();
var builder = new DbContextOptionsBuilder<MyProjectNameDbContext>()
.UseSqlServer(configuration.GetConnectionString("Default"));
return new MyProjectNameDbContext(builder.Options);
}
private static IConfigurationRoot BuildConfiguration()
{
var builder = new ConfigurationBuilder()
.SetBasePath(Path.Combine(Directory.GetCurrentDirectory(), "../MyCompanyName.MyProjectName.Web/"))
.AddJsonFile("appsettings.json", optional: false);
return builder.Build();
}
}
}

30
templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContextModelCreatingExtensions.cs

@ -1,5 +1,7 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Volo.Abp;
using Volo.Abp.Users;
namespace MyCompanyName.MyProjectName.EntityFrameworkCore
{
@ -9,26 +11,20 @@ namespace MyCompanyName.MyProjectName.EntityFrameworkCore
{
Check.NotNull(builder, nameof(builder));
var tablePrefix = MyProjectNameConsts.DefaultDbTablePrefix;
var schema = MyProjectNameConsts.DefaultDbSchema;
/* Configure your own tables/entities inside here */
/* Configure all entities here. Example:
//builder.Entity<YourEntity>(b =>
//{
// b.ToTable(MyProjectNameConsts.DbTablePrefix + "YourEntities", MyProjectNameConsts.DbSchema);
builder.Entity<Question>(b =>
{
//Configure table & schema name
//b.ToTable(tablePrefix + "Questions", schema);
//Properties
//b.Property(q => q.Title).IsRequired().HasMaxLength(QuestionConsts.MaxTitleLength);
//Configure relations
//b.HasMany(question => question.Tags).WithOne().HasForeignKey(qt => qt.QuestionId);
// //...
//});
}
//Configure indexes
//b.HasIndex(q => q.CreationTime);
});
*/
public static void ConfigureCustomUserProperties<TUser>(this EntityTypeBuilder<TUser> b)
where TUser: class, IUser
{
//b.Property<string>(nameof(AppUser.MyProperty))...
}
}
}

16
templates/mvc/src/MyCompanyName.MyProjectName.MongoDB/MongoDb/MyProjectNameMongoDbContext.cs

@ -1,4 +1,6 @@
using Volo.Abp.Data;
using MongoDB.Driver;
using MyCompanyName.MyProjectName.Users;
using Volo.Abp.Data;
using Volo.Abp.MongoDB;
namespace MyCompanyName.MyProjectName.MongoDb
@ -6,6 +8,16 @@ namespace MyCompanyName.MyProjectName.MongoDb
[ConnectionStringName("Default")]
public class MyProjectNameMongoDbContext : AbpMongoDbContext
{
public IMongoCollection<AppUser> Users => Collection<AppUser>();
protected override void CreateModel(IMongoModelBuilder modelBuilder)
{
base.CreateModel(modelBuilder);
modelBuilder.Entity<AppUser>(b =>
{
b.CollectionName = "AbpUsers"; //Sharing the same collection "AbpUsers" with the IdentityUser
});
}
}
}

2
templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/MyCompanyName.MyProjectName.Application.Tests.csproj

@ -9,9 +9,9 @@
<ItemGroup>
<ProjectReference Include="..\..\src\MyCompanyName.MyProjectName.Application\MyCompanyName.MyProjectName.Application.csproj" />
<ProjectReference Include="..\..\src\MyCompanyName.MyProjectName.EntityFrameworkCore\MyCompanyName.MyProjectName.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.TestBase\Volo.Abp.TestBase.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\src\MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations\MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations.csproj" />
</ItemGroup>
<ItemGroup>

4
templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/MyProjectNameApplicationTestModule.cs

@ -53,11 +53,11 @@ namespace MyCompanyName.MyProjectName
var connection = new SqliteConnection("Data Source=:memory:");
connection.Open();
var options = new DbContextOptionsBuilder<MyProjectNameDbContext>()
var options = new DbContextOptionsBuilder<MyProjectNameMigrationsDbContext>()
.UseSqlite(connection)
.Options;
using (var context = new MyProjectNameDbContext(options))
using (var context = new MyProjectNameMigrationsDbContext(options))
{
context.GetService<IRelationalDatabaseCreator>().CreateTables();
}

26
templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/Samples/SampleTest.cs

@ -1,26 +0,0 @@
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Shouldly;
using Volo.Abp.Identity;
using Xunit;
namespace MyCompanyName.MyProjectName.Samples
{
public class SampleTest : MyProjectNameApplicationTestBase
{
private readonly IIdentityUserAppService _userAppService;
public SampleTest()
{
_userAppService = ServiceProvider.GetRequiredService<IIdentityUserAppService>();
}
[Fact]
public async Task Initial_Data_Should_Contain_Admin_User()
{
var result = await _userAppService.GetListAsync(new GetIdentityUsersInput());
result.TotalCount.ShouldBeGreaterThan(0);
result.Items.ShouldContain(u => u.UserName == "admin");
}
}
}

59
templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/Samples/SampleTests.cs

@ -0,0 +1,59 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using MyCompanyName.MyProjectName.Users;
using Shouldly;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Identity;
using Volo.Abp.Uow;
using Xunit;
namespace MyCompanyName.MyProjectName.Samples
{
public class SampleTests : MyProjectNameApplicationTestBase
{
private readonly IIdentityUserAppService _userAppService;
private readonly IRepository<AppUser, Guid> _appUserRepository;
private readonly IUnitOfWorkManager _unitOfWorkManager;
public SampleTests()
{
_userAppService = ServiceProvider.GetRequiredService<IIdentityUserAppService>();
_appUserRepository = ServiceProvider.GetRequiredService<IRepository<AppUser, Guid>>();
_unitOfWorkManager = ServiceProvider.GetRequiredService<IUnitOfWorkManager>();
}
[Fact]
public async Task Initial_Data_Should_Contain_Admin_User()
{
//Act
var result = await _userAppService.GetListAsync(new GetIdentityUsersInput());
//Assert
result.TotalCount.ShouldBeGreaterThan(0);
result.Items.ShouldContain(u => u.UserName == "admin");
}
[Fact]
public async Task Should_Query_AppUser()
{
/* Need to manually start Unit Of Work because
* FirstOrDefaultAsync should be executed while db connection / context is available.
*/
using (var uow = _unitOfWorkManager.Begin())
{
//Act
var adminUser = await _appUserRepository
.Where(u => u.UserName == "admin")
.FirstOrDefaultAsync();
//Assert
adminUser.ShouldNotBeNull();
await uow.CompleteAsync();
}
}
}
}

6
templates/service/host/IdentityServerHost/DemoAppDbContext.cs

@ -1,7 +1,10 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.IdentityServer.EntityFrameworkCore;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.SettingManagement.EntityFrameworkCore;
namespace IdentityServerHost
{
@ -17,6 +20,9 @@ namespace IdentityServerHost
{
base.OnModelCreating(modelBuilder);
modelBuilder.ConfigurePermissionManagement();
modelBuilder.ConfigureSettingManagement();
modelBuilder.ConfigureAuditLogging();
modelBuilder.ConfigureIdentity();
modelBuilder.ConfigureIdentityServer();
}

8
templates/service/host/IdentityServerHost/IdentityServerHost.csproj

@ -17,6 +17,9 @@
<ProjectReference Include="..\..\..\..\modules\identityserver\src\Volo.Abp.IdentityServer.EntityFrameworkCore\Volo.Abp.IdentityServer.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.EntityFrameworkCore\Volo.Abp.Identity.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.AspNetCore\Volo.Abp.Identity.AspNetCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.EntityFrameworkCore\Volo.Abp.PermissionManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.EntityFrameworkCore\Volo.Abp.SettingManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.EntityFrameworkCore\Volo.Abp.AuditLogging.EntityFrameworkCore.csproj" />
</ItemGroup>
<ItemGroup>
@ -26,9 +29,4 @@
<None Remove="Logs\**" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Migrations\20181212121034_Initial.cs" />
<Compile Remove="Migrations\20181218135354_Initial.cs" />
</ItemGroup>
</Project>

299
templates/service/host/IdentityServerHost/Migrations/20190107114341_Initial.Designer.cs → templates/service/host/IdentityServerHost/Migrations/20190320142333_Initial.Designer.cs

@ -10,7 +10,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace IdentityServerHost.Migrations
{
[DbContext(typeof(DemoAppDbContext))]
[Migration("20190107114341_Initial")]
[Migration("20190320142333_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -21,6 +21,202 @@ namespace IdentityServerHost.Migrations
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ApplicationName")
.HasColumnName("ApplicationName")
.HasMaxLength(96);
b.Property<string>("BrowserInfo")
.HasColumnName("BrowserInfo")
.HasMaxLength(512);
b.Property<string>("ClientId")
.HasColumnName("ClientId")
.HasMaxLength(64);
b.Property<string>("ClientIpAddress")
.HasColumnName("ClientIpAddress")
.HasMaxLength(64);
b.Property<string>("ClientName")
.HasColumnName("ClientName")
.HasMaxLength(128);
b.Property<string>("Comments")
.HasColumnName("Comments")
.HasMaxLength(256);
b.Property<string>("ConcurrencyStamp");
b.Property<string>("CorrelationId")
.HasColumnName("CorrelationId")
.HasMaxLength(64);
b.Property<string>("Exceptions")
.HasColumnName("Exceptions")
.HasMaxLength(4000);
b.Property<int>("ExecutionDuration")
.HasColumnName("ExecutionDuration");
b.Property<DateTime>("ExecutionTime");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<string>("HttpMethod")
.HasColumnName("HttpMethod")
.HasMaxLength(16);
b.Property<int?>("HttpStatusCode")
.HasColumnName("HttpStatusCode");
b.Property<Guid?>("ImpersonatorTenantId")
.HasColumnName("ImpersonatorTenantId");
b.Property<Guid?>("ImpersonatorUserId")
.HasColumnName("ImpersonatorUserId");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId");
b.Property<string>("Url")
.HasColumnName("Url")
.HasMaxLength(256);
b.Property<Guid?>("UserId")
.HasColumnName("UserId");
b.Property<string>("UserName")
.HasColumnName("UserName")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("TenantId", "ExecutionTime");
b.HasIndex("TenantId", "UserId", "ExecutionTime");
b.ToTable("AbpAuditLogs");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<Guid>("AuditLogId")
.HasColumnName("AuditLogId");
b.Property<int>("ExecutionDuration")
.HasColumnName("ExecutionDuration");
b.Property<DateTime>("ExecutionTime")
.HasColumnName("ExecutionTime");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<string>("MethodName")
.HasColumnName("MethodName")
.HasMaxLength(128);
b.Property<string>("Parameters")
.HasColumnName("Parameters")
.HasMaxLength(2000);
b.Property<string>("ServiceName")
.HasColumnName("ServiceName")
.HasMaxLength(256);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("AuditLogId");
b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime");
b.ToTable("AbpAuditLogActions");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<Guid>("AuditLogId")
.HasColumnName("AuditLogId");
b.Property<DateTime>("ChangeTime")
.HasColumnName("ChangeTime");
b.Property<byte>("ChangeType")
.HasColumnName("ChangeType");
b.Property<string>("EntityId")
.IsRequired()
.HasColumnName("EntityId")
.HasMaxLength(128);
b.Property<string>("EntityTypeFullName")
.IsRequired()
.HasColumnName("EntityTypeFullName")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId");
b.HasKey("Id");
b.HasIndex("AuditLogId");
b.HasIndex("TenantId", "EntityTypeFullName", "EntityId");
b.ToTable("AbpEntityChanges");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<Guid>("EntityChangeId");
b.Property<string>("NewValue")
.HasColumnName("NewValue")
.HasMaxLength(512);
b.Property<string>("OriginalValue")
.HasColumnName("OriginalValue")
.HasMaxLength(512);
b.Property<string>("PropertyName")
.IsRequired()
.HasColumnName("PropertyName")
.HasMaxLength(128);
b.Property<string>("PropertyTypeFullName")
.IsRequired()
.HasColumnName("PropertyTypeFullName")
.HasMaxLength(64);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("EntityChangeId");
b.ToTable("AbpEntityPropertyChanges");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b =>
{
b.Property<Guid>("Id")
@ -445,7 +641,7 @@ namespace IdentityServerHost.Migrations
b.Property<bool>("BackChannelLogoutSessionRequired");
b.Property<string>("BackChannelLogoutUri")
.HasMaxLength(2000);
.HasMaxLength(300);
b.Property<string>("ClientClaimsPrefix")
.HasMaxLength(200);
@ -458,7 +654,7 @@ namespace IdentityServerHost.Migrations
.HasMaxLength(200);
b.Property<string>("ClientUri")
.HasMaxLength(2000);
.HasMaxLength(300);
b.Property<string>("ConcurrencyStamp");
@ -477,14 +673,14 @@ namespace IdentityServerHost.Migrations
b.Property<bool>("FrontChannelLogoutSessionRequired");
b.Property<string>("FrontChannelLogoutUri")
.HasMaxLength(2000);
.HasMaxLength(300);
b.Property<int>("IdentityTokenLifetime");
b.Property<bool>("IncludeJwtId");
b.Property<string>("LogoUri")
.HasMaxLength(2000);
.HasMaxLength(300);
b.Property<string>("PairWiseSubjectSalt")
.HasMaxLength(200);
@ -517,22 +713,15 @@ namespace IdentityServerHost.Migrations
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<Guid>("ClientId");
b.Property<string>("Type")
.IsRequired()
.HasMaxLength(250);
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(250);
b.HasKey("Id");
b.HasIndex("ClientId");
b.HasKey("ClientId", "Type", "Value");
b.ToTable("IdentityServerClientClaims");
});
@ -578,7 +767,7 @@ namespace IdentityServerHost.Migrations
b.Property<Guid>("ClientId");
b.Property<string>("PostLogoutRedirectUri")
.HasMaxLength(2000);
.HasMaxLength(200);
b.HasKey("ClientId", "PostLogoutRedirectUri");
@ -590,11 +779,11 @@ namespace IdentityServerHost.Migrations
b.Property<Guid>("ClientId");
b.Property<string>("Key")
.HasMaxLength(250);
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(2000);
.HasMaxLength(128);
b.HasKey("ClientId", "Key");
@ -606,7 +795,7 @@ namespace IdentityServerHost.Migrations
b.Property<Guid>("ClientId");
b.Property<string>("RedirectUri")
.HasMaxLength(2000);
.HasMaxLength(200);
b.HasKey("ClientId", "RedirectUri");
@ -727,6 +916,82 @@ namespace IdentityServerHost.Migrations
b.ToTable("IdentityServerIdentityResources");
});
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.IsRequired()
.HasMaxLength(64);
b.Property<string>("ProviderName")
.IsRequired()
.HasMaxLength(64);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpPermissionGrants");
});
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(2048);
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpSettings");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany("Actions")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany("EntityChanges")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.EntityChange")
.WithMany("PropertyChanges")
.HasForeignKey("EntityChangeId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityRole")

220
templates/service/host/IdentityServerHost/Migrations/20190107114341_Initial.cs → templates/service/host/IdentityServerHost/Migrations/20190320142333_Initial.cs

@ -7,6 +7,37 @@ namespace IdentityServerHost.Migrations
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AbpAuditLogs",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
ApplicationName = table.Column<string>(maxLength: 96, nullable: true),
UserId = table.Column<Guid>(nullable: true),
UserName = table.Column<string>(maxLength: 256, nullable: true),
TenantId = table.Column<Guid>(nullable: true),
ImpersonatorUserId = table.Column<Guid>(nullable: true),
ImpersonatorTenantId = table.Column<Guid>(nullable: true),
ExecutionTime = table.Column<DateTime>(nullable: false),
ExecutionDuration = table.Column<int>(nullable: false),
ClientIpAddress = table.Column<string>(maxLength: 64, nullable: true),
ClientName = table.Column<string>(maxLength: 128, nullable: true),
ClientId = table.Column<string>(maxLength: 64, nullable: true),
CorrelationId = table.Column<string>(maxLength: 64, nullable: true),
BrowserInfo = table.Column<string>(maxLength: 512, nullable: true),
HttpMethod = table.Column<string>(maxLength: 16, nullable: true),
Url = table.Column<string>(maxLength: 256, nullable: true),
Exceptions = table.Column<string>(maxLength: 4000, nullable: true),
Comments = table.Column<string>(maxLength: 256, nullable: true),
HttpStatusCode = table.Column<int>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpAuditLogs", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpClaimTypes",
columns: table => new
@ -27,6 +58,21 @@ namespace IdentityServerHost.Migrations
table.PrimaryKey("PK_AbpClaimTypes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpPermissionGrants",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
Name = table.Column<string>(maxLength: 128, nullable: false),
ProviderName = table.Column<string>(maxLength: 64, nullable: false),
ProviderKey = table.Column<string>(maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpRoles",
columns: table => new
@ -46,6 +92,21 @@ namespace IdentityServerHost.Migrations
table.PrimaryKey("PK_AbpRoles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpSettings",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
Name = table.Column<string>(maxLength: 128, nullable: false),
Value = table.Column<string>(maxLength: 2048, nullable: false),
ProviderName = table.Column<string>(maxLength: 64, nullable: true),
ProviderKey = table.Column<string>(maxLength: 64, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpSettings", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpUsers",
columns: table => new
@ -109,8 +170,8 @@ namespace IdentityServerHost.Migrations
ClientId = table.Column<string>(maxLength: 200, nullable: false),
ClientName = table.Column<string>(maxLength: 200, nullable: true),
Description = table.Column<string>(maxLength: 1000, nullable: true),
ClientUri = table.Column<string>(maxLength: 2000, nullable: true),
LogoUri = table.Column<string>(maxLength: 2000, nullable: true),
ClientUri = table.Column<string>(maxLength: 300, nullable: true),
LogoUri = table.Column<string>(maxLength: 300, nullable: true),
Enabled = table.Column<bool>(nullable: false),
ProtocolType = table.Column<string>(maxLength: 200, nullable: false),
RequireClientSecret = table.Column<bool>(nullable: false),
@ -120,9 +181,9 @@ namespace IdentityServerHost.Migrations
RequirePkce = table.Column<bool>(nullable: false),
AllowPlainTextPkce = table.Column<bool>(nullable: false),
AllowAccessTokensViaBrowser = table.Column<bool>(nullable: false),
FrontChannelLogoutUri = table.Column<string>(maxLength: 2000, nullable: true),
FrontChannelLogoutUri = table.Column<string>(maxLength: 300, nullable: true),
FrontChannelLogoutSessionRequired = table.Column<bool>(nullable: false),
BackChannelLogoutUri = table.Column<string>(maxLength: 2000, nullable: true),
BackChannelLogoutUri = table.Column<string>(maxLength: 300, nullable: true),
BackChannelLogoutSessionRequired = table.Column<bool>(nullable: false),
AllowOfflineAccess = table.Column<bool>(nullable: false),
IdentityTokenLifetime = table.Column<int>(nullable: false),
@ -186,6 +247,55 @@ namespace IdentityServerHost.Migrations
table.PrimaryKey("PK_IdentityServerPersistedGrants", x => x.Key);
});
migrationBuilder.CreateTable(
name: "AbpAuditLogActions",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
AuditLogId = table.Column<Guid>(nullable: false),
ServiceName = table.Column<string>(maxLength: 256, nullable: true),
MethodName = table.Column<string>(maxLength: 128, nullable: true),
Parameters = table.Column<string>(maxLength: 2000, nullable: true),
ExecutionTime = table.Column<DateTime>(nullable: false),
ExecutionDuration = table.Column<int>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpAuditLogActions", x => x.Id);
table.ForeignKey(
name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId",
column: x => x.AuditLogId,
principalTable: "AbpAuditLogs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpEntityChanges",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
AuditLogId = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
ChangeTime = table.Column<DateTime>(nullable: false),
ChangeType = table.Column<byte>(nullable: false),
EntityId = table.Column<string>(maxLength: 128, nullable: false),
EntityTypeFullName = table.Column<string>(maxLength: 128, nullable: false),
ExtraProperties = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpEntityChanges", x => x.Id);
table.ForeignKey(
name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId",
column: x => x.AuditLogId,
principalTable: "AbpAuditLogs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpRoleClaims",
columns: table => new
@ -361,14 +471,13 @@ namespace IdentityServerHost.Migrations
name: "IdentityServerClientClaims",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ClientId = table.Column<Guid>(nullable: false),
Type = table.Column<string>(maxLength: 250, nullable: false),
Value = table.Column<string>(maxLength: 250, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientClaims", x => x.Id);
table.PrimaryKey("PK_IdentityServerClientClaims", x => new { x.ClientId, x.Type, x.Value });
table.ForeignKey(
name: "FK_IdentityServerClientClaims_IdentityServerClients_ClientId",
column: x => x.ClientId,
@ -436,7 +545,7 @@ namespace IdentityServerHost.Migrations
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
PostLogoutRedirectUri = table.Column<string>(maxLength: 2000, nullable: false)
PostLogoutRedirectUri = table.Column<string>(maxLength: 200, nullable: false)
},
constraints: table =>
{
@ -454,8 +563,8 @@ namespace IdentityServerHost.Migrations
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
Key = table.Column<string>(maxLength: 250, nullable: false),
Value = table.Column<string>(maxLength: 2000, nullable: false)
Key = table.Column<string>(maxLength: 64, nullable: false),
Value = table.Column<string>(maxLength: 128, nullable: false)
},
constraints: table =>
{
@ -473,7 +582,7 @@ namespace IdentityServerHost.Migrations
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
RedirectUri = table.Column<string>(maxLength: 2000, nullable: false)
RedirectUri = table.Column<string>(maxLength: 200, nullable: false)
},
constraints: table =>
{
@ -543,6 +652,29 @@ namespace IdentityServerHost.Migrations
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpEntityPropertyChanges",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
EntityChangeId = table.Column<Guid>(nullable: false),
NewValue = table.Column<string>(maxLength: 512, nullable: true),
OriginalValue = table.Column<string>(maxLength: 512, nullable: true),
PropertyName = table.Column<string>(maxLength: 128, nullable: false),
PropertyTypeFullName = table.Column<string>(maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpEntityPropertyChanges", x => x.Id);
table.ForeignKey(
name: "FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId",
column: x => x.EntityChangeId,
principalTable: "AbpEntityChanges",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiScopeClaims",
columns: table => new
@ -562,6 +694,46 @@ namespace IdentityServerHost.Migrations
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogActions_AuditLogId",
table: "AbpAuditLogActions",
column: "AuditLogId");
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_ExecutionTime",
table: "AbpAuditLogActions",
columns: new[] { "TenantId", "ServiceName", "MethodName", "ExecutionTime" });
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogs_TenantId_ExecutionTime",
table: "AbpAuditLogs",
columns: new[] { "TenantId", "ExecutionTime" });
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogs_TenantId_UserId_ExecutionTime",
table: "AbpAuditLogs",
columns: new[] { "TenantId", "UserId", "ExecutionTime" });
migrationBuilder.CreateIndex(
name: "IX_AbpEntityChanges_AuditLogId",
table: "AbpEntityChanges",
column: "AuditLogId");
migrationBuilder.CreateIndex(
name: "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId",
table: "AbpEntityChanges",
columns: new[] { "TenantId", "EntityTypeFullName", "EntityId" });
migrationBuilder.CreateIndex(
name: "IX_AbpEntityPropertyChanges_EntityChangeId",
table: "AbpEntityPropertyChanges",
column: "EntityChangeId");
migrationBuilder.CreateIndex(
name: "IX_AbpPermissionGrants_Name_ProviderName_ProviderKey",
table: "AbpPermissionGrants",
columns: new[] { "Name", "ProviderName", "ProviderKey" });
migrationBuilder.CreateIndex(
name: "IX_AbpRoleClaims_RoleId",
table: "AbpRoleClaims",
@ -572,6 +744,11 @@ namespace IdentityServerHost.Migrations
table: "AbpRoles",
column: "NormalizedName");
migrationBuilder.CreateIndex(
name: "IX_AbpSettings_Name_ProviderName_ProviderKey",
table: "AbpSettings",
columns: new[] { "Name", "ProviderName", "ProviderKey" });
migrationBuilder.CreateIndex(
name: "IX_AbpUserClaims_UserId",
table: "AbpUserClaims",
@ -607,11 +784,6 @@ namespace IdentityServerHost.Migrations
table: "AbpUsers",
column: "UserName");
migrationBuilder.CreateIndex(
name: "IX_IdentityServerClientClaims_ClientId",
table: "IdentityServerClientClaims",
column: "ClientId");
migrationBuilder.CreateIndex(
name: "IX_IdentityServerClients_ClientId",
table: "IdentityServerClients",
@ -626,12 +798,24 @@ namespace IdentityServerHost.Migrations
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AbpAuditLogActions");
migrationBuilder.DropTable(
name: "AbpClaimTypes");
migrationBuilder.DropTable(
name: "AbpEntityPropertyChanges");
migrationBuilder.DropTable(
name: "AbpPermissionGrants");
migrationBuilder.DropTable(
name: "AbpRoleClaims");
migrationBuilder.DropTable(
name: "AbpSettings");
migrationBuilder.DropTable(
name: "AbpUserClaims");
@ -686,6 +870,9 @@ namespace IdentityServerHost.Migrations
migrationBuilder.DropTable(
name: "IdentityServerPersistedGrants");
migrationBuilder.DropTable(
name: "AbpEntityChanges");
migrationBuilder.DropTable(
name: "AbpRoles");
@ -701,6 +888,9 @@ namespace IdentityServerHost.Migrations
migrationBuilder.DropTable(
name: "IdentityServerIdentityResources");
migrationBuilder.DropTable(
name: "AbpAuditLogs");
migrationBuilder.DropTable(
name: "IdentityServerApiResources");
}

297
templates/service/host/IdentityServerHost/Migrations/DemoAppDbContextModelSnapshot.cs

@ -19,6 +19,202 @@ namespace IdentityServerHost.Migrations
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ApplicationName")
.HasColumnName("ApplicationName")
.HasMaxLength(96);
b.Property<string>("BrowserInfo")
.HasColumnName("BrowserInfo")
.HasMaxLength(512);
b.Property<string>("ClientId")
.HasColumnName("ClientId")
.HasMaxLength(64);
b.Property<string>("ClientIpAddress")
.HasColumnName("ClientIpAddress")
.HasMaxLength(64);
b.Property<string>("ClientName")
.HasColumnName("ClientName")
.HasMaxLength(128);
b.Property<string>("Comments")
.HasColumnName("Comments")
.HasMaxLength(256);
b.Property<string>("ConcurrencyStamp");
b.Property<string>("CorrelationId")
.HasColumnName("CorrelationId")
.HasMaxLength(64);
b.Property<string>("Exceptions")
.HasColumnName("Exceptions")
.HasMaxLength(4000);
b.Property<int>("ExecutionDuration")
.HasColumnName("ExecutionDuration");
b.Property<DateTime>("ExecutionTime");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<string>("HttpMethod")
.HasColumnName("HttpMethod")
.HasMaxLength(16);
b.Property<int?>("HttpStatusCode")
.HasColumnName("HttpStatusCode");
b.Property<Guid?>("ImpersonatorTenantId")
.HasColumnName("ImpersonatorTenantId");
b.Property<Guid?>("ImpersonatorUserId")
.HasColumnName("ImpersonatorUserId");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId");
b.Property<string>("Url")
.HasColumnName("Url")
.HasMaxLength(256);
b.Property<Guid?>("UserId")
.HasColumnName("UserId");
b.Property<string>("UserName")
.HasColumnName("UserName")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("TenantId", "ExecutionTime");
b.HasIndex("TenantId", "UserId", "ExecutionTime");
b.ToTable("AbpAuditLogs");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<Guid>("AuditLogId")
.HasColumnName("AuditLogId");
b.Property<int>("ExecutionDuration")
.HasColumnName("ExecutionDuration");
b.Property<DateTime>("ExecutionTime")
.HasColumnName("ExecutionTime");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<string>("MethodName")
.HasColumnName("MethodName")
.HasMaxLength(128);
b.Property<string>("Parameters")
.HasColumnName("Parameters")
.HasMaxLength(2000);
b.Property<string>("ServiceName")
.HasColumnName("ServiceName")
.HasMaxLength(256);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("AuditLogId");
b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime");
b.ToTable("AbpAuditLogActions");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<Guid>("AuditLogId")
.HasColumnName("AuditLogId");
b.Property<DateTime>("ChangeTime")
.HasColumnName("ChangeTime");
b.Property<byte>("ChangeType")
.HasColumnName("ChangeType");
b.Property<string>("EntityId")
.IsRequired()
.HasColumnName("EntityId")
.HasMaxLength(128);
b.Property<string>("EntityTypeFullName")
.IsRequired()
.HasColumnName("EntityTypeFullName")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId");
b.HasKey("Id");
b.HasIndex("AuditLogId");
b.HasIndex("TenantId", "EntityTypeFullName", "EntityId");
b.ToTable("AbpEntityChanges");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<Guid>("EntityChangeId");
b.Property<string>("NewValue")
.HasColumnName("NewValue")
.HasMaxLength(512);
b.Property<string>("OriginalValue")
.HasColumnName("OriginalValue")
.HasMaxLength(512);
b.Property<string>("PropertyName")
.IsRequired()
.HasColumnName("PropertyName")
.HasMaxLength(128);
b.Property<string>("PropertyTypeFullName")
.IsRequired()
.HasColumnName("PropertyTypeFullName")
.HasMaxLength(64);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("EntityChangeId");
b.ToTable("AbpEntityPropertyChanges");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b =>
{
b.Property<Guid>("Id")
@ -443,7 +639,7 @@ namespace IdentityServerHost.Migrations
b.Property<bool>("BackChannelLogoutSessionRequired");
b.Property<string>("BackChannelLogoutUri")
.HasMaxLength(2000);
.HasMaxLength(300);
b.Property<string>("ClientClaimsPrefix")
.HasMaxLength(200);
@ -456,7 +652,7 @@ namespace IdentityServerHost.Migrations
.HasMaxLength(200);
b.Property<string>("ClientUri")
.HasMaxLength(2000);
.HasMaxLength(300);
b.Property<string>("ConcurrencyStamp");
@ -475,14 +671,14 @@ namespace IdentityServerHost.Migrations
b.Property<bool>("FrontChannelLogoutSessionRequired");
b.Property<string>("FrontChannelLogoutUri")
.HasMaxLength(2000);
.HasMaxLength(300);
b.Property<int>("IdentityTokenLifetime");
b.Property<bool>("IncludeJwtId");
b.Property<string>("LogoUri")
.HasMaxLength(2000);
.HasMaxLength(300);
b.Property<string>("PairWiseSubjectSalt")
.HasMaxLength(200);
@ -515,22 +711,15 @@ namespace IdentityServerHost.Migrations
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<Guid>("ClientId");
b.Property<string>("Type")
.IsRequired()
.HasMaxLength(250);
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(250);
b.HasKey("Id");
b.HasIndex("ClientId");
b.HasKey("ClientId", "Type", "Value");
b.ToTable("IdentityServerClientClaims");
});
@ -576,7 +765,7 @@ namespace IdentityServerHost.Migrations
b.Property<Guid>("ClientId");
b.Property<string>("PostLogoutRedirectUri")
.HasMaxLength(2000);
.HasMaxLength(200);
b.HasKey("ClientId", "PostLogoutRedirectUri");
@ -588,11 +777,11 @@ namespace IdentityServerHost.Migrations
b.Property<Guid>("ClientId");
b.Property<string>("Key")
.HasMaxLength(250);
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(2000);
.HasMaxLength(128);
b.HasKey("ClientId", "Key");
@ -604,7 +793,7 @@ namespace IdentityServerHost.Migrations
b.Property<Guid>("ClientId");
b.Property<string>("RedirectUri")
.HasMaxLength(2000);
.HasMaxLength(200);
b.HasKey("ClientId", "RedirectUri");
@ -725,6 +914,82 @@ namespace IdentityServerHost.Migrations
b.ToTable("IdentityServerIdentityResources");
});
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.IsRequired()
.HasMaxLength(64);
b.Property<string>("ProviderName")
.IsRequired()
.HasMaxLength(64);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpPermissionGrants");
});
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(2048);
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpSettings");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany("Actions")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany("EntityChanges")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.EntityChange")
.WithMany("PropertyChanges")
.HasForeignKey("EntityChangeId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityRole")

5
templates/service/host/IdentityServerHost/appsettings.json

@ -1,6 +1,7 @@
{
"ConnectionStrings": {
"Default": "Server=localhost;Database=IdentityServerHost;Trusted_Connection=True;MultipleActiveResultSets=true",
"SqlServerCache": "Server=localhost;Database=MyProjectNameCache;Trusted_Connection=True;MultipleActiveResultSets=true"
"Default": "Server=localhost;Database=MyProjectName_Identity;Trusted_Connection=True;MultipleActiveResultSets=true",
"SqlServerCache": "Server=localhost;Database=MyProjectName_Cache;Trusted_Connection=True;MultipleActiveResultSets=true"
}
}

3
templates/service/host/MyCompanyName.MyProjectName.Host/DemoAppDbContext.cs

@ -21,8 +21,9 @@ namespace MyCompanyName.MyProjectName.Host
modelBuilder.ConfigurePermissionManagement();
modelBuilder.ConfigureSettingManagement();
modelBuilder.ConfigureMyProjectName();
modelBuilder.ConfigureAuditLogging();
modelBuilder.ConfigureMyProjectName();
}
}
}

2
templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20190214093219_Initial.Designer.cs → templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20190320142412_Initial.Designer.cs

@ -10,7 +10,7 @@ using MyCompanyName.MyProjectName.Host;
namespace MyCompanyName.MyProjectName.Host.Migrations
{
[DbContext(typeof(DemoAppDbContext))]
[Migration("20190214093219_Initial")]
[Migration("20190320142412_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)

0
templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20190214093219_Initial.cs → templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20190320142412_Initial.cs

2
templates/service/host/MyCompanyName.MyProjectName.Host/_CreateSqlServerCacheDatabase.bat

@ -1 +1 @@
dotnet sql-cache create "Server=localhost;Database=MyProjectNameCache;Trusted_Connection=True;MultipleActiveResultSets=true" dbo TestCache
dotnet sql-cache create "Server=localhost;Database=MyProjectName_Cache;Trusted_Connection=True;MultipleActiveResultSets=true" dbo TestCache

9
templates/service/host/MyCompanyName.MyProjectName.Host/appsettings.json

@ -1,6 +1,11 @@
{
"ConnectionStrings": {
"Default": "Server=localhost;Database=MyProjectNameHost;Trusted_Connection=True;MultipleActiveResultSets=true",
"SqlServerCache": "Server=localhost;Database=MyProjectNameCache;Trusted_Connection=True;MultipleActiveResultSets=true"
"Default": "Server=localhost;Database=MyProjectName_ModuleDb;Trusted_Connection=True;MultipleActiveResultSets=true",
"AbpSettingManagement": "Server=localhost;Database=MyProjectName_Identity;Trusted_Connection=True;MultipleActiveResultSets=true",
"AbpPermissionManagement": "Server=localhost;Database=MyProjectName_Identity;Trusted_Connection=True;MultipleActiveResultSets=true",
"AbpAuditLogging": "Server=localhost;Database=MyProjectName_Identity;Trusted_Connection=True;MultipleActiveResultSets=true",
"SqlServerCache": "Server=localhost;Database=MyProjectName_Cache;Trusted_Connection=True;MultipleActiveResultSets=true"
}
}
Loading…
Cancel
Save