Browse Source

feat: add support text-templating management

pull/605/head
cKey 4 years ago
parent
commit
aa152c11b9
  1. 64
      aspnet-core/LINGYUN.MicroService.All.sln
  2. 12
      aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN.Abp.ExceptionHandling.Notifications.csproj
  3. 36
      aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpExceptionHandlingNotificationDefinitionProvider.cs
  4. 8
      aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpExceptionHandlingNotificationNames.cs
  5. 21
      aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpNotificationsExceptionHandlingModule.cs
  6. 4
      aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpNotificationsExceptionSubscriber.cs
  7. 7
      aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/Localization/Resources/en.json
  8. 7
      aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/Localization/Resources/zh-Hans.json
  9. 0
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/FodyWeavers.xml
  10. 0
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/FodyWeavers.xsd
  11. 31
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN.Abp.Notifications.Common.csproj
  12. 26
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/AbpNotificationsCommonModule.cs
  13. 23
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/NotificationsCommonTemplateProvider.cs
  14. 11
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Localization/Common/en.json
  15. 11
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Localization/Common/zh-Hans.json
  16. 82
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/NotificationsCommonNotificationDefinitionProvider.cs
  17. 11
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/NotificationsCommonNotificationNames.cs
  18. 0
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/Volo/Abp/MultiTenancy/TenantNotificationNames.cs
  19. 0
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/Volo/Abp/Users/UserNotificationNames.cs
  20. 12
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.TextTemplating/LINGYUN/Abp/Notifications/TextTemplating/AbpNotificationsTextTemplatingModule.cs
  21. 23
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.TextTemplating/LINGYUN/Abp/Notifications/TextTemplating/NotificationTemplateContentContributor.cs
  22. 9
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationTemplateStore.cs
  23. 14
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Localization/Resources/en.json
  24. 14
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Localization/Resources/zh-Hans.json
  25. 17
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDefinition.cs
  26. 16
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NullNotificationTemplateStore.cs
  27. 11
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/Dto/NotificationTemplateGetInput.cs
  28. 19
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/Dto/NotificationTemplateSetInput.cs
  29. 4
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/INotificationAppService.cs
  30. 2
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/AbpMessageServiceApplicationAutoMapperProfile.cs
  31. 53
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Notifications/NotificationAppService.cs
  32. 16
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/Resources/en.json
  33. 17
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/Resources/zh-Hans.json
  34. 36
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/AbpMessageServiceNotificationDefinitionProvider.cs
  35. 11
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/INotificationTemplateRepository.cs
  36. 37
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/NotificationTemplate.cs
  37. 31
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/NotificationTemplateStore.cs
  38. 1
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/AbpMessageServiceEntityFrameworkCoreModule.cs
  39. 17
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceDbContextModelCreatingExtensions.cs
  40. 32
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Notifications/EfCoreNotificationTemplateRepository.cs
  41. 17
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Notifications/NotificationController.cs
  42. 3
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/FodyWeavers.xml
  43. 30
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/FodyWeavers.xsd
  44. 24
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN.Abp.TextTemplating.Application.Contracts.csproj
  45. 14
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/AbpTextTemplatingApplicationContractsModule.cs
  46. 8
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/AbpTextTemplatingRemoteServiceConsts.cs
  47. 16
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/ITextTemplateAppService.cs
  48. 23
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/Permissions/AbpTextTemplatingPermissionDefinitionProvider.cs
  49. 21
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/Permissions/AbpTextTemplatingPermissions.cs
  50. 9
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateDto.cs
  51. 14
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateGetInput.cs
  52. 19
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateUpdateInput.cs
  53. 3
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/FodyWeavers.xml
  54. 30
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/FodyWeavers.xsd
  55. 21
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN.Abp.TextTemplating.Application.csproj
  56. 13
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN/Abp/TextTemplating/AbpTextTemplatingAppServiceBase.cs
  57. 11
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN/Abp/TextTemplating/AbpTextTemplatingApplicationAutoMapperProfile.cs
  58. 23
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN/Abp/TextTemplating/AbpTextTemplatingApplicationModule.cs
  59. 135
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN/Abp/TextTemplating/TextTemplateAppService.cs
  60. 3
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/FodyWeavers.xml
  61. 30
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/FodyWeavers.xsd
  62. 20
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN.Abp.TextTemplating.Domain.Shared.csproj
  63. 33
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/AbpTextTemplatingDomainSharedModule.cs
  64. 11
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/AbpTextTemplatingErrorCodes.cs
  65. 8
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/Localization/AbpTextTemplatingResource.cs
  66. 5
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/Localization/Resources/en.json
  67. 5
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/Localization/Resources/zh-Hans.json
  68. 12
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/TextTemplateConsts.cs
  69. 3
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/FodyWeavers.xml
  70. 30
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/FodyWeavers.xsd
  71. 4
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN.Abp.TextTemplating.Domain.csproj
  72. 12
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/AbpTextTemplatingDbProperties.cs
  73. 12
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/AbpTextTemplatingDomainModule.cs
  74. 11
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/ITextTemplateRepository.cs
  75. 34
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplate.cs
  76. 17
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplateContentContributor.cs
  77. 3
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/FodyWeavers.xml
  78. 30
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/FodyWeavers.xsd
  79. 19
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN.Abp.TextTemplating.EntityFrameworkCore.csproj
  80. 45
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN/Abp/TextTemplating/AbpTextTemplatingDbContextModelCreatingExtensions.cs
  81. 21
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN/Abp/TextTemplating/AbpTextTemplatingEntityFrameworkCoreModule.cs
  82. 31
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN/Abp/TextTemplating/EfCoreTextTemplateRepository.cs
  83. 13
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN/Abp/TextTemplating/ITextTemplatingDbContext.cs
  84. 25
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN/Abp/TextTemplating/TextTemplatingDbContext.cs
  85. 5
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN/Abp/TextTemplating/TextTemplatingEfCoreQueryableExtensions.cs
  86. 3
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi.Client/FodyWeavers.xml
  87. 30
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi.Client/FodyWeavers.xsd
  88. 19
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi.Client/LINGYUN.Abp.TextTemplating.HttpApi.Client.csproj
  89. 19
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi.Client/LINGYUN/Abp/TextTemplating/AbpTextTemplatingHttpApiClientModule.cs
  90. 3
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi/FodyWeavers.xml
  91. 30
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi/FodyWeavers.xsd
  92. 19
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi/LINGYUN.Abp.TextTemplating.HttpApi.csproj
  93. 12
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi/LINGYUN/Abp/TextTemplating/AbpTextTemplatingControllerBase.cs
  94. 40
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi/LINGYUN/Abp/TextTemplating/AbpTextTemplatingHttpApiModule.cs
  95. 53
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi/LINGYUN/Abp/TextTemplating/TextTemplateController.cs
  96. 5
      aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/BackendAdminHttpApiHostModule.Configure.cs
  97. 5
      aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/BackendAdminHttpApiHostModule.cs
  98. 2
      aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/EntityFrameworkCore/BackendAdminMigrationsDbContext.cs
  99. 3
      aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/LY.MicroService.BackendAdmin.HttpApi.Host.csproj
  100. 354
      aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/Migrations/20220625063937_Add-Module-Text-Templating.Designer.cs

64
aspnet-core/LINGYUN.MicroService.All.sln

@ -408,7 +408,23 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Platform.Theme.VueV
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Platform.Settings.VueVbenAdmin", "modules\platform\LINGYUN.Platform.Settings.VueVbenAdmin\LINGYUN.Platform.Settings.VueVbenAdmin.csproj", "{8DF55DAB-4C1D-46F7-9324-0050F47B3BED}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Notifications.TextTemplating", "modules\common\LINGYUN.Abp.Notifications.TextTemplating\LINGYUN.Abp.Notifications.TextTemplating.csproj", "{06FF5EFA-DEDA-4E12-A482-8FCE4077F68A}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "text-templating", "text-templating", "{ABD89F39-62D9-439E-8662-BE4F36BFA04F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.TextTemplating.Domain.Shared", "modules\text-templating\LINGYUN.Abp.TextTemplating.Domain.Shared\LINGYUN.Abp.TextTemplating.Domain.Shared.csproj", "{D4B4800F-6238-4EA9-A9BB-298D668C26C4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.TextTemplating.Domain", "modules\text-templating\LINGYUN.Abp.TextTemplating.Domain\LINGYUN.Abp.TextTemplating.Domain.csproj", "{F9AC4123-7987-47D3-85D6-CD13928F3683}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.TextTemplating.Application.Contracts", "modules\text-templating\LINGYUN.Abp.TextTemplating.Application.Contracts\LINGYUN.Abp.TextTemplating.Application.Contracts.csproj", "{22BDDF5C-F911-4978-B83F-981F3652BF45}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.TextTemplating.Application", "modules\text-templating\LINGYUN.Abp.TextTemplating.Application\LINGYUN.Abp.TextTemplating.Application.csproj", "{0C824BB4-81FC-4B28-B7B1-07B2B2BB70A0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.TextTemplating.HttpApi", "modules\text-templating\LINGYUN.Abp.TextTemplating.HttpApi\LINGYUN.Abp.TextTemplating.HttpApi.csproj", "{4711320B-F98D-4CB0-BFEB-B9685B6CBCB7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.TextTemplating.EntityFrameworkCore", "modules\text-templating\LINGYUN.Abp.TextTemplating.EntityFrameworkCore\LINGYUN.Abp.TextTemplating.EntityFrameworkCore.csproj", "{130F8ED1-A64F-48DE-BF43-18EAD19CAF63}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.TextTemplating.HttpApi.Client", "modules\text-templating\LINGYUN.Abp.TextTemplating.HttpApi.Client\LINGYUN.Abp.TextTemplating.HttpApi.Client.csproj", "{A53FE09E-6B1C-46C0-9422-C313D14AE9E4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Notifications.Common", "modules\common\LINGYUN.Abp.Notifications.Common\LINGYUN.Abp.Notifications.Common.csproj", "{0CE035CF-2D8A-4559-93EC-ADBEC4237C61}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -1056,10 +1072,38 @@ Global
{8DF55DAB-4C1D-46F7-9324-0050F47B3BED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8DF55DAB-4C1D-46F7-9324-0050F47B3BED}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8DF55DAB-4C1D-46F7-9324-0050F47B3BED}.Release|Any CPU.Build.0 = Release|Any CPU
{06FF5EFA-DEDA-4E12-A482-8FCE4077F68A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{06FF5EFA-DEDA-4E12-A482-8FCE4077F68A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{06FF5EFA-DEDA-4E12-A482-8FCE4077F68A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{06FF5EFA-DEDA-4E12-A482-8FCE4077F68A}.Release|Any CPU.Build.0 = Release|Any CPU
{D4B4800F-6238-4EA9-A9BB-298D668C26C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D4B4800F-6238-4EA9-A9BB-298D668C26C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D4B4800F-6238-4EA9-A9BB-298D668C26C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D4B4800F-6238-4EA9-A9BB-298D668C26C4}.Release|Any CPU.Build.0 = Release|Any CPU
{F9AC4123-7987-47D3-85D6-CD13928F3683}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F9AC4123-7987-47D3-85D6-CD13928F3683}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F9AC4123-7987-47D3-85D6-CD13928F3683}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F9AC4123-7987-47D3-85D6-CD13928F3683}.Release|Any CPU.Build.0 = Release|Any CPU
{22BDDF5C-F911-4978-B83F-981F3652BF45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{22BDDF5C-F911-4978-B83F-981F3652BF45}.Debug|Any CPU.Build.0 = Debug|Any CPU
{22BDDF5C-F911-4978-B83F-981F3652BF45}.Release|Any CPU.ActiveCfg = Release|Any CPU
{22BDDF5C-F911-4978-B83F-981F3652BF45}.Release|Any CPU.Build.0 = Release|Any CPU
{0C824BB4-81FC-4B28-B7B1-07B2B2BB70A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0C824BB4-81FC-4B28-B7B1-07B2B2BB70A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0C824BB4-81FC-4B28-B7B1-07B2B2BB70A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0C824BB4-81FC-4B28-B7B1-07B2B2BB70A0}.Release|Any CPU.Build.0 = Release|Any CPU
{4711320B-F98D-4CB0-BFEB-B9685B6CBCB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4711320B-F98D-4CB0-BFEB-B9685B6CBCB7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4711320B-F98D-4CB0-BFEB-B9685B6CBCB7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4711320B-F98D-4CB0-BFEB-B9685B6CBCB7}.Release|Any CPU.Build.0 = Release|Any CPU
{130F8ED1-A64F-48DE-BF43-18EAD19CAF63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{130F8ED1-A64F-48DE-BF43-18EAD19CAF63}.Debug|Any CPU.Build.0 = Debug|Any CPU
{130F8ED1-A64F-48DE-BF43-18EAD19CAF63}.Release|Any CPU.ActiveCfg = Release|Any CPU
{130F8ED1-A64F-48DE-BF43-18EAD19CAF63}.Release|Any CPU.Build.0 = Release|Any CPU
{A53FE09E-6B1C-46C0-9422-C313D14AE9E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A53FE09E-6B1C-46C0-9422-C313D14AE9E4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A53FE09E-6B1C-46C0-9422-C313D14AE9E4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A53FE09E-6B1C-46C0-9422-C313D14AE9E4}.Release|Any CPU.Build.0 = Release|Any CPU
{0CE035CF-2D8A-4559-93EC-ADBEC4237C61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0CE035CF-2D8A-4559-93EC-ADBEC4237C61}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0CE035CF-2D8A-4559-93EC-ADBEC4237C61}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0CE035CF-2D8A-4559-93EC-ADBEC4237C61}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -1259,7 +1303,15 @@ Global
{88502844-D83C-4541-96AC-A8291E261F63} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{67DC7FA0-506A-4977-95F6-BC739B2BC4BA} = {F4923692-D343-4318-AECA-96F580B1A563}
{8DF55DAB-4C1D-46F7-9324-0050F47B3BED} = {F4923692-D343-4318-AECA-96F580B1A563}
{06FF5EFA-DEDA-4E12-A482-8FCE4077F68A} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{ABD89F39-62D9-439E-8662-BE4F36BFA04F} = {C5CAD011-DF84-4914-939C-0C029DCEF26F}
{D4B4800F-6238-4EA9-A9BB-298D668C26C4} = {ABD89F39-62D9-439E-8662-BE4F36BFA04F}
{F9AC4123-7987-47D3-85D6-CD13928F3683} = {ABD89F39-62D9-439E-8662-BE4F36BFA04F}
{22BDDF5C-F911-4978-B83F-981F3652BF45} = {ABD89F39-62D9-439E-8662-BE4F36BFA04F}
{0C824BB4-81FC-4B28-B7B1-07B2B2BB70A0} = {ABD89F39-62D9-439E-8662-BE4F36BFA04F}
{4711320B-F98D-4CB0-BFEB-B9685B6CBCB7} = {ABD89F39-62D9-439E-8662-BE4F36BFA04F}
{130F8ED1-A64F-48DE-BF43-18EAD19CAF63} = {ABD89F39-62D9-439E-8662-BE4F36BFA04F}
{A53FE09E-6B1C-46C0-9422-C313D14AE9E4} = {ABD89F39-62D9-439E-8662-BE4F36BFA04F}
{0CE035CF-2D8A-4559-93EC-ADBEC4237C61} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C95FDF91-16F2-4A8B-A4BE-0E62D1B66718}

12
aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN.Abp.ExceptionHandling.Notifications.csproj

@ -8,16 +8,6 @@
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<None Remove="LINGYUN\Abp\ExceptionHandling\Notifications\Localization\Resources\en.json" />
<None Remove="LINGYUN\Abp\ExceptionHandling\Notifications\Localization\Resources\zh-Hans.json" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="LINGYUN\Abp\ExceptionHandling\Notifications\Localization\Resources\en.json" />
<EmbeddedResource Include="LINGYUN\Abp\ExceptionHandling\Notifications\Localization\Resources\zh-Hans.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Localization" Version="$(VoloAbpPackageVersion)" />
</ItemGroup>
@ -25,7 +15,7 @@
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.ExceptionHandling\LINGYUN.Abp.ExceptionHandling.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.Notifications\LINGYUN.Abp.Notifications.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.Notifications.Common\LINGYUN.Abp.Notifications.Common.csproj" />
</ItemGroup>
</Project>

36
aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpExceptionHandlingNotificationDefinitionProvider.cs

@ -1,36 +0,0 @@
using LINGYUN.Abp.ExceptionHandling.Localization;
using LINGYUN.Abp.Notifications;
using Volo.Abp.Localization;
namespace LINGYUN.Abp.ExceptionHandling.Notifications
{
public class AbpExceptionHandlingNotificationDefinitionProvider : NotificationDefinitionProvider
{
public override void Define(INotificationDefinitionContext context)
{
var exceptionGroup = context.AddGroup(
AbpExceptionHandlingNotificationNames.GroupName,
L("Notifications:Exception"),
false);
exceptionGroup.AddNotification(
name: AbpExceptionHandlingNotificationNames.NotificationName,
displayName: L("Notifications:ExceptionNotifier"),
description: L("Notifications:ExceptionNotifier"),
notificationType: NotificationType.System,
lifetime: NotificationLifetime.Persistent,
allowSubscriptionToClients: false)
// 指定通知提供程序
.WithProviders(
NotificationProviderNames.SignalR,
NotificationProviderNames.Emailing)
// 设定为模板通知
.WithTemplate(typeof(ExceptionHandlingResource));
}
protected LocalizableString L(string name)
{
return LocalizableString.Create<ExceptionHandlingResource>(name);
}
}
}

8
aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpExceptionHandlingNotificationNames.cs

@ -1,8 +0,0 @@
namespace LINGYUN.Abp.ExceptionHandling.Notifications
{
public class AbpExceptionHandlingNotificationNames
{
public const string GroupName = "LINGYUN.Abp.ExceptionHandling";
public const string NotificationName = GroupName + ".Notifier";
}
}

21
aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpNotificationsExceptionHandlingModule.cs

@ -1,29 +1,12 @@
using LINGYUN.Abp.ExceptionHandling.Localization;
using LINGYUN.Abp.Notifications;
using Volo.Abp.Localization;
using LINGYUN.Abp.Notifications.Common;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.ExceptionHandling.Notifications
{
[DependsOn(
typeof(AbpExceptionHandlingModule),
typeof(AbpNotificationModule))]
typeof(AbpNotificationsCommonModule))]
public class AbpNotificationsExceptionHandlingModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpNotificationsExceptionHandlingModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<ExceptionHandlingResource>()
.AddVirtualJson("/LINGYUN/Abp/ExceptionHandling/Notifications/Localization/Resources");
});
}
}
}

4
aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpNotificationsExceptionSubscriber.cs

@ -25,9 +25,9 @@ namespace LINGYUN.Abp.ExceptionHandling.Notifications
var notificationSender = context.ServiceProvider.GetRequiredService<INotificationSender>();
// 发送错误模板消息
await notificationSender.SendNofiterAsync(
AbpExceptionHandlingNotificationNames.NotificationName,
NotificationsCommonNotificationNames.ExceptionHandling,
new NotificationTemplate(
AbpExceptionHandlingNotificationNames.NotificationName,
NotificationsCommonNotificationNames.ExceptionHandling,
formUser: "System",
data: new Dictionary<string, object>
{

7
aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/Localization/Resources/en.json

@ -1,7 +0,0 @@
{
"culture": "en",
"texts": {
"Notifications:Exception": "Exception",
"Notifications:ExceptionNotifier": "Exception Notifier"
}
}

7
aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/Localization/Resources/zh-Hans.json

@ -1,7 +0,0 @@
{
"culture": "zh-Hans",
"texts": {
"Notifications:Exception": "异常通知",
"Notifications:ExceptionNotifier": "异常推送"
}
}

0
aspnet-core/modules/common/LINGYUN.Abp.Notifications.TextTemplating/FodyWeavers.xml → aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/FodyWeavers.xml

0
aspnet-core/modules/common/LINGYUN.Abp.Notifications.TextTemplating/FodyWeavers.xsd → aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/FodyWeavers.xsd

31
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN.Abp.Notifications.Common.csproj

@ -0,0 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<None Remove="LINGYUN\Abp\Notifications\Emailing\Templates\ExceptionNotifier\*.tpl" />
<None Remove="LINGYUN\Abp\Notifications\Emailing\Templates\layout.tpl" />
<None Remove="LINGYUN\Abp\Notifications\Emailing\Templates\NewTenantRegisterd\*.tpl" />
<None Remove="LINGYUN\Abp\Notifications\Emailing\Templates\WelcomeToApplication\*.tpl" />
<None Remove="LINGYUN\Abp\Notifications\Localization\Common\*.json" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="LINGYUN\Abp\Notifications\Emailing\Templates\ExceptionNotifier\*.tpl" />
<EmbeddedResource Include="LINGYUN\Abp\Notifications\Emailing\Templates\layout.tpl" />
<EmbeddedResource Include="LINGYUN\Abp\Notifications\Emailing\Templates\NewTenantRegisterd\*.tpl" />
<EmbeddedResource Include="LINGYUN\Abp\Notifications\Emailing\Templates\WelcomeToApplication\*.tpl" />
<EmbeddedResource Include="LINGYUN\Abp\Notifications\Localization\Common\*.json" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.Notifications\LINGYUN.Abp.Notifications.csproj" />
</ItemGroup>
</Project>

26
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/AbpNotificationsCommonModule.cs

@ -0,0 +1,26 @@
using LINGYUN.Abp.Notifications.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.Notifications.Common;
[DependsOn(
typeof(AbpNotificationModule))]
public class AbpNotificationsCommonModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpNotificationsCommonModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<NotificationsResource>()
.AddVirtualJson("/LINGYUN/Abp/Notifications/Localization/Common");
});
}
}

23
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/NotificationsCommonTemplateProvider.cs

@ -0,0 +1,23 @@
using Volo.Abp.TextTemplating;
namespace LINGYUN.Abp.Notifications;
public class NotificationsCommonTemplateProvider : TemplateDefinitionProvider
{
public override void Define(ITemplateDefinitionContext context)
{
context.Add(CreateEmailTemplate());
}
protected virtual TemplateDefinition[] CreateEmailTemplate()
{
return new TemplateDefinition[]
{
new TemplateDefinition(
name: "EmailNotifierLayout",
defaultCultureName: "en",
isLayout: true)
.WithVirtualFilePath( "/LINGYUN/Abp/Notifications/Emailing/Templates/layout.tpl", isInlineLocalized: true)
};
}
}

11
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Localization/Common/en.json

@ -0,0 +1,11 @@
{
"culture": "en",
"texts": {
"Notifications:MultiTenancy": "Multi Tenancy",
"Notifications:Users": "Users",
"Notifications:NewTenantRegisterd": "Tenant creation notification",
"Notifications:WelcomeToApplication": "User Welcome Notice",
"Notifications:Primitives": "Primitives",
"Notifications:ExceptionNotifier": "Exception Notifier"
}
}

11
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Localization/Common/zh-Hans.json

@ -0,0 +1,11 @@
{
"culture": "zh-Hans",
"texts": {
"Notifications:MultiTenancy": "租户通知",
"Notifications:Users": "用户通知",
"Notifications:NewTenantRegisterd": "租户创建通知",
"Notifications:WelcomeToApplication": "用户欢迎通知",
"Notifications:Primitives": "标准通知",
"Notifications:ExceptionNotifier": "异常通知推送"
}
}

82
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/NotificationsCommonNotificationDefinitionProvider.cs

@ -0,0 +1,82 @@
using LINGYUN.Abp.Notifications.Localization;
using Volo.Abp.Localization;
using Volo.Abp.MultiTenancy;
using Volo.Abp.TextTemplating;
using Volo.Abp.Users;
namespace LINGYUN.Abp.Notifications;
public class NotificationsCommonNotificationDefinitionProvider : NotificationDefinitionProvider
{
public override void Define(INotificationDefinitionContext context)
{
var commonGroup = context.AddGroup(
NotificationsCommonNotificationNames.GroupName,
L("Notifications:Primitives"),
false);
commonGroup.AddNotification(
name: NotificationsCommonNotificationNames.ExceptionHandling,
displayName: L("Notifications:ExceptionNotifier"),
description: L("Notifications:ExceptionNotifier"),
notificationType: NotificationType.System,
lifetime: NotificationLifetime.Persistent,
allowSubscriptionToClients: false)
// 指定通知提供程序
.WithProviders(
NotificationProviderNames.SignalR,
NotificationProviderNames.Emailing)
// 设定为模板通知
.WithTemplate(typeof(NotificationsResource), layout: "EmailNotifierLayout")
.WithTemplate(template =>
{
template.WithVirtualFilePath("/LINGYUN/Abp/Notifications/Emailing/Templates/ExceptionNotifier", isInlineLocalized: false);
});
var tenantsGroup = context.AddGroup(
TenantNotificationNames.GroupName,
L("Notifications:MultiTenancy"),
false);
tenantsGroup.AddNotification(
TenantNotificationNames.NewTenantRegistered,
L("Notifications:NewTenantRegisterd"),
L("Notifications:NewTenantRegisterd"),
notificationType: NotificationType.System,
lifetime: NotificationLifetime.OnlyOne,
allowSubscriptionToClients: false
)
.WithProviders(
NotificationProviderNames.SignalR,
NotificationProviderNames.Emailing)
.WithTemplate(typeof(NotificationsResource), layout: "EmailNotifierLayout")
.WithTemplate(template =>
{
template.WithVirtualFilePath("/LINGYUN/Abp/Notifications/Emailing/Templates/NewTenantRegisterd", isInlineLocalized: false);
});
var usersGroup = context.AddGroup(
UserNotificationNames.GroupName,
L("Notifications:Users"));
usersGroup.AddNotification(
UserNotificationNames.WelcomeToApplication,
L("Notifications:WelcomeToApplication"),
L("Notifications:WelcomeToApplication"),
notificationType: NotificationType.System,
lifetime: NotificationLifetime.OnlyOne,
allowSubscriptionToClients: true)
.WithProviders(
NotificationProviderNames.SignalR,
NotificationProviderNames.Emailing)
.WithTemplate(typeof(NotificationsResource), layout: "EmailNotifierLayout")
.WithTemplate(template =>
{
template.WithVirtualFilePath("/LINGYUN/Abp/Notifications/Emailing/Templates/WelcomeToApplication", isInlineLocalized: false);
});
}
protected LocalizableString L(string name)
{
return LocalizableString.Create<NotificationsResource>(name);
}
}

11
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/NotificationsCommonNotificationNames.cs

@ -0,0 +1,11 @@
namespace LINGYUN.Abp.Notifications
{
public class NotificationsCommonNotificationNames
{
public const string GroupName = "LINGYUN.Abp.Notifications.Primitives";
/// <summary>
/// 异常处理
/// </summary>
public const string ExceptionHandling = GroupName + ".ExceptionHandling";
}
}

0
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/Volo/Abp/MultiTenancy/TenantNotificationNames.cs → aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/Volo/Abp/MultiTenancy/TenantNotificationNames.cs

0
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/Volo/Abp/Users/UserNotificationNames.cs → aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/Volo/Abp/Users/UserNotificationNames.cs

12
aspnet-core/modules/common/LINGYUN.Abp.Notifications.TextTemplating/LINGYUN/Abp/Notifications/TextTemplating/AbpNotificationsTextTemplatingModule.cs

@ -1,12 +0,0 @@
using Volo.Abp.Modularity;
using Volo.Abp.TextTemplating;
namespace LINGYUN.Abp.Notifications.TextTemplating;
[DependsOn(
typeof(AbpNotificationModule),
typeof(AbpTextTemplatingCoreModule))]
public class AbpNotificationsTextTemplatingModule : AbpModule
{
}

23
aspnet-core/modules/common/LINGYUN.Abp.Notifications.TextTemplating/LINGYUN/Abp/Notifications/TextTemplating/NotificationTemplateContentContributor.cs

@ -1,23 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.TextTemplating;
namespace LINGYUN.Abp.Notifications.TextTemplating;
public class NotificationTemplateContentContributor : ITemplateContentContributor, ITransientDependency
{
public async virtual Task<string> GetOrNullAsync(TemplateContentContributorContext context)
{
var notificationDefinitionManager = context.ServiceProvider.GetRequiredService<INotificationDefinitionManager>();
var notification = notificationDefinitionManager.GetOrNull(context.TemplateDefinition.Name);
if (notification == null)
{
return null;
}
var store = context.ServiceProvider.GetRequiredService<INotificationTemplateStore>();
return await store.GetContentOrNullAsync(context.TemplateDefinition.Name, context.Culture);
}
}

9
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationTemplateStore.cs

@ -1,9 +0,0 @@
using System.Threading;
using System.Threading.Tasks;
namespace LINGYUN.Abp.Notifications;
public interface INotificationTemplateStore
{
Task<string> GetContentOrNullAsync(string templateName, string culture = null, CancellationToken cancellationToken = default);
}

14
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Localization/Resources/en.json

@ -1,12 +1,24 @@
{
"culture": "en",
"texts": {
"Notifications": "Notifications",
"Notifications:Title": "Title",
"Notifications:Content": "Content",
"Notifications:Type": "Type",
"Notifications:SendTime": "SendTime",
"Notifications:System": "System",
"Notifications:Application": "Platform",
"Notifications:User": "User",
"Notifications:Internal": "Internal",
"Notifications:OnsideNotice": "Onside",
"Notifications:OnsideNoticeDesc": "In-app notification push",
"Notifications:ActivityNotice": "Activity",
"Notifications:ActivityNoticeDesc": "The administrator delivers an event notification push",
"Notifications:SystemNotice": "System",
"Notifications:SystemNoticeDesc": "System global notification push"
"Notifications:SystemNoticeDesc": "System global notification push",
"MarkSelectedAsRead": "Mark selected as read",
"MarkAs": "Mark as",
"Read": "Read",
"UnRead": "Un Read"
}
}

14
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Localization/Resources/zh-Hans.json

@ -1,12 +1,24 @@
{
"culture": "zh-Hans",
"texts": {
"Notifications": "通知列表",
"Notifications:Title": "标题",
"Notifications:Content": "内容",
"Notifications:Type": "类型",
"Notifications:SendTime": "发送时间",
"Notifications:System": "系统",
"Notifications:Application": "平台",
"Notifications:User": "用户",
"Notifications:Internal": "内置通知",
"Notifications:OnsideNotice": "站内通知",
"Notifications:OnsideNoticeDesc": "应用内部通知推送",
"Notifications:ActivityNotice": "活动通知",
"Notifications:ActivityNoticeDesc": "管理员下发活动通知推送",
"Notifications:SystemNotice": "系统通知",
"Notifications:SystemNoticeDesc": "系统全局消息推送"
"Notifications:SystemNoticeDesc": "系统全局消息推送",
"MarkSelectedAsRead": "标记选中已读",
"MarkAs": "标记为",
"Read": "已读",
"UnRead": "未读"
}
}

17
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDefinition.cs

@ -106,6 +106,23 @@ namespace LINGYUN.Abp.Notifications
return this;
}
public virtual NotificationDefinition WithTemplate(Action<TemplateDefinition> setup)
{
if (Template != null)
{
setup(Template);
}
else
{
var template = new TemplateDefinition(Name);
setup(template);
Template = template;
}
return this;
}
public virtual NotificationDefinition WithProperty(string key, object value)
{
Properties[key] = value;

16
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NullNotificationTemplateStore.cs

@ -1,16 +0,0 @@
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
namespace LINGYUN.Abp.Notifications;
[Dependency(TryRegister = true)]
public class NullNotificationTemplateStore : INotificationTemplateStore, ISingletonDependency
{
public readonly static INotificationTemplateStore Instance = new NullNotificationTemplateStore();
public Task<string> GetContentOrNullAsync(string templateName, string culture = null, CancellationToken cancellationToken = default)
{
return Task.FromResult<string>(null);
}
}

11
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/Dto/NotificationTemplateGetInput.cs

@ -1,11 +0,0 @@
using System.ComponentModel.DataAnnotations;
namespace LINGYUN.Abp.MessageService.Notifications;
public class NotificationTemplateGetInput
{
[Required]
public string Name { get; set; }
public string Culture { get; set; }
}

19
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/Dto/NotificationTemplateSetInput.cs

@ -1,19 +0,0 @@
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Validation;
namespace LINGYUN.Abp.MessageService.Notifications;
public class NotificationTemplateSetInput
{
[Required]
[DynamicStringLength(typeof(NotificationTemplateConsts), nameof(NotificationTemplateConsts.MaxNameLength))]
public string Name { get; set; }
[Required]
[DynamicStringLength(typeof(NotificationTemplateConsts), nameof(NotificationTemplateConsts.MaxCultureLength))]
public string Culture { get; set; }
[Required]
[DynamicStringLength(typeof(NotificationTemplateConsts), nameof(NotificationTemplateConsts.MaxContentLength))]
public string Content { get; set; }
}

4
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/INotificationAppService.cs

@ -5,10 +5,6 @@ namespace LINGYUN.Abp.MessageService.Notifications
{
public interface INotificationAppService
{
Task<NotificationTemplateDto> SetTemplateAsync(NotificationTemplateSetInput input);
Task<NotificationTemplateDto> GetTemplateAsync(NotificationTemplateGetInput input);
Task<ListResultDto<NotificationTemplateDto>> GetAssignableTemplatesAsync();
Task SendAsync(NotificationSendDto input);

2
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/AbpMessageServiceApplicationAutoMapperProfile.cs

@ -23,8 +23,6 @@ namespace LINGYUN.Abp.MessageService
}
return new NotificationData();
}));
CreateMap<Notifications.NotificationTemplate, NotificationTemplateDto>();
}
}
}

53
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Notifications/NotificationAppService.cs

@ -17,64 +17,15 @@ namespace LINGYUN.Abp.MessageService.Notifications
protected ITemplateContentProvider TemplateContentProvider { get; }
protected INotificationSender NotificationSender { get; }
protected INotificationDefinitionManager NotificationDefinitionManager { get; }
protected INotificationTemplateRepository NotificationTemplateRepository { get; }
public NotificationAppService(
INotificationSender notificationSender,
ITemplateContentProvider templateContentProvider,
INotificationDefinitionManager notificationDefinitionManager,
INotificationTemplateRepository notificationTemplateRepository)
INotificationDefinitionManager notificationDefinitionManager)
{
NotificationSender = notificationSender;
TemplateContentProvider = templateContentProvider;
NotificationDefinitionManager = notificationDefinitionManager;
NotificationTemplateRepository = notificationTemplateRepository;
}
public async virtual Task<NotificationTemplateDto> SetTemplateAsync(NotificationTemplateSetInput input)
{
var notification = GetNotificationDefinition(input.Name);
var template = await NotificationTemplateRepository.GetByNameAsync(input.Name, input.Culture);
if (template == null)
{
template = new NotificationTemplate(
GuidGenerator.Create(),
notification.Name,
notification.DisplayName.Localize(StringLocalizerFactory),
input.Content,
input.Culture,
notification.Description?.Localize(StringLocalizerFactory));
template = await NotificationTemplateRepository.InsertAsync(template);
}
else
{
template.SetContent(input.Content);
await NotificationTemplateRepository.UpdateAsync(template);
}
await CurrentUnitOfWork.SaveChangesAsync();
return ObjectMapper.Map<NotificationTemplate, NotificationTemplateDto>(template);
}
public async virtual Task<NotificationTemplateDto> GetTemplateAsync(NotificationTemplateGetInput input)
{
var notification = GetNotificationDefinition(input.Name);
var culture = input.Culture ?? CultureInfo.CurrentCulture.Name;
var content = await TemplateContentProvider.GetContentOrNullAsync(notification.Name, culture);
return new NotificationTemplateDto
{
Culture = culture,
Content = content,
Name = notification.Name,
Title = notification.DisplayName.Localize(StringLocalizerFactory),
Description = notification.Description?.Localize(StringLocalizerFactory),
};
}
public virtual Task<ListResultDto<NotificationTemplateDto>> GetAssignableTemplatesAsync()
@ -110,7 +61,7 @@ namespace LINGYUN.Abp.MessageService.Notifications
await NotificationSender
.SendNofiterAsync(
name: input.Name,
template: new Abp.Notifications.NotificationTemplate(
template: new NotificationTemplate(
notification.Name,
culture: input.Culture ?? CultureInfo.CurrentCulture.Name,
formUser: CurrentUser.Name ?? CurrentUser.UserName,

16
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/Resources/en.json

@ -19,22 +19,6 @@
"LINGYUN.Abp.Message:03410": "Users refuse to add friends",
"LINGYUN.Abp.Message:03411": "The other party is already your friend or has sent an authentication request. The operation cannot be repeated!",
"LINGYUN.Abp.Message:05404": "The notification template does not exist!",
"MarkSelectedAsRead": "Mark selected as read",
"MarkAs": "Mark as",
"Read": "Read",
"UnRead": "Un Read",
"Notifications": "Notifications",
"Notifications:Title": "Title",
"Notifications:Content": "Content",
"Notifications:Type": "Type",
"Notifications:SendTime": "SendTime",
"Notifications:System": "System",
"Notifications:Application": "Platform",
"Notifications:User": "User",
"Notifications:MultiTenancy": "Multi Tenancy",
"Notifications:Users": "Users",
"Notifications:NewTenantRegisterd": "Tenant creation notification",
"Notifications:WelcomeToApplication": "User Welcome Notice",
"Notifications:IM": "Instant Messaging",
"Notifications:FriendValidation": "Friend verification notification",
"Notifications:NewFriend": "New friend notification",

17
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/Resources/zh-Hans.json

@ -19,22 +19,6 @@
"LINGYUN.Abp.Message:03410": "用户拒绝添加好友",
"LINGYUN.Abp.Message:03411": "对方已是您的好友或已发送验证请求,不能重复操作!",
"LINGYUN.Abp.Message:05404": "通知模板不存在!",
"MarkSelectedAsRead": "标记选中已读",
"MarkAs": "标记为",
"Read": "已读",
"UnRead": "未读",
"Notifications": "通知列表",
"Notifications:Title": "标题",
"Notifications:Content": "内容",
"Notifications:Type": "类型",
"Notifications:SendTime": "发送时间",
"Notifications:System": "系统",
"Notifications:Application": "平台",
"Notifications:User": "用户",
"Notifications:MultiTenancy": "租户通知",
"Notifications:Users": "用户通知",
"Notifications:NewTenantRegisterd": "租户创建通知",
"Notifications:WelcomeToApplication": "用户欢迎通知",
"Notifications:IM": "即时通讯",
"Notifications:FriendValidation": "好友验证通知",
"Notifications:NewFriend": "新好友通知",
@ -46,6 +30,5 @@
"AddNewFriendBySearchId": "通过账号搜索添加",
"WelcomeToApplicationFormUser": "用户:{User} 欢迎您的加入!",
"Messages:NewFriend": "我已经添加您为好友,让我们一起聊天吧!"
}
}

36
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/AbpMessageServiceNotificationDefinitionProvider.cs

@ -1,8 +1,6 @@
using LINGYUN.Abp.MessageService.Localization;
using LINGYUN.Abp.Notifications;
using Volo.Abp.Localization;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Users;
namespace LINGYUN.Abp.MessageService.Notifications
{
@ -10,40 +8,6 @@ namespace LINGYUN.Abp.MessageService.Notifications
{
public override void Define(INotificationDefinitionContext context)
{
var tenantsGroup = context.AddGroup(
TenantNotificationNames.GroupName,
L("Notifications:MultiTenancy"),
false);
tenantsGroup.AddNotification(
TenantNotificationNames.NewTenantRegistered,
L("Notifications:NewTenantRegisterd"),
L("Notifications:NewTenantRegisterd"),
notificationType: NotificationType.System,
lifetime: NotificationLifetime.OnlyOne,
allowSubscriptionToClients: false
)
.WithProviders(
NotificationProviderNames.SignalR,
NotificationProviderNames.Emailing)
.WithTemplate(typeof(MessageServiceResource));
var usersGroup = context.AddGroup(
UserNotificationNames.GroupName,
L("Notifications:Users"));
usersGroup.AddNotification(
UserNotificationNames.WelcomeToApplication,
L("Notifications:WelcomeToApplication"),
L("Notifications:WelcomeToApplication"),
notificationType: NotificationType.System,
lifetime: NotificationLifetime.OnlyOne,
allowSubscriptionToClients: true)
.WithProviders(
NotificationProviderNames.SignalR,
NotificationProviderNames.Emailing)
.WithTemplate(typeof(MessageServiceResource));
var imGroup = context.AddGroup(
MessageServiceNotificationNames.IM.GroupName,
L("Notifications:IM"));

11
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/INotificationTemplateRepository.cs

@ -1,11 +0,0 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories;
namespace LINGYUN.Abp.MessageService.Notifications;
public interface INotificationTemplateRepository : IBasicRepository<NotificationTemplate, Guid>
{
Task<NotificationTemplate> GetByNameAsync(string name, string culture = null, CancellationToken cancellationToken = default);
}

37
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/NotificationTemplate.cs

@ -1,37 +0,0 @@
using System;
using Volo.Abp;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.MessageService.Notifications;
public class NotificationTemplate : AuditedEntity<Guid>, IMultiTenant
{
public virtual Guid? TenantId { get; protected set; }
public virtual string Name { get; private set; }
public virtual string Description { get; private set; }
public virtual string Title { get; private set; }
public virtual string Content { get; private set; }
public virtual string Culture { get; private set; }
protected NotificationTemplate() { }
public NotificationTemplate(
Guid id,
string name,
string title,
string content,
string culture,
string description = null)
: base(id)
{
Name = Check.NotNullOrWhiteSpace(name, nameof(name), NotificationTemplateConsts.MaxNameLength);
Title = Check.NotNullOrWhiteSpace(title, nameof(title), NotificationTemplateConsts.MaxTitleLength);
Content = Check.NotNullOrWhiteSpace(content, nameof(content), NotificationTemplateConsts.MaxContentLength);
Culture = Check.NotNullOrWhiteSpace(culture, nameof(culture), NotificationTemplateConsts.MaxCultureLength);
Description = Check.Length(description, nameof(description), NotificationTemplateConsts.MaxDescriptionLength);
}
public void SetContent(string content)
{
Content = Check.NotNullOrWhiteSpace(content, nameof(content), NotificationTemplateConsts.MaxContentLength);
}
}

31
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/NotificationTemplateStore.cs

@ -1,31 +0,0 @@
using LINGYUN.Abp.Notifications;
using Microsoft.Extensions.DependencyInjection;
using System.Globalization;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
namespace LINGYUN.Abp.MessageService.Notifications;
[Dependency(ServiceLifetime.Transient, ReplaceServices = true)]
[ExposeServices(typeof(INotificationTemplateStore))]
public class NotificationTemplateStore : INotificationTemplateStore
{
protected INotificationTemplateRepository NotificationTemplateRepository { get; }
public NotificationTemplateStore(
INotificationTemplateRepository notificationTemplateRepository)
{
NotificationTemplateRepository = notificationTemplateRepository;
}
public async virtual Task<string> GetContentOrNullAsync(string templateName, string culture = null, CancellationToken cancellationToken = default)
{
var template = await NotificationTemplateRepository.GetByNameAsync(
templateName,
culture ?? CultureInfo.CurrentCulture.Name,
cancellationToken);
return template?.Content;
}
}

1
aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/AbpMessageServiceEntityFrameworkCoreModule.cs

@ -18,7 +18,6 @@ namespace LINGYUN.Abp.MessageService.EntityFrameworkCore
context.Services.AddAbpDbContext<MessageServiceDbContext>(options =>
{
options.AddRepository<Notification, EfCoreNotificationRepository>();
options.AddRepository<NotificationTemplate, EfCoreNotificationTemplateRepository>();
options.AddRepository<UserNotification, EfCoreUserNotificationRepository>();
options.AddRepository<UserSubscribe, EfCoreUserSubscribeRepository>();

17
aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceDbContextModelCreatingExtensions.cs

@ -34,23 +34,6 @@ namespace LINGYUN.Abp.MessageService.EntityFrameworkCore
b.HasIndex(p => new { p.TenantId, p.NotificationName });
});
builder.Entity<NotificationTemplate>(b =>
{
b.ToTable(options.TablePrefix + "NotificationTemplates", options.Schema);
b.Property(p => p.Name).HasMaxLength(NotificationTemplateConsts.MaxNameLength).IsRequired();
b.Property(p => p.Title).HasMaxLength(NotificationTemplateConsts.MaxTitleLength).IsRequired();
b.Property(p => p.Content).HasMaxLength(NotificationTemplateConsts.MaxContentLength).IsRequired();
b.Property(p => p.Culture).HasMaxLength(NotificationTemplateConsts.MaxCultureLength).IsRequired();
b.Property(p => p.Description).HasMaxLength(NotificationTemplateConsts.MaxDescriptionLength);
b.ConfigureByConvention();
b.HasIndex(p => new { p.TenantId, p.Name })
.HasDatabaseName("IX_Tenant_Notification_Template_Name");
});
builder.Entity<UserNotification>(b =>
{
b.ToTable(options.TablePrefix + "UserNotifications", options.Schema);

32
aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Notifications/EfCoreNotificationTemplateRepository.cs

@ -1,32 +0,0 @@
using LINGYUN.Abp.MessageService.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Abp.MessageService.Notifications;
public class EfCoreNotificationTemplateRepository :
EfCoreRepository<IMessageServiceDbContext, NotificationTemplate, Guid>,
INotificationTemplateRepository,
ITransientDependency
{
public EfCoreNotificationTemplateRepository(
IDbContextProvider<IMessageServiceDbContext> dbContextProvider)
: base(dbContextProvider)
{
}
public async virtual Task<NotificationTemplate> GetByNameAsync(string name, string culture = null, CancellationToken cancellationToken = default)
{
return await (await GetDbSetAsync())
.Where(x => x.Name.Equals(name))
.WhereIf(!culture.IsNullOrWhiteSpace(), x => x.Culture.Equals(culture))
.FirstOrDefaultAsync(GetCancellationToken(cancellationToken));
}
}

17
aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Notifications/NotificationController.cs

@ -26,23 +26,8 @@ namespace LINGYUN.Abp.MessageService.Notifications
await NotificationAppService.SendAsync(input);
}
[HttpPost]
[Route("templates")]
public async virtual Task<NotificationTemplateDto> SetTemplateAsync(NotificationTemplateSetInput input)
{
return await NotificationAppService.SetTemplateAsync(input);
}
[HttpGet]
[Route("templates/{Name}")]
[Route("templates/{Culture}/{Name}")]
public async virtual Task<NotificationTemplateDto> GetTemplateAsync(NotificationTemplateGetInput input)
{
return await NotificationAppService.GetTemplateAsync(input);
}
[HttpGet]
[Route("templates")]
[Route("assignable-templates")]
public async virtual Task<ListResultDto<NotificationTemplateDto>> GetAssignableTemplatesAsync()
{
return await NotificationAppService.GetAssignableTemplatesAsync();

3
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

24
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN.Abp.TextTemplating.Application.Contracts.csproj

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Authorization.Abstractions" Version="$(VoloAbpPackageVersion)" />
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="$(VoloAbpPackageVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.TextTemplating.Domain.Shared\LINGYUN.Abp.TextTemplating.Domain.Shared.csproj" />
</ItemGroup>
</Project>

14
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/AbpTextTemplatingApplicationContractsModule.cs

@ -0,0 +1,14 @@
using Volo.Abp.Application;
using Volo.Abp.Authorization;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.TextTemplating;
[DependsOn(
typeof(AbpTextTemplatingDomainSharedModule),
typeof(AbpAuthorizationAbstractionsModule),
typeof(AbpDddApplicationContractsModule))]
public class AbpTextTemplatingApplicationContractsModule : AbpModule
{
}

8
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/AbpTextTemplatingRemoteServiceConsts.cs

@ -0,0 +1,8 @@
namespace LINGYUN.Abp.TextTemplating;
public class AbpTextTemplatingRemoteServiceConsts
{
public const string RemoteServiceName = "AbpTextTemplating";
public const string ModuleName = "text-templating";
}

16
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/ITextTemplateAppService.cs

@ -0,0 +1,16 @@
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
namespace LINGYUN.Abp.TextTemplating;
public interface ITextTemplateAppService : IApplicationService
{
Task<TextTemplateDto> GetAsync(TextTemplateGetInput input);
Task ResetDefaultAsync(TextTemplateGetInput input);
Task<TextTemplateDto> UpdateAsync(TextTemplateUpdateInput input);
Task<ListResultDto<TextTemplateDto>> GetListAsync();
}

23
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/Permissions/AbpTextTemplatingPermissionDefinitionProvider.cs

@ -0,0 +1,23 @@
using LINGYUN.Abp.TextTemplating.Localization;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;
namespace LINGYUN.Abp.TextTemplating;
public class AbpTextTemplatingPermissionDefinitionProvider : PermissionDefinitionProvider
{
public override void Define(IPermissionDefinitionContext context)
{
var saasGroup = context.AddGroup(AbpTextTemplatingPermissions.GroupName, L("Permission:Saas"));
var textTemplatePermission = saasGroup.AddPermission(AbpTextTemplatingPermissions.TextTemplate.Default, L("Permission:TextTemplates"));
textTemplatePermission.AddChild(AbpTextTemplatingPermissions.TextTemplate.Create, L("Permission:Create"));
textTemplatePermission.AddChild(AbpTextTemplatingPermissions.TextTemplate.Update, L("Permission:Edit"));
textTemplatePermission.AddChild(AbpTextTemplatingPermissions.TextTemplate.Delete, L("Permission:Delete"));
}
private static LocalizableString L(string name)
{
return LocalizableString.Create<AbpTextTemplatingResource>(name);
}
}

21
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/Permissions/AbpTextTemplatingPermissions.cs

@ -0,0 +1,21 @@
using Volo.Abp.Reflection;
namespace LINGYUN.Abp.TextTemplating;
public static class AbpTextTemplatingPermissions
{
public const string GroupName = "AbpTextTemplating";
public static class TextTemplate
{
public const string Default = GroupName + ".TextTemplates";
public const string Create = Default + ".Create";
public const string Update = Default + ".Update";
public const string Delete = Default + ".Delete";
}
public static string[] GetAll()
{
return ReflectionHelper.GetPublicConstantsRecursively(typeof(AbpTextTemplatingPermissions));
}
}

9
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateDto.cs

@ -0,0 +1,9 @@
namespace LINGYUN.Abp.TextTemplating;
public class TextTemplateDto
{
public string Name { get; set; }
public string DisplayName { get; set; }
public string Content { get; set; }
public string Culture { get; set; }
}

14
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateGetInput.cs

@ -0,0 +1,14 @@
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Validation;
namespace LINGYUN.Abp.TextTemplating;
public class TextTemplateGetInput
{
[Required]
[DynamicStringLength(typeof(TextTemplateConsts), nameof(TextTemplateConsts.MaxNameLength))]
public string Name { get; set; }
[DynamicStringLength(typeof(TextTemplateConsts), nameof(TextTemplateConsts.MaxCultureLength))]
public string Culture { get; set; }
}

19
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateUpdateInput.cs

@ -0,0 +1,19 @@
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Validation;
namespace LINGYUN.Abp.TextTemplating;
public class TextTemplateUpdateInput
{
[Required]
[DynamicStringLength(typeof(TextTemplateConsts), nameof(TextTemplateConsts.MaxNameLength))]
public string Name { get; set; }
[Required]
[DynamicStringLength(typeof(TextTemplateConsts), nameof(TextTemplateConsts.MaxCultureLength))]
public string Culture { get; set; }
[Required]
[DynamicStringLength(typeof(TextTemplateConsts), nameof(TextTemplateConsts.MaxContentLength))]
public string Content { get; set; }
}

3
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

21
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN.Abp.TextTemplating.Application.csproj

@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Application" Version="$(VoloAbpPackageVersion)" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="$(VoloAbpPackageVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.TextTemplating.Application.Contracts\LINGYUN.Abp.TextTemplating.Application.Contracts.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.TextTemplating.Domain\LINGYUN.Abp.TextTemplating.Domain.csproj" />
</ItemGroup>
</Project>

13
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN/Abp/TextTemplating/AbpTextTemplatingAppServiceBase.cs

@ -0,0 +1,13 @@
using LINGYUN.Abp.TextTemplating.Localization;
using Volo.Abp.Application.Services;
namespace LINGYUN.Abp.TextTemplating;
public abstract class AbpTextTemplatingAppServiceBase : ApplicationService
{
protected AbpTextTemplatingAppServiceBase()
{
ObjectMapperContext = typeof(AbpTextTemplatingApplicationModule);
LocalizationResource = typeof(AbpTextTemplatingResource);
}
}

11
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN/Abp/TextTemplating/AbpTextTemplatingApplicationAutoMapperProfile.cs

@ -0,0 +1,11 @@
using AutoMapper;
namespace LINGYUN.Abp.TextTemplating;
public class AbpTextTemplatingApplicationAutoMapperProfile : Profile
{
public AbpTextTemplatingApplicationAutoMapperProfile()
{
CreateMap<TextTemplate, TextTemplateDto>();
}
}

23
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN/Abp/TextTemplating/AbpTextTemplatingApplicationModule.cs

@ -0,0 +1,23 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Application;
using Volo.Abp.AutoMapper;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.TextTemplating;
[DependsOn(
typeof(AbpTextTemplatingDomainModule),
typeof(AbpTextTemplatingApplicationContractsModule),
typeof(AbpAutoMapperModule),
typeof(AbpDddApplicationModule))]
public class AbpTextTemplatingApplicationModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAutoMapperObjectMapper<AbpTextTemplatingApplicationModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<AbpTextTemplatingApplicationAutoMapperProfile>(validate: true);
});
}
}

135
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN/Abp/TextTemplating/TextTemplateAppService.cs

@ -0,0 +1,135 @@
using Microsoft.AspNetCore.Authorization;
using System.Collections.Generic;
using System.Globalization;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Localization;
using Volo.Abp.TextTemplating;
namespace LINGYUN.Abp.TextTemplating;
[Authorize(AbpTextTemplatingPermissions.TextTemplate.Default)]
public class TextTemplateAppService : AbpTextTemplatingAppServiceBase, ITextTemplateAppService
{
protected ITextTemplateRepository TextTemplateRepository { get; }
protected ITemplateContentProvider TemplateContentProvider { get; }
protected ITemplateDefinitionManager TemplateDefinitionManager { get; }
public TextTemplateAppService(
ITextTemplateRepository textTemplateRepository,
ITemplateContentProvider templateContentProvider,
ITemplateDefinitionManager templateDefinitionManager)
{
TextTemplateRepository = textTemplateRepository;
TemplateContentProvider = templateContentProvider;
TemplateDefinitionManager = templateDefinitionManager;
}
public async virtual Task<TextTemplateDto> GetAsync(TextTemplateGetInput input)
{
var templateDefinition = GetTemplateDefinition(input.Name);
var culture = input.Culture ?? CultureInfo.CurrentCulture.Name ?? templateDefinition.DefaultCultureName;
using (CultureHelper.Use(culture, culture))
{
var content = await TemplateContentProvider.GetContentOrNullAsync(templateDefinition.Name, culture);
return new TextTemplateDto
{
Culture = culture,
Content = content,
Name = templateDefinition.Name,
DisplayName = templateDefinition.DisplayName.Localize(StringLocalizerFactory),
};
}
}
public Task<ListResultDto<TextTemplateDto>> GetListAsync()
{
var templates = new List<TextTemplateDto>();
var templateDefinitions = TemplateDefinitionManager.GetAll();
foreach (var templateDefinition in templateDefinitions)
{
templates.Add(
new TextTemplateDto
{
Name = templateDefinition.Name,
Culture = CultureInfo.CurrentCulture.Name ?? templateDefinition.DefaultCultureName,
DisplayName = templateDefinition.DisplayName.Localize(StringLocalizerFactory),
});
}
return Task.FromResult(new ListResultDto<TextTemplateDto>(templates));
}
[Authorize(AbpTextTemplatingPermissions.TextTemplate.Delete)]
public async virtual Task ResetDefaultAsync(TextTemplateGetInput input)
{
var templateDefinition = GetTemplateDefinition(input.Name);
var culture = input.Culture ?? CultureInfo.CurrentCulture.Name ?? templateDefinition.DefaultCultureName;
using (CultureHelper.Use(culture, culture))
{
var template = await TextTemplateRepository.FindByNameAsync(
templateDefinition.Name,
culture);
if (template != null)
{
await TextTemplateRepository.DeleteAsync(template);
}
}
}
[Authorize(AbpTextTemplatingPermissions.TextTemplate.Update)]
public async virtual Task<TextTemplateDto> UpdateAsync(TextTemplateUpdateInput input)
{
var templateDefinition = GetTemplateDefinition(input.Name);
var culture = input.Culture ?? CultureInfo.CurrentCulture.Name ?? templateDefinition.DefaultCultureName;
using (CultureHelper.Use(culture, culture))
{
var template = await TextTemplateRepository.FindByNameAsync(input.Name, culture);
if (template == null)
{
template = new TextTemplate(
GuidGenerator.Create(),
templateDefinition.Name,
templateDefinition.DisplayName.Localize(StringLocalizerFactory),
input.Content,
culture);
template = await TextTemplateRepository.InsertAsync(template);
}
else
{
template.SetContent(input.Content);
await TextTemplateRepository.UpdateAsync(template);
}
await CurrentUnitOfWork.SaveChangesAsync();
return ObjectMapper.Map<TextTemplate, TextTemplateDto>(template);
}
}
protected virtual TemplateDefinition GetTemplateDefinition(string name)
{
var template = TemplateDefinitionManager.GetOrNull(name);
if (template == null)
{
throw new BusinessException(
AbpTextTemplatingErrorCodes.TemplateNotFound,
$"The text template {name} does not exist!")
.WithData("Name", name);
}
return template;
}
}

3
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

20
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN.Abp.TextTemplating.Domain.Shared.csproj

@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<None Remove="LINGYUN\Abp\TextTemplating\Localization\Resources\*.json" />
<EmbeddedResource Include="LINGYUN\Abp\TextTemplating\Localization\Resources\*.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Validation" Version="$(VoloAbpPackageVersion)" />
</ItemGroup>
</Project>

33
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/AbpTextTemplatingDomainSharedModule.cs

@ -0,0 +1,33 @@
using LINGYUN.Abp.TextTemplating.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Modularity;
using Volo.Abp.Validation;
using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.TextTemplating;
[DependsOn(
typeof(AbpValidationModule))]
public class AbpTextTemplatingDomainSharedModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpTextTemplatingDomainSharedModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Add<AbpTextTemplatingResource>("en")
.AddVirtualJson("/LINGYUN/Abp/TextTemplating/Localization/Resources");
});
Configure<AbpExceptionLocalizationOptions>(options =>
{
options.MapCodeNamespace(AbpTextTemplatingErrorCodes.Namespace, typeof(AbpTextTemplatingResource));
});
}
}

11
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/AbpTextTemplatingErrorCodes.cs

@ -0,0 +1,11 @@
namespace LINGYUN.Abp.TextTemplating;
public static class AbpTextTemplatingErrorCodes
{
public const string Namespace = "TextTemplating";
/// <summary>
/// 模板不存在!
/// </summary>
public const string TemplateNotFound = Namespace + ":01404";
}

8
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/Localization/AbpTextTemplatingResource.cs

@ -0,0 +1,8 @@
using Volo.Abp.Localization;
namespace LINGYUN.Abp.TextTemplating.Localization;
[LocalizationResourceName("AbpTextTemplating")]
public class AbpTextTemplatingResource
{
}

5
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/Localization/Resources/en.json

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

5
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/Localization/Resources/zh-Hans.json

@ -0,0 +1,5 @@
{
"culture": "zh-Hans",
"texts": {
}
}

12
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/TextTemplateConsts.cs

@ -0,0 +1,12 @@
namespace LINGYUN.Abp.TextTemplating;
public static class TextTemplateConsts
{
public static int MaxNameLength { get; set; } = 100;
public static int MaxDisplayNameLength { get; set; } = 100;
public static int MaxContentLength { get; set; } = 1024 * 1024;
public static int MaxCultureLength { get; set; } = 30;
}

3
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

4
aspnet-core/modules/common/LINGYUN.Abp.Notifications.TextTemplating/LINGYUN.Abp.Notifications.TextTemplating.csproj → aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN.Abp.TextTemplating.Domain.csproj

@ -9,11 +9,11 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="$(VoloAbpPackageVersion)" />
<PackageReference Include="Volo.Abp.TextTemplating.Core" Version="$(VoloAbpPackageVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.Notifications\LINGYUN.Abp.Notifications.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.TextTemplating.Domain.Shared\LINGYUN.Abp.TextTemplating.Domain.Shared.csproj" />
</ItemGroup>
</Project>

12
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/AbpTextTemplatingDbProperties.cs

@ -0,0 +1,12 @@
using Volo.Abp.Data;
namespace LINGYUN.Abp.TextTemplating;
public class AbpTextTemplatingDbProperties
{
public static string DbTablePrefix { get; set; } = AbpCommonDbProperties.DbTablePrefix;
public static string DbSchema { get; set; } = AbpCommonDbProperties.DbSchema;
public const string ConnectionStringName = "AbpTextTemplating";
}

12
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/AbpTextTemplatingDomainModule.cs

@ -0,0 +1,12 @@
using Volo.Abp.Modularity;
using Volo.Abp.TextTemplating;
namespace LINGYUN.Abp.TextTemplating;
[DependsOn(
typeof(AbpTextTemplatingDomainSharedModule),
typeof(AbpTextTemplatingCoreModule))]
public class AbpTextTemplatingDomainModule : AbpModule
{
}

11
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/ITextTemplateRepository.cs

@ -0,0 +1,11 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories;
namespace LINGYUN.Abp.TextTemplating;
public interface ITextTemplateRepository : IBasicRepository<TextTemplate, Guid>
{
Task<TextTemplate> FindByNameAsync(string name, string culture = null, CancellationToken cancellationToken = default);
}

34
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplate.cs

@ -0,0 +1,34 @@
using System;
using Volo.Abp;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.TextTemplating;
public class TextTemplate : AuditedEntity<Guid>, IMultiTenant
{
public virtual Guid? TenantId { get; protected set; }
public virtual string Name { get; private set; }
public virtual string DisplayName { get; private set; }
public virtual string Content { get; private set; }
public virtual string Culture { get; private set; }
protected TextTemplate() { }
public TextTemplate(
Guid id,
string name,
string displayName,
string content,
string culture)
: base(id)
{
Name = Check.NotNullOrWhiteSpace(name, nameof(name), TextTemplateConsts.MaxNameLength);
DisplayName = Check.NotNullOrWhiteSpace(displayName, nameof(displayName), TextTemplateConsts.MaxDisplayNameLength);
Content = Check.NotNullOrWhiteSpace(content, nameof(content), TextTemplateConsts.MaxContentLength);
Culture = Check.NotNullOrWhiteSpace(culture, nameof(culture), TextTemplateConsts.MaxCultureLength);
}
public void SetContent(string content)
{
Content = Check.NotNullOrWhiteSpace(content, nameof(content), TextTemplateConsts.MaxContentLength);
}
}

17
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplateContentContributor.cs

@ -0,0 +1,17 @@
using Microsoft.Extensions.DependencyInjection;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.TextTemplating;
namespace LINGYUN.Abp.TextTemplating;
public class TextTemplateContentContributor : ITemplateContentContributor, ITransientDependency
{
public async virtual Task<string> GetOrNullAsync(TemplateContentContributorContext context)
{
var repository = context.ServiceProvider.GetRequiredService<ITextTemplateRepository>();
var template = await repository.FindByNameAsync(context.TemplateDefinition.Name, context.Culture);
return template?.Content;
}
}

3
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

19
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN.Abp.TextTemplating.EntityFrameworkCore.csproj

@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.TextTemplating.Domain\LINGYUN.Abp.TextTemplating.Domain.csproj" />
</ItemGroup>
</Project>

45
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN/Abp/TextTemplating/AbpTextTemplatingDbContextModelCreatingExtensions.cs

@ -0,0 +1,45 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace LINGYUN.Abp.TextTemplating.EntityFrameworkCore;
public static class AbpTextTemplatingDbContextModelCreatingExtensions
{
public static void ConfigureTextTemplating(
this ModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
builder.Entity<TextTemplate>(b =>
{
b.ToTable(AbpTextTemplatingDbProperties.DbTablePrefix + "TextTemplates", AbpTextTemplatingDbProperties.DbSchema);
b.ConfigureByConvention();
b.Property(t => t.Name)
.HasColumnName(nameof(TextTemplate.Name))
.HasMaxLength(TextTemplateConsts.MaxNameLength)
.IsRequired();
b.Property(t => t.DisplayName)
.HasColumnName(nameof(TextTemplate.DisplayName))
.HasMaxLength(TextTemplateConsts.MaxDisplayNameLength)
.IsRequired();
b.Property(t => t.Culture)
.HasColumnName(nameof(TextTemplate.Culture))
.HasMaxLength(TextTemplateConsts.MaxCultureLength)
.IsRequired();
b.Property(t => t.Content)
.HasColumnName(nameof(TextTemplate.Content))
.HasMaxLength(TextTemplateConsts.MaxContentLength);
b.HasIndex(p => new { p.TenantId, p.Name })
.HasDatabaseName("IX_Tenant_Text_Template_Name");
b.ApplyObjectExtensionMappings();
});
builder.TryConfigureObjectExtensions<TextTemplatingDbContext>();
}
}

21
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN/Abp/TextTemplating/AbpTextTemplatingEntityFrameworkCoreModule.cs

@ -0,0 +1,21 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.TextTemplating.EntityFrameworkCore;
[DependsOn(
typeof(AbpTextTemplatingDomainModule),
typeof(AbpEntityFrameworkCoreModule))]
public class AbpTextTemplatingEntityFrameworkCoreModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAbpDbContext<TextTemplatingDbContext>(options =>
{
options.AddRepository<TextTemplate, EfCoreTextTemplateRepository>();
options.AddDefaultRepositories<ITextTemplatingDbContext>();
});
}
}

31
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN/Abp/TextTemplating/EfCoreTextTemplateRepository.cs

@ -0,0 +1,31 @@
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Abp.TextTemplating.EntityFrameworkCore;
public class EfCoreTextTemplateRepository :
EfCoreRepository<ITextTemplatingDbContext, TextTemplate, Guid>,
ITextTemplateRepository,
ITransientDependency
{
public EfCoreTextTemplateRepository(
IDbContextProvider<ITextTemplatingDbContext> dbContextProvider)
: base(dbContextProvider)
{
}
public async virtual Task<TextTemplate> FindByNameAsync(string name, string culture = null, CancellationToken cancellationToken = default)
{
return await (await GetDbSetAsync())
.Where(x => x.Name.Equals(name))
.WhereIf(!culture.IsNullOrWhiteSpace(), x => x.Culture.Equals(culture))
.FirstOrDefaultAsync(GetCancellationToken(cancellationToken));
}
}

13
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN/Abp/TextTemplating/ITextTemplatingDbContext.cs

@ -0,0 +1,13 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.TextTemplating.EntityFrameworkCore;
[IgnoreMultiTenancy]
[ConnectionStringName(AbpTextTemplatingDbProperties.ConnectionStringName)]
public interface ITextTemplatingDbContext : IEfCoreDbContext
{
DbSet<TextTemplate> TextTemplates { get; }
}

25
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN/Abp/TextTemplating/TextTemplatingDbContext.cs

@ -0,0 +1,25 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.TextTemplating.EntityFrameworkCore;
[IgnoreMultiTenancy]
[ConnectionStringName(AbpTextTemplatingDbProperties.ConnectionStringName)]
public class TextTemplatingDbContext : AbpDbContext<TextTemplatingDbContext>, ITextTemplatingDbContext
{
public DbSet<TextTemplate> TextTemplates { get; set; }
public TextTemplatingDbContext(DbContextOptions<TextTemplatingDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
builder.ConfigureTextTemplating();
}
}

5
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN/Abp/TextTemplating/TextTemplatingEfCoreQueryableExtensions.cs

@ -0,0 +1,5 @@
namespace LINGYUN.Abp.TextTemplating.EntityFrameworkCore;
public static class TextTemplatingEfCoreQueryableExtensions
{
}

3
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi.Client/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi.Client/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

19
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi.Client/LINGYUN.Abp.TextTemplating.HttpApi.Client.csproj

@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client" Version="$(VoloAbpPackageVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.TextTemplating.Application.Contracts\LINGYUN.Abp.TextTemplating.Application.Contracts.csproj" />
</ItemGroup>
</Project>

19
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi.Client/LINGYUN/Abp/TextTemplating/AbpTextTemplatingHttpApiClientModule.cs

@ -0,0 +1,19 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Http.Client;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.TextTemplating;
[DependsOn(
typeof(AbpTextTemplatingApplicationContractsModule),
typeof(AbpHttpClientModule))]
public class AbpTextTemplatingHttpApiClientModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddHttpClientProxies(
typeof(AbpTextTemplatingApplicationContractsModule).Assembly,
AbpTextTemplatingRemoteServiceConsts.RemoteServiceName
);
}
}

3
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

19
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi/LINGYUN.Abp.TextTemplating.HttpApi.csproj

@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="$(VoloAbpPackageVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.TextTemplating.Application.Contracts\LINGYUN.Abp.TextTemplating.Application.Contracts.csproj" />
</ItemGroup>
</Project>

12
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi/LINGYUN/Abp/TextTemplating/AbpTextTemplatingControllerBase.cs

@ -0,0 +1,12 @@
using LINGYUN.Abp.TextTemplating.Localization;
using Volo.Abp.AspNetCore.Mvc;
namespace LINGYUN.Abp.TextTemplating;
public abstract class AbpTextTemplatingControllerBase : AbpControllerBase
{
protected AbpTextTemplatingControllerBase()
{
LocalizationResource = typeof(AbpTextTemplatingResource);
}
}

40
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi/LINGYUN/Abp/TextTemplating/AbpTextTemplatingHttpApiModule.cs

@ -0,0 +1,40 @@
using LINGYUN.Abp.TextTemplating.Localization;
using Localization.Resources.AbpUi;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.TextTemplating;
[DependsOn(
typeof(AbpTextTemplatingApplicationContractsModule),
typeof(AbpAspNetCoreMvcModule))]
public class AbpTextTemplatingHttpApiModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<IMvcBuilder>(mvcBuilder =>
{
mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpTextTemplatingHttpApiModule).Assembly);
});
PreConfigure<AbpMvcDataAnnotationsLocalizationOptions>(options =>
{
options.AddAssemblyResource(
typeof(AbpTextTemplatingResource),
typeof(AbpTextTemplatingApplicationContractsModule).Assembly);
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<AbpTextTemplatingResource>()
.AddBaseTypes(typeof(AbpUiResource));
});
}
}

53
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi/LINGYUN/Abp/TextTemplating/TextTemplateController.cs

@ -0,0 +1,53 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
namespace LINGYUN.Abp.TextTemplating;
[Controller]
[Authorize(AbpTextTemplatingPermissions.TextTemplate.Default)]
[RemoteService(Name = AbpTextTemplatingRemoteServiceConsts.RemoteServiceName)]
[Area(AbpTextTemplatingRemoteServiceConsts.ModuleName)]
[Route("api/text-templating/templates")]
public class TextTemplateController : AbpTextTemplatingControllerBase, ITextTemplateAppService
{
protected ITextTemplateAppService TextTemplateAppService { get; }
public TextTemplateController(
ITextTemplateAppService textTemplateAppService)
{
TextTemplateAppService = textTemplateAppService;
}
[HttpGet]
[Route("{Name}")]
[Route("{Culture}/{Name}")]
public Task<TextTemplateDto> GetAsync(TextTemplateGetInput input)
{
return TextTemplateAppService.GetAsync(input);
}
[HttpGet]
public Task<ListResultDto<TextTemplateDto>> GetListAsync()
{
return TextTemplateAppService.GetListAsync();
}
[HttpDelete]
[Route("{Name}")]
[Route("{Culture}/{Name}")]
[Authorize(AbpTextTemplatingPermissions.TextTemplate.Delete)]
public Task ResetDefaultAsync(TextTemplateGetInput input)
{
return TextTemplateAppService.ResetDefaultAsync(input);
}
[HttpPost]
[Authorize(AbpTextTemplatingPermissions.TextTemplate.Update)]
public Task<TextTemplateDto> UpdateAsync(TextTemplateUpdateInput input)
{
return TextTemplateAppService.UpdateAsync(input);
}
}

5
aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/BackendAdminHttpApiHostModule.Configure.cs

@ -326,6 +326,11 @@ public partial class BackendAdminHttpApiHostModule
options.Audience = configuration["AuthServer:ApiName"];
});
if (isDevelopment)
{
// services.AddAlwaysAllowAuthorization();
}
if (!isDevelopment)
{
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);

5
aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/BackendAdminHttpApiHostModule.cs

@ -17,6 +17,8 @@ using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using LINGYUN.Abp.SettingManagement;
using LINGYUN.Abp.Sms.Aliyun;
using LINGYUN.Abp.TextTemplating;
using LINGYUN.Abp.TextTemplating.EntityFrameworkCore;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
@ -59,6 +61,8 @@ namespace LY.MicroService.BackendAdmin;
typeof(AbpAuditingHttpApiModule),
typeof(AbpSaasApplicationModule),
typeof(AbpSaasHttpApiModule),
typeof(AbpTextTemplatingApplicationModule),
typeof(AbpTextTemplatingHttpApiModule),
typeof(AbpEntityFrameworkCoreMySQLModule),
typeof(AbpIdentityEntityFrameworkCoreModule),// 用户角色权限需要引用包
typeof(AbpIdentityServerEntityFrameworkCoreModule), // 客户端权限需要引用包
@ -70,6 +74,7 @@ namespace LY.MicroService.BackendAdmin;
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpFeatureManagementEntityFrameworkCoreModule),
typeof(AbpLocalizationManagementEntityFrameworkCoreModule),
typeof(AbpTextTemplatingEntityFrameworkCoreModule),
typeof(AbpDataDbMigratorModule),
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpEmailingExceptionHandlingModule),

2
aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/EntityFrameworkCore/BackendAdminMigrationsDbContext.cs

@ -4,6 +4,7 @@ using Volo.Abp.FeatureManagement.EntityFrameworkCore;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.SettingManagement.EntityFrameworkCore;
using LINGYUN.Abp.Saas.EntityFrameworkCore;
using LINGYUN.Abp.TextTemplating.EntityFrameworkCore;
namespace LY.MicroService.BackendAdmin.EntityFrameworkCore;
@ -23,5 +24,6 @@ public class BackendAdminMigrationsDbContext : AbpDbContext<BackendAdminMigratio
modelBuilder.ConfigureSaas();
modelBuilder.ConfigureSettingManagement();
modelBuilder.ConfigurePermissionManagement();
modelBuilder.ConfigureTextTemplating();
}
}

3
aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/LY.MicroService.BackendAdmin.HttpApi.Host.csproj

@ -70,5 +70,8 @@
<ProjectReference Include="..\..\modules\saas\LINGYUN.Abp.Saas.Application\LINGYUN.Abp.Saas.Application.csproj" />
<ProjectReference Include="..\..\modules\saas\LINGYUN.Abp.Saas.EntityFrameworkCore\LINGYUN.Abp.Saas.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\saas\LINGYUN.Abp.Saas.HttpApi\LINGYUN.Abp.Saas.HttpApi.csproj" />
<ProjectReference Include="..\..\modules\text-templating\LINGYUN.Abp.TextTemplating.Application\LINGYUN.Abp.TextTemplating.Application.csproj" />
<ProjectReference Include="..\..\modules\text-templating\LINGYUN.Abp.TextTemplating.EntityFrameworkCore\LINGYUN.Abp.TextTemplating.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\text-templating\LINGYUN.Abp.TextTemplating.HttpApi\LINGYUN.Abp.TextTemplating.HttpApi.csproj" />
</ItemGroup>
</Project>

354
aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/Migrations/20220625063937_Add-Module-Text-Templating.Designer.cs

@ -0,0 +1,354 @@
// <auto-generated />
using System;
using LY.MicroService.BackendAdmin.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
#nullable disable
namespace LY.MicroService.BackendAdmin.Migrations
{
[DbContext(typeof(BackendAdminMigrationsDbContext))]
[Migration("20220625063937_Add-Module-Text-Templating")]
partial class AddModuleTextTemplating
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "6.0.6")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("LINGYUN.Abp.Saas.Editions.Edition", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.HasKey("Id");
b.HasIndex("DisplayName");
b.ToTable("AbpEditions", (string)null);
});
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<DateTime?>("DisableTime")
.HasColumnType("datetime(6)");
b.Property<Guid?>("EditionId")
.HasColumnType("char(36)");
b.Property<DateTime?>("EnableTime")
.HasColumnType("datetime(6)");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.HasKey("Id");
b.HasIndex("EditionId");
b.HasIndex("Name");
b.ToTable("AbpTenants", (string)null);
});
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b =>
{
b.Property<Guid>("TenantId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("varchar(1024)");
b.HasKey("TenantId", "Name");
b.ToTable("AbpTenantConnectionStrings", (string)null);
});
modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplate", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Content")
.HasMaxLength(1048576)
.HasColumnType("longtext")
.HasColumnName("Content");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<string>("Culture")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("varchar(30)")
.HasColumnName("Culture");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)")
.HasColumnName("DisplayName");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)")
.HasColumnName("Name");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.HasKey("Id");
b.HasIndex("TenantId", "Name")
.HasDatabaseName("IX_Tenant_Text_Template_Name");
b.ToTable("AbpTextTemplates", (string)null);
});
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<string>("ProviderKey")
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.Property<string>("ProviderName")
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey")
.IsUnique();
b.ToTable("AbpFeatureValues", (string)null);
});
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<string>("ProviderKey")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.Property<string>("ProviderName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.HasKey("Id");
b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey")
.IsUnique();
b.ToTable("AbpPermissionGrants", (string)null);
});
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<string>("ProviderKey")
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.Property<string>("ProviderName")
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(2048)
.HasColumnType("varchar(2048)");
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey")
.IsUnique();
b.ToTable("AbpSettings", (string)null);
});
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b =>
{
b.HasOne("LINGYUN.Abp.Saas.Editions.Edition", "Edition")
.WithMany()
.HasForeignKey("EditionId");
b.Navigation("Edition");
});
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b =>
{
b.HasOne("LINGYUN.Abp.Saas.Tenants.Tenant", null)
.WithMany("ConnectionStrings")
.HasForeignKey("TenantId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b =>
{
b.Navigation("ConnectionStrings");
});
#pragma warning restore 612, 618
}
}
}

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

Loading…
Cancel
Save