Browse Source

Merge pull request #200 from colinin/4.2

backlog commits
pull/252/head
cKey 5 years ago
committed by GitHub
parent
commit
076d041988
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      aspnet-core/LINGYUN.MicroService.All.sln
  2. 56
      aspnet-core/LINGYUN.MicroService.Common.sln
  3. 30
      aspnet-core/LINGYUN.MicroService.Platform.sln
  4. 2
      aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN.Abp.Account.Application.Contracts.csproj
  5. 4
      aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN.Abp.Account.Application.csproj
  6. 2
      aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN.Abp.Account.Domain.Shared.csproj
  7. 2
      aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN.Abp.Account.Domain.csproj
  8. 2
      aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN.Abp.Account.HttpApi.csproj
  9. 6
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/LINGYUN.Abp.Account.Web.csproj
  10. 4
      aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN.ApiGateway.Application.Contracts.csproj
  11. 4
      aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN.ApiGateway.Application.csproj
  12. 3
      aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/AggregateReRouteAppService.cs
  13. 3
      aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/GlobalConfigurationAppService.cs
  14. 3
      aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/ReRouteAppService.cs
  15. 3
      aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/RouteGroupAppService.cs
  16. 2
      aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain.Shared/LINGYUN.ApiGateway.Domain.Shared.csproj
  17. 4
      aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain/LINGYUN.ApiGateway.Domain.csproj
  18. 2
      aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN.ApiGateway.EntityFrameworkCore.csproj
  19. 12
      aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreAggregateReRouteRepository.cs
  20. 9
      aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreDynamicReRouteRepository.cs
  21. 18
      aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreGlobalConfigRepository.cs
  22. 27
      aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreReRouteRepository.cs
  23. 9
      aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreRouteGroupRepository.cs
  24. 2
      aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi.Client/LINGYUN.ApiGateway.HttpApi.Client.csproj
  25. 2
      aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi/LINGYUN.ApiGateway.HttpApi.csproj
  26. 6
      aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi/LINGYUN/ApiGateway/Ocelot/GlobalConfigurationController.cs
  27. 10
      aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN.Abp.Auditing.Application.Contracts.csproj
  28. 8
      aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN.Abp.Auditing.Application.csproj
  29. 2
      aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN.Abp.Auditing.HttpApi.csproj
  30. 9
      aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN.Abp.Aliyun.csproj
  31. 21
      aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINYUN/Abp/Aliyun/AbpAliyunException.cs
  32. 8
      aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINYUN/Abp/Aliyun/AbpAliyunModule.cs
  33. 32
      aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINYUN/Abp/Aliyun/AcsClientFactory.cs
  34. 31
      aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINYUN/Abp/Aliyun/AliyunBasicSessionCredentialsCacheItem.cs
  35. 180
      aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINYUN/Abp/Aliyun/AliyunClientFactory.cs
  36. 15
      aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINYUN/Abp/Aliyun/IAcsClientFactory.cs
  37. 18
      aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINYUN/Abp/Aliyun/Localization/Resources/en.json
  38. 18
      aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINYUN/Abp/Aliyun/Localization/Resources/zh-Hans.json
  39. 32
      aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINYUN/Abp/Aliyun/Settings/AliyunSettingNames.cs
  40. 81
      aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINYUN/Abp/Aliyun/Settings/AliyunSettingProvider.cs
  41. 31
      aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/README.md
  42. 6
      aspnet-core/modules/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN.Abp.Tencent.csproj
  43. 2
      aspnet-core/modules/common/LINGYUN.Abp.Aliyun.Authorization/LINGYUN.Abp.Aliyun.Authorization.csproj
  44. 2
      aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.Mvc.Validation/LINGYUN.Abp.AspNetCore.Mvc.Validation.csproj
  45. 2
      aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json.csproj
  46. 2
      aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR/LINGYUN.Abp.AspNetCore.SignalR.JwtToken.csproj
  47. 4
      aspnet-core/modules/common/LINGYUN.Abp.BackgroundJobs.Hangfire/LINGYUN.Abp.BackgroundJobs.Hangfire.csproj
  48. 2
      aspnet-core/modules/common/LINGYUN.Abp.BackgroundJobs/LINGYUN.Abp.BackgroundJobs.csproj
  49. 4
      aspnet-core/modules/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN.Abp.BlobStoring.Aliyun.csproj
  50. 4
      aspnet-core/modules/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AbpBlobStoringAliyunModule.cs
  51. 43
      aspnet-core/modules/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProvider.cs
  52. 15
      aspnet-core/modules/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/IOssClientFactory.cs
  53. 50
      aspnet-core/modules/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/OssClientFactory.cs
  54. 6
      aspnet-core/modules/common/LINGYUN.Abp.BlobStoring.Aliyun/README.md
  55. 2
      aspnet-core/modules/common/LINGYUN.Abp.Core/LINGYUN.Abp.Core.csproj
  56. 2
      aspnet-core/modules/common/LINGYUN.Abp.DistributedLock.Redis/LINGYUN.Abp.DistributedLock.Redis.csproj
  57. 2
      aspnet-core/modules/common/LINGYUN.Abp.Domain.Entities.Events/LINGYUN.Abp.Domain.Entities.Events.csproj
  58. 4
      aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.csproj
  59. 2
      aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN.Abp.ExceptionHandling.Emailing.csproj
  60. 2
      aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN.Abp.ExceptionHandling.Notifications.csproj
  61. 2
      aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling/LINGYUN.Abp.ExceptionHandling.csproj
  62. 2
      aspnet-core/modules/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN.Abp.Features.LimitValidation.Redis.csproj
  63. 2
      aspnet-core/modules/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN.Abp.Features.LimitValidation.csproj
  64. 2
      aspnet-core/modules/common/LINGYUN.Abp.Hangfire.MySqlStorage/LINGYUN.Abp.Hangfire.Storage.MySql.csproj
  65. 2
      aspnet-core/modules/common/LINGYUN.Abp.Hangfire.Storage.SqlServer/LINGYUN.Abp.Hangfire.Storage.SqlServer.csproj
  66. 4
      aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN.Abp.IM.SignalR.csproj
  67. 4
      aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN.Abp.IM.csproj
  68. 4
      aspnet-core/modules/common/LINGYUN.Abp.IdentityModel/LINGYUN.Abp.IdentityModel.csproj
  69. 6
      aspnet-core/modules/common/LINGYUN.Abp.Location.Amap/LINGYUN.Abp.Location.Amap.csproj
  70. 6
      aspnet-core/modules/common/LINGYUN.Abp.Location.Baidu/LINGYUN.Abp.Location.Baidu.csproj
  71. 6
      aspnet-core/modules/common/LINGYUN.Abp.Location.Tencent/LINGYUN.Abp.Location.Tencent.csproj
  72. 2
      aspnet-core/modules/common/LINGYUN.Abp.Location/LINGYUN.Abp.Location.csproj
  73. 4
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN.Abp.Notifications.SignalR.csproj
  74. 3
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/Hubs/NotificationsHub.cs
  75. 2
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Sms/LINGYUN.Abp.Notifications.Sms.csproj
  76. 6
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN.Abp.Notifications.csproj
  77. 2
      aspnet-core/modules/common/LINGYUN.Abp.RealTime.SignalR/LINGYUN.Abp.RealTime.SignalR.csproj
  78. 7
      aspnet-core/modules/common/LINGYUN.Abp.RealTime.SignalR/LINGYUN/Abp/RealTime/SignalR/Hubs/OnlineClientHubBase.cs
  79. 2
      aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN.Abp.RealTime.csproj
  80. 2
      aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN.Abp.Rules.csproj
  81. 2
      aspnet-core/modules/common/LINGYUN.Abp.Settings/LINGYUN.Abp.Settings.csproj
  82. 7
      aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN.Abp.Sms.Aliyun.csproj
  83. 13
      aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINYUN/Abp/Sms/Aliyun/AbpAliyunSmsModule.cs
  84. 22
      aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINYUN/Abp/Sms/Aliyun/AliyunSmsException.cs
  85. 38
      aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINYUN/Abp/Sms/Aliyun/AliyunSmsOptions.cs
  86. 87
      aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINYUN/Abp/Sms/Aliyun/AliyunSmsSender.cs
  87. 14
      aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINYUN/Abp/Sms/Aliyun/Localization/Resources/zh-Hans.json
  88. 43
      aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINYUN/Abp/Sms/Aliyun/Settings/AliyunSmsSettingNames.cs
  89. 74
      aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINYUN/Abp/Sms/Aliyun/Settings/AliyunSmsSettingProvider.cs
  90. 38
      aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/README.md
  91. 12
      aspnet-core/modules/console/LINGYUN.Abp.Encryption.Console/AbpEncryptionConsoleModule.cs
  92. 12
      aspnet-core/modules/console/LINGYUN.Abp.Encryption.Console/LINGYUN.Abp.Encryption.Console.csproj
  93. 42
      aspnet-core/modules/console/LINGYUN.Abp.Encryption.Console/Program.cs
  94. 4
      aspnet-core/modules/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN.Abp.FeatureManagement.Client.csproj
  95. 8
      aspnet-core/modules/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/Client/ClientFeatureManagementProvider.cs
  96. 2
      aspnet-core/modules/features/LINGYUN.Abp.Features.Client/LINGYUN.Abp.Features.Client.csproj
  97. 2
      aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.Application.Contracts/LINGYUN.Abp.FileManagement.Application.Contracts.csproj
  98. 2
      aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.Domain.Shared/LINGYUN.Abp.FileManagement.Domain.Shared.csproj
  99. 4
      aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.Domain/LINGYUN.Abp.FileManagement.Domain.csproj
  100. 2
      aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.HttpApi/LINGYUN.Abp.FileManagement.HttpApi.csproj

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

@ -125,8 +125,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.TestsBase", "te
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.BlobStoring.Aliyun.Tests", "tests\LINGYUN.Abp.BlobStoring.Aliyun.Tests\LINGYUN.Abp.BlobStoring.Aliyun.Tests.csproj", "{C8A00439-5B8D-4923-8FAA-AB75E2A786ED}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Aliyun.Authorization", "modules\common\LINGYUN.Abp.Aliyun.Authorization\LINGYUN.Abp.Aliyun.Authorization.csproj", "{F3AE9617-983D-4940-B5EB-35E3580C0B0F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.MessageService.Application.Contracts", "modules\message\LINGYUN.Abp.MessageService.Application.Contracts\LINGYUN.Abp.MessageService.Application.Contracts.csproj", "{31B03DCB-ED12-4412-867A-61E347D40D8C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.MessageService.Application", "modules\message\LINGYUN.Abp.MessageService.Application\LINGYUN.Abp.MessageService.Application.csproj", "{AB984240-EF03-416F-A9B2-F5CF169E04B7}"
@ -465,10 +463,6 @@ Global
{C8A00439-5B8D-4923-8FAA-AB75E2A786ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C8A00439-5B8D-4923-8FAA-AB75E2A786ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C8A00439-5B8D-4923-8FAA-AB75E2A786ED}.Release|Any CPU.Build.0 = Release|Any CPU
{F3AE9617-983D-4940-B5EB-35E3580C0B0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F3AE9617-983D-4940-B5EB-35E3580C0B0F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F3AE9617-983D-4940-B5EB-35E3580C0B0F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F3AE9617-983D-4940-B5EB-35E3580C0B0F}.Release|Any CPU.Build.0 = Release|Any CPU
{31B03DCB-ED12-4412-867A-61E347D40D8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{31B03DCB-ED12-4412-867A-61E347D40D8C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{31B03DCB-ED12-4412-867A-61E347D40D8C}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -773,10 +767,9 @@ Global
{F595CB9F-B117-4D62-A1AE-48599927DB36} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{5CF403B2-47C9-4E4E-8856-0294BDD64884} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{8A22674D-151D-474E-8C99-9D991C0D8297} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{059473BA-FAF9-405F-9985-33DDCA2E9F0D} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{059473BA-FAF9-405F-9985-33DDCA2E9F0D} = {14CDBAD1-10C8-464A-B445-1F727C988010}
{B39B5FB6-E7B9-4A13-8FFA-FC7FEED4371B} = {370D7CD5-1E17-4F3D-BBFA-03429F6D4F2F}
{C8A00439-5B8D-4923-8FAA-AB75E2A786ED} = {370D7CD5-1E17-4F3D-BBFA-03429F6D4F2F}
{F3AE9617-983D-4940-B5EB-35E3580C0B0F} = {14CDBAD1-10C8-464A-B445-1F727C988010}
{31B03DCB-ED12-4412-867A-61E347D40D8C} = {3CDBA2A6-DC8A-48C5-8A6C-AF207394B43D}
{AB984240-EF03-416F-A9B2-F5CF169E04B7} = {3CDBA2A6-DC8A-48C5-8A6C-AF207394B43D}
{EBBBBD00-74B5-49CB-8C24-4FD7C2ECC415} = {3CDBA2A6-DC8A-48C5-8A6C-AF207394B43D}

56
aspnet-core/LINGYUN.MicroService.Common.sln

@ -17,8 +17,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AspNetCore.Sign
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AspNetCore.SignalR.JwtToken", "modules\common\LINGYUN.Abp.AspNetCore.SignalR\LINGYUN.Abp.AspNetCore.SignalR.JwtToken.csproj", "{304D06E6-41EC-4DCB-AEAE-DBEEC75F9ADC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Aliyun.Authorization", "modules\common\LINGYUN.Abp.Aliyun.Authorization\LINGYUN.Abp.Aliyun.Authorization.csproj", "{58777534-1AEF-4D1B-807C-1070D6CB1D48}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.BackgroundJobs", "modules\common\LINGYUN.Abp.BackgroundJobs\LINGYUN.Abp.BackgroundJobs.csproj", "{FFC21AA5-8DCF-4514-95F0-9A1D428095F8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.BackgroundJobs.Hangfire", "modules\common\LINGYUN.Abp.BackgroundJobs.Hangfire\LINGYUN.Abp.BackgroundJobs.Hangfire.csproj", "{492710E6-EEF5-4390-A474-8FB2412ECBE5}"
@ -95,7 +93,23 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.WeChat.SettingM
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Notifications.WeChat.MiniProgram", "modules\wechat\LINGYUN.Abp.Notifications.WeChat.MiniProgram\LINGYUN.Abp.Notifications.WeChat.MiniProgram.csproj", "{D119C919-230B-4614-9A06-98586635DBFC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Core", "modules\common\LINGYUN.Abp.Core\LINGYUN.Abp.Core.csproj", "{A7A28D6C-6EDB-4615-8899-7DE1D435B750}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Core", "modules\common\LINGYUN.Abp.Core\LINGYUN.Abp.Core.csproj", "{A7A28D6C-6EDB-4615-8899-7DE1D435B750}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Aliyun", "modules\cloud-aliyun\LINGYUN.Abp.Aliyun\LINGYUN.Abp.Aliyun.csproj", "{17A8455F-D413-4664-AEFA-1ECAE9ED4B19}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{B86C21A4-73B7-471E-B73A-B4B905EC9435}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.TestsBase", "tests\LINGYUN.Abp.TestBase\LINGYUN.Abp.TestsBase.csproj", "{3BAA3D38-96C2-4C4C-B790-AE2997BFDE25}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.BlobStoring.Aliyun.Tests", "tests\LINGYUN.Abp.BlobStoring.Aliyun.Tests\LINGYUN.Abp.BlobStoring.Aliyun.Tests.csproj", "{2E35CB93-2E9C-4EE1-845F-72A40271648E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "console", "console", "{8D2AD50B-DD4B-48A2-88EC-0E8E8236D883}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Encryption.Console", "modules\console\LINGYUN.Abp.Encryption.Console\LINGYUN.Abp.Encryption.Console.csproj", "{8FB74B18-CA5C-4DC3-8DFA-600133A05712}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Aliyun.Tests", "tests\LINGYUN.Abp.Aliyun.Tests\LINGYUN.Abp.Aliyun.Tests.csproj", "{3DBF0975-B09D-49CA-9AF8-69175EDB9D52}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Sms.Aliyun.Tests", "tests\LINGYUN.Abp.Sms.Aliyun.Tests\LINGYUN.Abp.Sms.Aliyun.Tests.csproj", "{93DD5A05-B67A-4E11-BB56-F6B4E7F1489C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -123,10 +137,6 @@ Global
{304D06E6-41EC-4DCB-AEAE-DBEEC75F9ADC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{304D06E6-41EC-4DCB-AEAE-DBEEC75F9ADC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{304D06E6-41EC-4DCB-AEAE-DBEEC75F9ADC}.Release|Any CPU.Build.0 = Release|Any CPU
{58777534-1AEF-4D1B-807C-1070D6CB1D48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{58777534-1AEF-4D1B-807C-1070D6CB1D48}.Debug|Any CPU.Build.0 = Debug|Any CPU
{58777534-1AEF-4D1B-807C-1070D6CB1D48}.Release|Any CPU.ActiveCfg = Release|Any CPU
{58777534-1AEF-4D1B-807C-1070D6CB1D48}.Release|Any CPU.Build.0 = Release|Any CPU
{FFC21AA5-8DCF-4514-95F0-9A1D428095F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FFC21AA5-8DCF-4514-95F0-9A1D428095F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FFC21AA5-8DCF-4514-95F0-9A1D428095F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -255,6 +265,30 @@ Global
{A7A28D6C-6EDB-4615-8899-7DE1D435B750}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A7A28D6C-6EDB-4615-8899-7DE1D435B750}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A7A28D6C-6EDB-4615-8899-7DE1D435B750}.Release|Any CPU.Build.0 = Release|Any CPU
{17A8455F-D413-4664-AEFA-1ECAE9ED4B19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{17A8455F-D413-4664-AEFA-1ECAE9ED4B19}.Debug|Any CPU.Build.0 = Debug|Any CPU
{17A8455F-D413-4664-AEFA-1ECAE9ED4B19}.Release|Any CPU.ActiveCfg = Release|Any CPU
{17A8455F-D413-4664-AEFA-1ECAE9ED4B19}.Release|Any CPU.Build.0 = Release|Any CPU
{3BAA3D38-96C2-4C4C-B790-AE2997BFDE25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3BAA3D38-96C2-4C4C-B790-AE2997BFDE25}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3BAA3D38-96C2-4C4C-B790-AE2997BFDE25}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3BAA3D38-96C2-4C4C-B790-AE2997BFDE25}.Release|Any CPU.Build.0 = Release|Any CPU
{2E35CB93-2E9C-4EE1-845F-72A40271648E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2E35CB93-2E9C-4EE1-845F-72A40271648E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2E35CB93-2E9C-4EE1-845F-72A40271648E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2E35CB93-2E9C-4EE1-845F-72A40271648E}.Release|Any CPU.Build.0 = Release|Any CPU
{8FB74B18-CA5C-4DC3-8DFA-600133A05712}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8FB74B18-CA5C-4DC3-8DFA-600133A05712}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8FB74B18-CA5C-4DC3-8DFA-600133A05712}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8FB74B18-CA5C-4DC3-8DFA-600133A05712}.Release|Any CPU.Build.0 = Release|Any CPU
{3DBF0975-B09D-49CA-9AF8-69175EDB9D52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3DBF0975-B09D-49CA-9AF8-69175EDB9D52}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3DBF0975-B09D-49CA-9AF8-69175EDB9D52}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3DBF0975-B09D-49CA-9AF8-69175EDB9D52}.Release|Any CPU.Build.0 = Release|Any CPU
{93DD5A05-B67A-4E11-BB56-F6B4E7F1489C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{93DD5A05-B67A-4E11-BB56-F6B4E7F1489C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{93DD5A05-B67A-4E11-BB56-F6B4E7F1489C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{93DD5A05-B67A-4E11-BB56-F6B4E7F1489C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -266,7 +300,6 @@ Global
{824CB367-383B-48B2-972D-33923438A9A0} = {B91F26C5-B148-4094-B5F1-71E5F945DBED}
{E9AEC9D6-1FE7-4B00-BAC5-2C3D4B63CCA2} = {E2E7A062-0ABB-41B4-8220-60228446D2C2}
{304D06E6-41EC-4DCB-AEAE-DBEEC75F9ADC} = {E2E7A062-0ABB-41B4-8220-60228446D2C2}
{58777534-1AEF-4D1B-807C-1070D6CB1D48} = {7F18BCA5-35BD-41FB-8EFF-801B56E5E414}
{FFC21AA5-8DCF-4514-95F0-9A1D428095F8} = {086BE5BE-8594-4DA7-8819-935FEF76DABD}
{492710E6-EEF5-4390-A474-8FB2412ECBE5} = {086BE5BE-8594-4DA7-8819-935FEF76DABD}
{CCF1EB86-29BD-4531-BB27-C9111CC67570} = {7F18BCA5-35BD-41FB-8EFF-801B56E5E414}
@ -306,6 +339,13 @@ Global
{D0717513-2CEE-4AD5-A1DA-A08EA5DE6DD6} = {22C61434-D29A-4376-AD56-F5089F3E617A}
{D119C919-230B-4614-9A06-98586635DBFC} = {22C61434-D29A-4376-AD56-F5089F3E617A}
{A7A28D6C-6EDB-4615-8899-7DE1D435B750} = {086BE5BE-8594-4DA7-8819-935FEF76DABD}
{17A8455F-D413-4664-AEFA-1ECAE9ED4B19} = {7F18BCA5-35BD-41FB-8EFF-801B56E5E414}
{3BAA3D38-96C2-4C4C-B790-AE2997BFDE25} = {B86C21A4-73B7-471E-B73A-B4B905EC9435}
{2E35CB93-2E9C-4EE1-845F-72A40271648E} = {B86C21A4-73B7-471E-B73A-B4B905EC9435}
{8D2AD50B-DD4B-48A2-88EC-0E8E8236D883} = {02EA4E78-5891-43BC-944F-3E52FEE032E4}
{8FB74B18-CA5C-4DC3-8DFA-600133A05712} = {8D2AD50B-DD4B-48A2-88EC-0E8E8236D883}
{3DBF0975-B09D-49CA-9AF8-69175EDB9D52} = {B86C21A4-73B7-471E-B73A-B4B905EC9435}
{93DD5A05-B67A-4E11-BB56-F6B4E7F1489C} = {B86C21A4-73B7-471E-B73A-B4B905EC9435}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {06C707C6-02C0-411A-AD3B-2D0E13787CB8}

30
aspnet-core/LINGYUN.MicroService.Platform.sln

@ -39,6 +39,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tenants", "tenants", "{8CDB
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.MultiTenancy", "modules\tenants\LINGYUN.Abp.MultiTenancy\LINGYUN.Abp.MultiTenancy.csproj", "{CF0EBF60-EDC7-47FF-BCD7-C2B16407B590}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{CCEFF583-4EEE-433F-8568-9E64166B41FE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.TestsBase", "tests\LINGYUN.Abp.TestBase\LINGYUN.Abp.TestsBase.csproj", "{FC3E5BA0-C650-4EA2-8400-0A864D0EFEAC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.EntityFrameworkCore.Tests", "tests\LINGYUN.Abp.EntityFrameworkCore.Tests\LINGYUN.Abp.EntityFrameworkCore.Tests.csproj", "{B2C0271C-3FE6-4C45-B162-4DE00E542A55}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Platform.EntityFrameworkCore.Tests", "tests\LINGYUN.Platform.EntityFrameworkCore.Tests\LINGYUN.Platform.EntityFrameworkCore.Tests.csproj", "{263C49A9-34B9-449B-ABBC-D328210C023D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Platform.Domain.Tests", "tests\LINGYUN.Platform.Domain.Tests\LINGYUN.Platform.Domain.Tests.csproj", "{C60A06F2-0F4C-483F-BE2B-B103F0D726CE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -97,6 +107,22 @@ Global
{CF0EBF60-EDC7-47FF-BCD7-C2B16407B590}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CF0EBF60-EDC7-47FF-BCD7-C2B16407B590}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CF0EBF60-EDC7-47FF-BCD7-C2B16407B590}.Release|Any CPU.Build.0 = Release|Any CPU
{FC3E5BA0-C650-4EA2-8400-0A864D0EFEAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FC3E5BA0-C650-4EA2-8400-0A864D0EFEAC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC3E5BA0-C650-4EA2-8400-0A864D0EFEAC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FC3E5BA0-C650-4EA2-8400-0A864D0EFEAC}.Release|Any CPU.Build.0 = Release|Any CPU
{B2C0271C-3FE6-4C45-B162-4DE00E542A55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B2C0271C-3FE6-4C45-B162-4DE00E542A55}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2C0271C-3FE6-4C45-B162-4DE00E542A55}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2C0271C-3FE6-4C45-B162-4DE00E542A55}.Release|Any CPU.Build.0 = Release|Any CPU
{263C49A9-34B9-449B-ABBC-D328210C023D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{263C49A9-34B9-449B-ABBC-D328210C023D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{263C49A9-34B9-449B-ABBC-D328210C023D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{263C49A9-34B9-449B-ABBC-D328210C023D}.Release|Any CPU.Build.0 = Release|Any CPU
{C60A06F2-0F4C-483F-BE2B-B103F0D726CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C60A06F2-0F4C-483F-BE2B-B103F0D726CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C60A06F2-0F4C-483F-BE2B-B103F0D726CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C60A06F2-0F4C-483F-BE2B-B103F0D726CE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -118,6 +144,10 @@ Global
{C616C167-E5DF-4141-98BE-F98C58890122} = {C7D0EB39-3418-4A7C-AD94-FAB76F023E88}
{8CDB2F58-9541-4FB2-8A37-079C5E6A1689} = {15BDA03E-DE8E-46E4-96A8-CA3F2872E812}
{CF0EBF60-EDC7-47FF-BCD7-C2B16407B590} = {8CDB2F58-9541-4FB2-8A37-079C5E6A1689}
{FC3E5BA0-C650-4EA2-8400-0A864D0EFEAC} = {CCEFF583-4EEE-433F-8568-9E64166B41FE}
{B2C0271C-3FE6-4C45-B162-4DE00E542A55} = {CCEFF583-4EEE-433F-8568-9E64166B41FE}
{263C49A9-34B9-449B-ABBC-D328210C023D} = {CCEFF583-4EEE-433F-8568-9E64166B41FE}
{C60A06F2-0F4C-483F-BE2B-B103F0D726CE} = {CCEFF583-4EEE-433F-8568-9E64166B41FE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {03D3B66F-8926-4C00-B7AB-A21761EC859E}

2
aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN.Abp.Account.Application.Contracts.csproj

@ -18,7 +18,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Account.Application.Contracts" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Account.Application.Contracts" Version="4.2.1" />
</ItemGroup>
</Project>

4
aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN.Abp.Account.Application.csproj

@ -8,8 +8,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Account.Application" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Sms" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Account.Application" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Sms" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

2
aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN.Abp.Account.Domain.Shared.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Localization" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Localization" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

2
aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN.Abp.Account.Domain.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Identity.Domain" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Identity.Domain" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

2
aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN.Abp.Account.HttpApi.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Account.HttpApi" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Account.HttpApi" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

6
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/LINGYUN.Abp.Account.Web.csproj

@ -29,9 +29,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Account.Web" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Sms" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Emailing" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Account.Web" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Sms" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Emailing" Version="4.2.1" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="3.1.8" />
</ItemGroup>

4
aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application.Contracts/LINGYUN.ApiGateway.Application.Contracts.csproj

@ -18,8 +18,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Authorization" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Authorization" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

4
aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN.ApiGateway.Application.csproj

@ -8,8 +8,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="4.1.2" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

3
aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/AggregateReRouteAppService.cs

@ -15,8 +15,7 @@ namespace LINGYUN.ApiGateway.Ocelot
[Authorize(ApiGatewayPermissions.AggregateRoute.Default)]
public class AggregateReRouteAppService : ApiGatewayApplicationServiceBase, IAggregateReRouteAppService
{
private IDistributedEventBus _eventBus;
protected IDistributedEventBus DistributedEventBus => LazyGetRequiredService(ref _eventBus);
protected IDistributedEventBus DistributedEventBus => LazyServiceProvider.LazyGetRequiredService<IDistributedEventBus>();
private readonly IAggregateReRouteRepository _aggregateReRouteRepository;

3
aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/GlobalConfigurationAppService.cs

@ -11,8 +11,7 @@ namespace LINGYUN.ApiGateway.Ocelot
[Authorize(ApiGatewayPermissions.Global.Default)]
public class GlobalConfigurationAppService : ApiGatewayApplicationServiceBase, IGlobalConfigurationAppService
{
private IDistributedEventBus _eventBus;
protected IDistributedEventBus DistributedEventBus => LazyGetRequiredService(ref _eventBus);
protected IDistributedEventBus DistributedEventBus => LazyServiceProvider.LazyGetRequiredService<IDistributedEventBus>();
private readonly IRouteGroupChecker _routeGroupChecker;
private readonly IGlobalConfigRepository _globalConfigRepository;

3
aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/ReRouteAppService.cs

@ -10,8 +10,7 @@ namespace LINGYUN.ApiGateway.Ocelot
[Authorize(ApiGatewayPermissions.Route.Default)]
public class ReRouteAppService : ApiGatewayApplicationServiceBase, IReRouteAppService
{
private IDistributedEventBus _eventBus;
protected IDistributedEventBus DistributedEventBus => LazyGetRequiredService(ref _eventBus);
protected IDistributedEventBus DistributedEventBus => LazyServiceProvider.LazyGetRequiredService<IDistributedEventBus>();
private readonly IRouteGroupChecker _routeGroupChecker;
private readonly IReRouteRepository _reRouteRepository;

3
aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/RouteGroupAppService.cs

@ -10,8 +10,7 @@ namespace LINGYUN.ApiGateway.Ocelot
[Authorize(ApiGatewayPermissions.RouteGroup.Default)]
public class RouteGroupAppService : ApiGatewayApplicationServiceBase, IRouteGroupAppService
{
private IDataFilter _dataFilter;
protected IDataFilter DataFilter => LazyGetRequiredService(ref _dataFilter);
protected IDataFilter DataFilter => LazyServiceProvider.LazyGetRequiredService<IDataFilter>();
protected IRouteGroupRepository RouterRepository { get; }
public RouteGroupAppService(

2
aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain.Shared/LINGYUN.ApiGateway.Domain.Shared.csproj

@ -18,7 +18,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Localization" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Localization" Version="4.2.1" />
</ItemGroup>
</Project>

4
aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain/LINGYUN.ApiGateway.Domain.csproj

@ -8,8 +8,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Caching" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Caching" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

2
aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN.ApiGateway.EntityFrameworkCore.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="4.1.2" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

12
aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreAggregateReRouteRepository.cs

@ -17,23 +17,25 @@ namespace LINGYUN.ApiGateway.Ocelot
public async Task<bool> AggregateReRouteNameExistsAsync(string name)
{
return await DbSet.AnyAsync(ar => ar.Name.Equals(name));
return await (await GetDbSetAsync()).AnyAsync(ar => ar.Name.Equals(name));
}
public async Task<AggregateReRoute> GetByRouteIdAsync(long routeId)
{
return await WithDetails().Where(ar => ar.ReRouteId.Equals(routeId)).FirstOrDefaultAsync();
return await (await WithDetailsAsync())
.Where(ar => ar.ReRouteId.Equals(routeId)).FirstOrDefaultAsync();
}
public async Task<List<AggregateReRoute>> GetByAppIdAsync(string appId)
{
return await WithDetails().Where(ar => ar.AppId.Equals(appId)).ToListAsync();
return await (await WithDetailsAsync())
.Where(ar => ar.AppId.Equals(appId)).ToListAsync();
}
public async Task<(List<AggregateReRoute> routes, long total)> GetPagedListAsync(string appId, string filter = "",
string sorting = "", int skipCount = 1, int maxResultCount = 100)
{
var resultReRoutes = await WithDetails()
var resultReRoutes = await (await WithDetailsAsync())
.Where(ar => ar.AppId.Equals(appId))
.WhereIf(!filter.IsNullOrWhiteSpace(), ar => ar.ReRouteKeys.Contains(filter) ||
ar.UpstreamHost.Contains(filter) || ar.UpstreamPathTemplate.Contains(filter))
@ -41,7 +43,7 @@ namespace LINGYUN.ApiGateway.Ocelot
.EfPageBy(skipCount, maxResultCount)
.ToListAsync();
var total = await GetQueryable()
var total = await (await GetQueryableAsync())
.Where(ar => ar.AppId.Equals(appId))
.WhereIf(!filter.IsNullOrWhiteSpace(), ar => ar.ReRouteKeys.Contains(filter) ||
ar.UpstreamHost.Contains(filter) || ar.UpstreamPathTemplate.Contains(filter)).LongCountAsync();

9
aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreDynamicReRouteRepository.cs

@ -17,12 +17,17 @@ namespace LINGYUN.ApiGateway.Ocelot
public async Task<DynamicReRoute> GetByItemIdAsync(int itemId)
{
return await GetQueryable().Where(x => x.DynamicReRouteId.Equals(itemId)).FirstOrDefaultAsync();
return await (await GetQueryableAsync()).Where(x => x.DynamicReRouteId.Equals(itemId)).FirstOrDefaultAsync();
}
public async Task<List<DynamicReRoute>> GetByAppIdAsync(string appId)
{
return await WithDetails().Where(x => x.AppId.Equals(appId)).ToListAsync();
return await (await WithDetailsAsync()).Where(x => x.AppId.Equals(appId)).ToListAsync();
}
public override async Task<IQueryable<DynamicReRoute>> WithDetailsAsync()
{
return await WithDetailsAsync(x => x.RateLimitRule); ;
}
public override IQueryable<DynamicReRoute> WithDetails()

18
aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreGlobalConfigRepository.cs

@ -19,7 +19,7 @@ namespace LINGYUN.ApiGateway.Ocelot
public async Task<GlobalConfiguration> GetByItemIdAsync(long itemId)
{
var globalConfiguration = await WithDetails().Where(x => x.ItemId.Equals(itemId)).FirstOrDefaultAsync();
var globalConfiguration = await (await WithDetailsAsync()).Where(x => x.ItemId.Equals(itemId)).FirstOrDefaultAsync();
if(globalConfiguration == null)
{
throw new EntityNotFoundException(typeof(GlobalConfiguration));
@ -29,7 +29,7 @@ namespace LINGYUN.ApiGateway.Ocelot
public async Task<GlobalConfiguration> GetByAppIdAsync(string appId)
{
return await WithDetails()
return await (await WithDetailsAsync())
.Where(g => g.AppId.Equals(appId))
.FirstOrDefaultAsync();
}
@ -37,13 +37,13 @@ namespace LINGYUN.ApiGateway.Ocelot
public virtual async Task<(List<GlobalConfiguration> Globals, long TotalCount)> GetPagedListAsync(string filter = "", string sorting = "",
int skipCount = 1, int maxResultCount = 10)
{
var globals = await WithDetails()
var globals = await (await WithDetailsAsync())
.WhereIf(!filter.IsNullOrWhiteSpace(), g => g.AppId.Contains(filter) ||
g.BaseUrl.Contains(filter) || g.DownstreamScheme.Contains(filter))
.OrderBy(g => sorting ?? g.BaseUrl)
.EfPageBy(skipCount, maxResultCount)
.ToListAsync();
var total = await GetQueryable()
var total = await (await GetQueryableAsync())
.WhereIf(!filter.IsNullOrWhiteSpace(), g => g.AppId.Contains(filter) ||
g.BaseUrl.Contains(filter) || g.DownstreamScheme.Contains(filter))
.LongCountAsync();
@ -51,6 +51,16 @@ namespace LINGYUN.ApiGateway.Ocelot
return ValueTuple.Create(globals, total);
}
public override async Task<IQueryable<GlobalConfiguration>> WithDetailsAsync()
{
return await WithDetailsAsync(
x => x.HttpHandlerOptions,
x => x.LoadBalancerOptions,
x => x.QoSOptions,
x => x.RateLimitOptions,
x => x.ServiceDiscoveryProvider);
}
public override IQueryable<GlobalConfiguration> WithDetails()
{
return WithDetails(

27
aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreReRouteRepository.cs

@ -19,19 +19,19 @@ namespace LINGYUN.ApiGateway.Ocelot
public async Task<ReRoute> GetByNameAsync(string routeName)
{
var reRoute = await WithDetails().Where(x => x.ReRouteName.Equals(routeName)).FirstOrDefaultAsync();
var reRoute = await (await WithDetailsAsync()).Where(x => x.ReRouteName.Equals(routeName)).FirstOrDefaultAsync();
return reRoute ?? throw new EntityNotFoundException(typeof(ReRoute), routeName);
}
public async Task<ReRoute> GetByReRouteIdAsync(long routeId)
{
var reRoute = await WithDetails().Where(x => x.ReRouteId.Equals(routeId)).FirstOrDefaultAsync();
var reRoute = await (await WithDetailsAsync()).Where(x => x.ReRouteId.Equals(routeId)).FirstOrDefaultAsync();
return reRoute ?? throw new EntityNotFoundException(typeof(ReRoute), routeId);
}
public async Task<List<ReRoute>> GetByAppIdAsync(string appId)
{
return await WithDetails()
return await (await WithDetailsAsync())
.Where(r => r.AppId.Equals(appId))
.ToListAsync();
}
@ -39,7 +39,7 @@ namespace LINGYUN.ApiGateway.Ocelot
public async Task<(List<ReRoute> routes, long total)> GetPagedListAsync(string appId, string filter = "",
string sorting = "", int skipCount = 1, int maxResultCount = 100)
{
var resultReRoutes = await WithDetails()
var resultReRoutes = await (await WithDetailsAsync())
.Where(r => r.AppId.Equals(appId))
.WhereIf(!filter.IsNullOrWhiteSpace(), r => r.ReRouteName.Contains(filter) ||
r.DownstreamHostAndPorts.Contains(filter) || r.ServiceName.Contains(filter))
@ -47,7 +47,7 @@ namespace LINGYUN.ApiGateway.Ocelot
.EfPageBy(skipCount, maxResultCount)
.ToListAsync();
var total = await GetQueryable()
var total = await (await GetQueryableAsync())
.Where(r => r.AppId.Equals(appId))
.WhereIf(!filter.IsNullOrWhiteSpace(), r => r.ReRouteName.Contains(filter) ||
r.DownstreamHostAndPorts.Contains(filter) || r.ServiceName.Contains(filter))
@ -58,17 +58,30 @@ namespace LINGYUN.ApiGateway.Ocelot
public async Task RemoveAsync(CancellationToken cancellationToken = default(CancellationToken))
{
var entityType = DbContext.Model.FindEntityType(typeof(ReRoute));
var dbContext = await GetDbContextAsync();
var entityType = dbContext.Model.FindEntityType(typeof(ReRoute));
var tableName = entityType.GetTableName();//.Relational().TableName;
var sqlText = $"DELETE FROM @tableName";
var sqlParam = new List<object> { new { tableName } };
// TODO: Test
await DbContext.Database.ExecuteSqlRawAsync(sqlText, sqlParam, cancellationToken);
await dbContext.Database.ExecuteSqlRawAsync(sqlText, sqlParam, cancellationToken);
//await DbContext.Database.ExecuteSqlCommandAsync(sqlText, sqlParam, cancellationToken);
}
public override async Task<IQueryable<ReRoute>> WithDetailsAsync()
{
return await WithDetailsAsync(
x => x.AuthenticationOptions,
x => x.CacheOptions,
x => x.HttpHandlerOptions,
x => x.LoadBalancerOptions,
x => x.QoSOptions,
x => x.RateLimitOptions,
x => x.SecurityOptions);
}
public override IQueryable<ReRoute> WithDetails()
{
return WithDetails(

9
aspnet-core/modules/apigateway/LINGYUN.ApiGateway.EntityFrameworkCore/LINGYUN/ApiGateway/Ocelot/EfCoreRouteGroupRepository.cs

@ -18,24 +18,25 @@ namespace LINGYUN.ApiGateway.Ocelot
public virtual async Task<IEnumerable<RouteGroupAppKey>> GetActivedAppsAsync()
{
return await DbSet.Select(g => new RouteGroupAppKey(g.AppId, g.AppName)).ToArrayAsync();
return await (await GetDbSetAsync()).Select(g => new RouteGroupAppKey(g.AppId, g.AppName)).ToArrayAsync();
}
public virtual async Task<RouteGroup> GetByAppIdAsync(string appId)
{
var routeGroup = await DbSet.Where(g => g.AppId.Equals(appId)).FirstOrDefaultAsync();
var routeGroup = await (await GetDbSetAsync()).Where(g => g.AppId.Equals(appId)).FirstOrDefaultAsync();
return routeGroup ?? throw new EntityNotFoundException(typeof(RouteGroup), appId);
}
public virtual async Task<(List<RouteGroup> Routers, long TotalCount)> GetPagedListAsync(string filter = "", string sorting = "", int skipCount = 1, int maxResultCount = 10)
{
var groups = await DbSet
var dbSet = await GetDbSetAsync();
var groups = await dbSet
.WhereIf(!filter.IsNullOrWhiteSpace(), g => g.AppId.Contains(filter) ||
g.AppName.Contains(filter) || g.AppIpAddress.Contains(filter) || g.Description.Contains(filter))
.OrderBy(g => sorting ?? nameof(RouteGroup.AppId))
.EfPageBy(skipCount, maxResultCount)
.ToListAsync();
var toatl = await DbSet
var toatl = await dbSet
.WhereIf(!filter.IsNullOrWhiteSpace(), g => g.AppId.Contains(filter) ||
g.AppName.Contains(filter) || g.AppIpAddress.Contains(filter) || g.Description.Contains(filter))
.LongCountAsync();

2
aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi.Client/LINGYUN.ApiGateway.HttpApi.Client.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Http.Client" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

2
aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi/LINGYUN.ApiGateway.HttpApi.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="4.1.2" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

6
aspnet-core/modules/apigateway/LINGYUN.ApiGateway.HttpApi/LINGYUN/ApiGateway/Ocelot/GlobalConfigurationController.cs

@ -1,10 +1,8 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Clients;
namespace LINGYUN.ApiGateway.Ocelot
{
@ -27,8 +25,6 @@ namespace LINGYUN.ApiGateway.Ocelot
[Route("By-AppId/{AppId}")]
public async Task<GlobalConfigurationDto> GetAsync(GlobalGetByAppIdInputDto input)
{
ICurrentClient client = null;
var currentClient = LazyGetRequiredService(ref client);
return await GlobalConfigurationAppService.GetAsync(input);
}

10
aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN.Abp.Auditing.Application.Contracts.csproj

@ -13,11 +13,11 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Features" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Authorization" Version="4.1.2" />
<PackageReference Include="Volo.Abp.AuditLogging.Domain.Shared" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Identity.Domain.Shared" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Features" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Authorization" Version="4.2.1" />
<PackageReference Include="Volo.Abp.AuditLogging.Domain.Shared" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Identity.Domain.Shared" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="4.2.1" />
</ItemGroup>
</Project>

8
aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN.Abp.Auditing.Application.csproj

@ -8,10 +8,10 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="4.1.2" />
<PackageReference Include="Volo.Abp.AuditLogging.Domain" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Identity.Domain" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="4.1.2" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="4.2.1" />
<PackageReference Include="Volo.Abp.AuditLogging.Domain" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Identity.Domain" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

2
aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN.Abp.Auditing.HttpApi.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="4.1.2" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

9
aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN.Abp.Aliyun.csproj

@ -20,10 +20,11 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="aliyun-net-sdk-core" Version="1.5.8" />
<PackageReference Include="Volo.Abp.Localization" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Json" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Settings" Version="4.1.2" />
<PackageReference Include="aliyun-net-sdk-core" Version="1.5.10" />
<PackageReference Include="Volo.Abp.Caching" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Localization" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Json" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Settings" Version="4.2.1" />
</ItemGroup>
</Project>

21
aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINYUN/Abp/Aliyun/AbpAliyunException.cs

@ -0,0 +1,21 @@
using Microsoft.Extensions.Logging;
using Volo.Abp;
using Volo.Abp.ExceptionHandling;
using Volo.Abp.Logging;
namespace LINYUN.Abp.Aliyun
{
public class AbpAliyunException : AbpException, IHasErrorCode, IHasLogLevel
{
public LogLevel LogLevel { get; set; }
public string Code { get; }
public AbpAliyunException(string code, string message)
: base(message)
{
Code = code;
LogLevel = LogLevel.Warning;
}
}
}

8
aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINYUN/Abp/Aliyun/AbpAliyunCloudModule.cs → aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINYUN/Abp/Aliyun/AbpAliyunModule.cs

@ -1,21 +1,25 @@
using LINYUN.Abp.Aliyun.Localization;
using Volo.Abp.Caching;
using Volo.Abp.Json;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.Settings;
using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.Aliyun
{
[DependsOn(
typeof(AbpCachingModule),
typeof(AbpSettingsModule),
typeof(AbpJsonModule),
typeof(AbpLocalizationModule))]
public class AbpAliyunCloudModule : AbpModule
public class AbpAliyunModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpAliyunCloudModule>();
options.FileSets.AddEmbedded<AbpAliyunModule>();
});
Configure<AbpLocalizationOptions>(options =>

32
aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINYUN/Abp/Aliyun/AcsClientFactory.cs

@ -0,0 +1,32 @@
using Aliyun.Acs.Core;
using Aliyun.Acs.Core.Auth;
using Aliyun.Acs.Core.Profile;
using Volo.Abp.Caching;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Settings;
namespace LINYUN.Abp.Aliyun
{
public class AcsClientFactory : AliyunClientFactory<IAcsClient>, IAcsClientFactory, ITransientDependency
{
public AcsClientFactory(
ISettingProvider settingProvider,
IDistributedCache<AliyunBasicSessionCredentialsCacheItem> cache)
: base(settingProvider, cache)
{
}
protected override IAcsClient GetClient(string regionId, string accessKeyId, string accessKeySecret)
{
return new DefaultAcsClient(
DefaultProfile.GetProfile(regionId, accessKeyId, accessKeySecret));
}
protected override IAcsClient GetSecurityTokenClient(string regionId, string accessKeyId, string accessKeySecret, string securityToken)
{
var profile = DefaultProfile.GetProfile(regionId);
var credentials = new BasicSessionCredentials(accessKeyId, accessKeySecret, securityToken);
return new DefaultAcsClient(profile, credentials);
}
}
}

31
aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINYUN/Abp/Aliyun/AliyunBasicSessionCredentialsCacheItem.cs

@ -0,0 +1,31 @@
using System;
namespace LINYUN.Abp.Aliyun
{
[Serializable]
public class AliyunBasicSessionCredentialsCacheItem
{
private readonly static string _cacheKey;
public static string CacheKey => _cacheKey;
public string AccessKeyId { get; set; }
public string AccessKeySecret { get; set; }
public string SecurityToken { get; set; }
static AliyunBasicSessionCredentialsCacheItem()
{
_cacheKey = Guid.NewGuid().ToString("N");
}
public AliyunBasicSessionCredentialsCacheItem()
{
}
public AliyunBasicSessionCredentialsCacheItem(string accessKeyId, string accessKeySecret, string securityToken)
{
AccessKeyId = accessKeyId;
AccessKeySecret = accessKeySecret;
SecurityToken = securityToken;
}
}
}

180
aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINYUN/Abp/Aliyun/AliyunClientFactory.cs

@ -0,0 +1,180 @@
using Aliyun.Acs.Core;
using Aliyun.Acs.Core.Auth.Sts;
using Aliyun.Acs.Core.Http;
using Aliyun.Acs.Core.Profile;
using LINYUN.Abp.Aliyun.Settings;
using Microsoft.Extensions.Caching.Distributed;
using System;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Caching;
using Volo.Abp.Settings;
namespace LINYUN.Abp.Aliyun
{
/// <summary>
/// 阿里云通用客户端构建工厂
/// </summary>
/// <typeparam name="TClient"></typeparam>
public abstract class AliyunClientFactory<TClient>
{
protected ISettingProvider SettingProvider { get; }
protected IDistributedCache<AliyunBasicSessionCredentialsCacheItem> Cache { get; }
public AliyunClientFactory(
ISettingProvider settingProvider,
IDistributedCache<AliyunBasicSessionCredentialsCacheItem> cache)
{
Cache = cache;
SettingProvider = settingProvider;
}
public virtual async Task<TClient> CreateAsync()
{
var regionId = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.RegionId);
var accessKey = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.AccessKeyId);
var accessKeySecret = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.AccessKeySecret);
Check.NotNullOrWhiteSpace(regionId, AliyunSettingNames.Authorization.RegionId);
Check.NotNullOrWhiteSpace(accessKey, AliyunSettingNames.Authorization.AccessKeyId);
Check.NotNullOrWhiteSpace(accessKeySecret, AliyunSettingNames.Authorization.AccessKeySecret);
if (await SettingProvider.IsTrueAsync(AliyunSettingNames.Authorization.UseSecurityTokenService))
{
var cacheItem = await GetCacheItemAsync(accessKey, accessKeySecret, regionId);
return GetSecurityTokenClient(regionId, cacheItem.AccessKeyId, cacheItem.AccessKeySecret, cacheItem.SecurityToken);
}
return GetClient(regionId, accessKey, accessKeySecret);
}
protected abstract TClient GetClient(string regionId, string accessKeyId, string accessKeySecret);
protected abstract TClient GetSecurityTokenClient(string regionId, string accessKeyId, string accessKeySecret, string securityToken);
protected virtual async Task<AliyunBasicSessionCredentialsCacheItem> GetCacheItemAsync(string accessKeyId, string accessKeySecret, string regionId)
{
var cacheItem = await Cache.GetAsync(AliyunBasicSessionCredentialsCacheItem.CacheKey);
if (cacheItem == null)
{
var roleArn = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.RamRoleArn);
var roleSession = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.RoleSessionName);
Check.NotNullOrWhiteSpace(roleArn, AliyunSettingNames.Authorization.RamRoleArn);
var policy = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.Policy);
var durationSeconds = await SettingProvider.GetAsync(AliyunSettingNames.Authorization.DurationSeconds, 3000);
var profile = DefaultProfile.GetProfile(regionId, accessKeyId, accessKeySecret);
var request = new AssumeRoleRequest
{
AcceptFormat = FormatType.JSON,
RoleArn = roleArn,
RoleSessionName = roleSession,
DurationSeconds = durationSeconds,
Policy = policy.IsNullOrWhiteSpace() ? null : policy
};
var client = new DefaultAcsClient(profile);
var response = client.GetAcsResponse(request);
cacheItem = new AliyunBasicSessionCredentialsCacheItem(
response.Credentials.AccessKeyId,
response.Credentials.AccessKeySecret,
response.Credentials.SecurityToken);
await Cache.SetAsync(
AliyunBasicSessionCredentialsCacheItem.CacheKey,
cacheItem,
new DistributedCacheEntryOptions
{
AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(durationSeconds - 10)
});
}
return cacheItem;
}
}
/// <summary>
/// 阿里云通用客户端构建工厂
/// </summary>
/// <typeparam name="TClient">客户端类型</typeparam>
/// <typeparam name="TConfiguration">客户端参数类型</typeparam>
public abstract class AliyunClientFactory<TClient, TConfiguration>
{
protected ISettingProvider SettingProvider { get; }
protected IDistributedCache<AliyunBasicSessionCredentialsCacheItem> Cache { get; }
public AliyunClientFactory(
ISettingProvider settingProvider,
IDistributedCache<AliyunBasicSessionCredentialsCacheItem> cache)
{
Cache = cache;
SettingProvider = settingProvider;
}
public virtual async Task<TClient> CreateAsync(TConfiguration configuration)
{
var regionId = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.RegionId);
var accessKey = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.AccessKeyId);
var accessKeySecret = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.AccessKeySecret);
Check.NotNullOrWhiteSpace(regionId, AliyunSettingNames.Authorization.RegionId);
Check.NotNullOrWhiteSpace(accessKey, AliyunSettingNames.Authorization.AccessKeyId);
Check.NotNullOrWhiteSpace(accessKeySecret, AliyunSettingNames.Authorization.AccessKeySecret);
if (await SettingProvider.IsTrueAsync(AliyunSettingNames.Authorization.UseSecurityTokenService))
{
var cacheItem = await GetCacheItemAsync(accessKey, accessKeySecret, regionId);
return GetSecurityTokenClient(configuration, regionId, cacheItem.AccessKeyId, cacheItem.AccessKeySecret, cacheItem.SecurityToken);
}
return GetClient(configuration, regionId, accessKey, accessKeySecret);
}
protected abstract TClient GetClient(TConfiguration configuration, string regionId, string accessKeyId, string accessKeySecret);
protected abstract TClient GetSecurityTokenClient(TConfiguration configuration, string regionId, string accessKeyId, string accessKeySecret, string securityToken);
protected virtual async Task<AliyunBasicSessionCredentialsCacheItem> GetCacheItemAsync(string accessKeyId, string accessKeySecret, string regionId)
{
var cacheItem = await Cache.GetAsync(AliyunBasicSessionCredentialsCacheItem.CacheKey);
if (cacheItem == null)
{
var roleArn = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.RamRoleArn);
var roleSession = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.RoleSessionName);
Check.NotNullOrWhiteSpace(roleArn, AliyunSettingNames.Authorization.RamRoleArn);
var policy = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.Policy);
var durationSeconds = await SettingProvider.GetAsync(AliyunSettingNames.Authorization.DurationSeconds, 3000);
var profile = DefaultProfile.GetProfile(regionId, accessKeyId, accessKeySecret);
var request = new AssumeRoleRequest
{
AcceptFormat = FormatType.JSON,
RoleArn = roleArn,
RoleSessionName = roleSession,
DurationSeconds = durationSeconds,
Policy = policy.IsNullOrWhiteSpace() ? null : policy
};
var client = new DefaultAcsClient(profile);
var response = client.GetAcsResponse(request);
cacheItem = new AliyunBasicSessionCredentialsCacheItem(
response.Credentials.AccessKeyId,
response.Credentials.AccessKeySecret,
response.Credentials.SecurityToken);
await Cache.SetAsync(
AliyunBasicSessionCredentialsCacheItem.CacheKey,
cacheItem,
new DistributedCacheEntryOptions
{
AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(durationSeconds - 10)
});
}
return cacheItem;
}
}
}

15
aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINYUN/Abp/Aliyun/IAcsClientFactory.cs

@ -0,0 +1,15 @@
using Aliyun.Acs.Core;
using System.Threading.Tasks;
namespace LINYUN.Abp.Aliyun
{
public interface IAcsClientFactory
{
/// <summary>
/// 构造一个通用的Acs客户端调用
/// 通过CommonRequest调用可以不需要集成其他SDK包
/// </summary>
/// <returns></returns>
Task<IAcsClient> CreateAsync();
}
}

18
aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINYUN/Abp/Aliyun/Localization/Resources/en.json

@ -1,5 +1,23 @@
{
"culture": "en",
"texts": {
"DisplayName:Authorization": "Authorization",
"Description:Authorization": "Authorization",
"DisplayName:RegionId": "Region Id",
"Description:RegionId": "Region Id",
"DisplayName:AccessKeyId": "AccessKey Id",
"Description:AccessKeyId": "AccessKey Id",
"DisplayName:AccessKeySecret": "AccessKey Secret",
"Description:AccessKeySecret": "AccessKey Secret",
"DisplayName:UseSecurityTokenService": "Use STS Token",
"Description:UseSecurityTokenService": "Use STS Token",
"DisplayName:RamRoleArn": "Ram Role Arn",
"Description:RamRoleArn": "Ram Role Arn",
"DisplayName:RoleSessionName": "Role Session Name",
"Description:RoleSessionName": "Role Session Name",
"DisplayName:DurationSeconds": "Duration Seconds,in seconds",
"Description:DurationSeconds": "Duration Seconds,in seconds",
"DisplayName:Policy": "Policy",
"Description:Policy": "Policy"
}
}

18
aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINYUN/Abp/Aliyun/Localization/Resources/zh-Hans.json

@ -1,5 +1,23 @@
{
"culture": "zh-Hans",
"texts": {
"DisplayName:Authorization": "阿里云身份认证凭据",
"Description:Authorization": "阿里云身份认证凭据",
"DisplayName:RegionId": "地域ID",
"Description:RegionId": "正在使用的地域ID",
"DisplayName:AccessKeyId": "AccessKey Id",
"Description:AccessKeyId": "访问密钥标识",
"DisplayName:AccessKeySecret": "AccessKey Secret",
"Description:AccessKeySecret": "访问密钥",
"DisplayName:UseSecurityTokenService": "使用STS Token访问",
"Description:UseSecurityTokenService": "使用STS Token访问",
"DisplayName:RamRoleArn": "角色全局资源描述符",
"Description:RamRoleArn": "格式:acs:ram::$accountID:role/$roleName/$RoleSessionName,详情见阿里云访问控制API",
"DisplayName:RoleSessionName": "角色的临时身份",
"Description:RoleSessionName": "此参数用来区分不同的令牌,可用于用户级别的访问审计",
"DisplayName:DurationSeconds": "过期时间,单位为秒。",
"Description:DurationSeconds": "过期时间最小值为900秒,默认3600秒",
"DisplayName:Policy": "权限策略",
"Description:Policy": "生成STS Token时可以指定一个额外的权限策略,以进一步限制STS Token的权限"
}
}

32
aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINYUN/Abp/Aliyun/Settings/AliyunSettingNames.cs

@ -10,10 +10,38 @@
public class Authorization
{
public const string Prefix = AliyunSettingNames.Prefix + ".Authorization";
/// <summary>
/// 地域ID
/// </summary>
public const string RegionId = Prefix + ".RegionId";
/// <summary>
/// RAM账号的AccessKey ID
/// </summary>
public const string AccessKeyId = Prefix + ".AccessKeyId";
/// <summary>
/// RAM账号的AccessKey Secret
/// </summary>
public const string AccessKeySecret = Prefix + ".AccessKeySecret";
/// <summary>
/// 使用STS Token访问
/// </summary>
public const string UseSecurityTokenService = Prefix + ".UseSecurityTokenService";
/// <summary>
/// 使用RAM子账号的AssumeRole方式访问
/// </summary>
public const string RamRoleArn = Prefix + ".RamRoleArn";
/// <summary>
/// 用户自定义参数。此参数用来区分不同的令牌,可用于用户级别的访问审计
/// </summary>
public const string RoleSessionName = Prefix + ".RoleSessionName";
/// <summary>
/// 过期时间,单位为秒。
/// </summary>
public const string DurationSeconds = Prefix + ".DurationSeconds";
/// <summary>
/// 权限策略。
/// </summary>
public const string Policy = Prefix + ".Policy";
}
}
}

81
aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/LINYUN/Abp/Aliyun/Settings/AliyunSettingProvider.cs

@ -0,0 +1,81 @@
using LINYUN.Abp.Aliyun.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Settings;
namespace LINYUN.Abp.Aliyun.Settings
{
public class AliyunSettingProvider : SettingDefinitionProvider
{
public override void Define(ISettingDefinitionContext context)
{
context.Add(CreateAliyunSettings());
}
private SettingDefinition[] CreateAliyunSettings()
{
return new SettingDefinition[]
{
new SettingDefinition(
AliyunSettingNames.Authorization.AccessKeyId,
displayName: L("DisplayName:AccessKeyId"),
description: L("Description:AccessKeyId"),
isVisibleToClients: false,
isEncrypted: true
),
new SettingDefinition(
AliyunSettingNames.Authorization.AccessKeySecret,
displayName: L("DisplayName:AccessKeySecret"),
description: L("Description:AccessKeySecret"),
isVisibleToClients: false,
isEncrypted: true
),
new SettingDefinition(
AliyunSettingNames.Authorization.DurationSeconds,
defaultValue: "3000",
displayName: L("DisplayName:DurationSeconds"),
description: L("Description:DurationSeconds"),
isVisibleToClients: false
),
new SettingDefinition(
AliyunSettingNames.Authorization.Policy,
displayName: L("DisplayName:Policy"),
description: L("Description:Policy"),
isVisibleToClients: false,
isEncrypted: true
),
new SettingDefinition(
AliyunSettingNames.Authorization.RamRoleArn,
displayName: L("DisplayName:RamRoleArn"),
description: L("Description:RamRoleArn"),
isVisibleToClients: false,
isEncrypted: true
),
new SettingDefinition(
AliyunSettingNames.Authorization.RegionId,
displayName: L("DisplayName:RegionId"),
description: L("Description:RegionId"),
isVisibleToClients: false
),
new SettingDefinition(
AliyunSettingNames.Authorization.RoleSessionName,
displayName: L("DisplayName:RoleSessionName"),
description: L("Description:RoleSessionName"),
isVisibleToClients: false,
isEncrypted: true
),
new SettingDefinition(
AliyunSettingNames.Authorization.UseSecurityTokenService,
defaultValue: true.ToString(),
displayName: L("DisplayName:UseSecurityTokenService"),
description: L("Description:UseSecurityTokenService"),
isVisibleToClients: false
),
};
}
private ILocalizableString L(string name)
{
return LocalizableString.Create<AliyunResource>(name);
}
}
}

31
aspnet-core/modules/cloud-aliyun/LINGYUN.Abp.Aliyun/README.md

@ -0,0 +1,31 @@
# LINGYUN.Abp.Aliyun
阿里云sdk集成
参照:https://help.aliyun.com/document_detail/28763.html
## 配置使用
模块按需引用
```csharp
[DependsOn(typeof(AbpAliyunModule))]
public class YouProjectModule : AbpModule
{
// other
}
```
## 配置项说明
* AliyunSettingNames.Authorization.RegionId 可选,区域,默认 default
* AliyunSettingNames.Authorization.AccessKeyId 必须,阿里云RAM账号的AccessKey ID
* AliyunSettingNames.Authorization.AccessKeySecret 必须,RAM账号的AccessKey Secret
* AliyunSettingNames.Authorization.UseSecurityTokenService 可选,建议,使用STS Token访问,按照阿里云文档,建议使用Sts Token访问API,默认false
* AliyunSettingNames.Authorization.RamRoleArn 可选,启用Sts Token之后必须配置,阿里云RAM角色ARN
* AliyunSettingNames.Authorization.RoleSessionName 可选,启用Sts Token之后的用户自定义令牌名称,用于访问审计
* AliyunSettingNames.Authorization.DurationSeconds 可选,用户令牌的过期时间,单位为秒,默认3000
* AliyunSettingNames.Authorization.Policy 可选,权限策略,为json字符串
## 其他
网络因素在高并发下可能会出现预期外的异常,考虑使用二级缓存

6
aspnet-core/modules/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN.Abp.Tencent.csproj

@ -19,9 +19,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Localization" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Json" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Settings" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Localization" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Json" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Settings" Version="4.2.1" />
</ItemGroup>
</Project>

2
aspnet-core/modules/common/LINGYUN.Abp.Aliyun.Authorization/LINGYUN.Abp.Aliyun.Authorization.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Core" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Core" Version="4.2.1" />
</ItemGroup>
</Project>

2
aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.Mvc.Validation/LINGYUN.Abp.AspNetCore.Mvc.Validation.csproj

@ -18,7 +18,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="4.1.2" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="4.2.1" />
</ItemGroup>
</Project>

2
aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json.csproj

@ -9,7 +9,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="5.0.0" />
<PackageReference Include="Volo.Abp.AspNetCore.SignalR" Version="4.1.2" />
<PackageReference Include="Volo.Abp.AspNetCore.SignalR" Version="4.2.1" />
</ItemGroup>
</Project>

2
aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR/LINGYUN.Abp.AspNetCore.SignalR.JwtToken.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.SignalR" Version="4.1.2" />
<PackageReference Include="Volo.Abp.AspNetCore.SignalR" Version="4.2.1" />
</ItemGroup>
</Project>

4
aspnet-core/modules/common/LINGYUN.Abp.BackgroundJobs.Hangfire/LINGYUN.Abp.BackgroundJobs.Hangfire.csproj

@ -8,8 +8,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.HangFire" Version="4.1.2" />
<PackageReference Include="Volo.Abp.BackgroundJobs" Version="4.1.2" />
<PackageReference Include="Volo.Abp.HangFire" Version="4.2.1" />
<PackageReference Include="Volo.Abp.BackgroundJobs" Version="4.2.1" />
</ItemGroup>
</Project>

2
aspnet-core/modules/common/LINGYUN.Abp.BackgroundJobs/LINGYUN.Abp.BackgroundJobs.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.BackgroundJobs" Version="4.1.2" />
<PackageReference Include="Volo.Abp.BackgroundJobs" Version="4.2.1" />
</ItemGroup>
</Project>

4
aspnet-core/modules/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN.Abp.BlobStoring.Aliyun.csproj

@ -10,11 +10,11 @@
<ItemGroup>
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.10.0" />
<PackageReference Include="Volo.Abp.BlobStoring" Version="4.1.2" />
<PackageReference Include="Volo.Abp.BlobStoring" Version="4.2.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.Aliyun.Authorization\LINGYUN.Abp.Aliyun.Authorization.csproj" />
<ProjectReference Include="..\..\cloud-aliyun\LINGYUN.Abp.Aliyun\LINGYUN.Abp.Aliyun.csproj" />
</ItemGroup>
</Project>

4
aspnet-core/modules/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AbpBlobStoringAliyunModule.cs

@ -1,4 +1,4 @@
using LINGYUN.Abp.Aliyun.Authorization;
using LINGYUN.Abp.Aliyun;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System.Collections.Generic;
@ -9,7 +9,7 @@ namespace LINGYUN.Abp.BlobStoring.Aliyun
{
[DependsOn(
typeof(AbpBlobStoringModule),
typeof(AbpAliyunAuthorizationModule))]
typeof(AbpAliyunModule))]
public class AbpBlobStoringAliyunModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)

43
aspnet-core/modules/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProvider.cs

@ -1,6 +1,4 @@
using Aliyun.OSS;
using LINGYUN.Abp.Aliyun.Authorization;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.IO;
@ -12,25 +10,24 @@ namespace LINGYUN.Abp.BlobStoring.Aliyun
{
public class AliyunBlobProvider : BlobProviderBase, ITransientDependency
{
protected AbpAliyunOptions Options { get; }
protected IOssClientFactory OssClientFactory { get; }
protected IAliyunBlobNameCalculator AliyunBlobNameCalculator { get; }
public AliyunBlobProvider(
IOptions<AbpAliyunOptions> options,
IOssClientFactory ossClientFactory,
IAliyunBlobNameCalculator aliyunBlobNameCalculator)
{
Options = options.Value;
OssClientFactory = ossClientFactory;
AliyunBlobNameCalculator = aliyunBlobNameCalculator;
}
public override async Task<bool> DeleteAsync(BlobProviderDeleteArgs args)
{
var ossClient = await GetOssClientAsync(args);
var blobName = AliyunBlobNameCalculator.Calculate(args);
if (await BlobExistsAsync(args, blobName))
if (await BlobExistsAsync(ossClient, args, blobName))
{
var ossClient = GetOssClient(args);
return ossClient.DeleteObject(GetBucketName(args), blobName).DeleteMarker;
}
@ -39,21 +36,22 @@ namespace LINGYUN.Abp.BlobStoring.Aliyun
public override async Task<bool> ExistsAsync(BlobProviderExistsArgs args)
{
var ossClient = await GetOssClientAsync(args);
var blobName = AliyunBlobNameCalculator.Calculate(args);
return await BlobExistsAsync(args, blobName);
return await BlobExistsAsync(ossClient, args, blobName);
}
public override async Task<Stream> GetOrNullAsync(BlobProviderGetArgs args)
{
var ossClient = await GetOssClientAsync(args);
var blobName = AliyunBlobNameCalculator.Calculate(args);
if (!await BlobExistsAsync(args, blobName))
if (!await BlobExistsAsync(ossClient, args, blobName))
{
return null;
}
var ossClient = GetOssClient(args);
var ossObject = ossClient.GetObject(GetBucketName(args), blobName);
var memoryStream = new MemoryStream();
await ossObject.Content.CopyToAsync(memoryStream);
@ -62,20 +60,20 @@ namespace LINGYUN.Abp.BlobStoring.Aliyun
public override async Task SaveAsync(BlobProviderSaveArgs args)
{
var ossClient = await GetOssClientAsync(args);
var blobName = AliyunBlobNameCalculator.Calculate(args);
var configuration = args.Configuration.GetAliyunConfiguration();
// 先检查Bucket
if (configuration.CreateBucketIfNotExists)
{
await CreateBucketIfNotExists(args, configuration.CreateBucketReferer);
await CreateBucketIfNotExists(ossClient, args, configuration.CreateBucketReferer);
}
var bucketName = GetBucketName(args);
var ossClient = GetOssClient(args);
// 是否已存在
if (await BlobExistsAsync(args, blobName))
if (await BlobExistsAsync(ossClient, args, blobName))
{
// 是否覆盖
if (!args.OverrideExisting)
@ -92,18 +90,17 @@ namespace LINGYUN.Abp.BlobStoring.Aliyun
ossClient.PutObject(bucketName, blobName, args.BlobStream);
}
protected virtual OssClient GetOssClient(BlobProviderArgs args)
protected virtual async Task<IOss> GetOssClientAsync(BlobProviderArgs args)
{
var configuration = args.Configuration.GetAliyunConfiguration();
var ossClient = new OssClient(configuration.Endpoint, Options.AccessKeyId, Options.AccessKeySecret);
var ossClient = await OssClientFactory.CreateAsync(configuration);
return ossClient;
}
protected virtual async Task CreateBucketIfNotExists(BlobProviderArgs args, IList<string> refererList = null)
protected virtual async Task CreateBucketIfNotExists(IOss ossClient, BlobProviderArgs args, IList<string> refererList = null)
{
if (! await BucketExistsAsync(args))
if (! await BucketExistsAsync(ossClient, args))
{
var ossClient = GetOssClient(args);
var bucketName = GetBucketName(args);
var request = new CreateBucketRequest(bucketName)
@ -124,10 +121,9 @@ namespace LINGYUN.Abp.BlobStoring.Aliyun
}
}
private async Task<bool> BlobExistsAsync(BlobProviderArgs args, string blobName)
private async Task<bool> BlobExistsAsync(IOss ossClient, BlobProviderArgs args, string blobName)
{
var ossClient = GetOssClient(args);
var bucketExists = await BucketExistsAsync(args);
var bucketExists = await BucketExistsAsync(ossClient, args);
if (bucketExists)
{
var objectExists = ossClient.DoesObjectExist(GetBucketName(args), blobName);
@ -137,9 +133,8 @@ namespace LINGYUN.Abp.BlobStoring.Aliyun
return false;
}
private Task<bool> BucketExistsAsync(BlobProviderArgs args)
private Task<bool> BucketExistsAsync(IOss ossClient, BlobProviderArgs args)
{
var ossClient = GetOssClient(args);
var bucketExists = ossClient.DoesBucketExist(GetBucketName(args));
return Task.FromResult(bucketExists);

15
aspnet-core/modules/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/IOssClientFactory.cs

@ -0,0 +1,15 @@
using Aliyun.OSS;
using System.Threading.Tasks;
namespace LINGYUN.Abp.BlobStoring.Aliyun
{
public interface IOssClientFactory
{
/// <summary>
/// 通过配置信息构建Oss客户端调用
/// </summary>
/// <param name="configuration"></param>
/// <returns></returns>
Task<IOss> CreateAsync(AliyunBlobProviderConfiguration configuration);
}
}

50
aspnet-core/modules/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/OssClientFactory.cs

@ -0,0 +1,50 @@
using Aliyun.OSS;
using LINYUN.Abp.Aliyun;
using Volo.Abp.Caching;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Settings;
namespace LINGYUN.Abp.BlobStoring.Aliyun
{
public class OssClientFactory : AliyunClientFactory<IOss, AliyunBlobProviderConfiguration>, IOssClientFactory, ITransientDependency
{
public OssClientFactory(
ISettingProvider settingProvider,
IDistributedCache<AliyunBasicSessionCredentialsCacheItem> cache)
: base(settingProvider, cache)
{
}
/// <summary>
/// 普通方式构建Oss客户端
/// </summary>
/// <param name="configuration"></param>
/// <param name="regionId"></param>
/// <param name="accessKeyId"></param>
/// <param name="accessKeySecret"></param>
/// <returns></returns>
protected override IOss GetClient(AliyunBlobProviderConfiguration configuration, string regionId, string accessKeyId, string accessKeySecret)
{
return new OssClient(
configuration.Endpoint,
accessKeyId,
accessKeySecret);
}
/// <summary>
/// 通过用户安全令牌构建Oss客户端
/// </summary>
/// <param name="configuration"></param>
/// <param name="regionId"></param>
/// <param name="accessKeyId"></param>
/// <param name="accessKeySecret"></param>
/// <param name="securityToken"></param>
/// <returns></returns>
protected override IOss GetSecurityTokenClient(AliyunBlobProviderConfiguration configuration, string regionId, string accessKeyId, string accessKeySecret, string securityToken)
{
return new OssClient(
configuration.Endpoint,
accessKeyId,
accessKeySecret,
securityToken);
}
}
}

6
aspnet-core/modules/common/LINGYUN.Abp.BlobStoring.Aliyun/README.md

@ -4,17 +4,13 @@ abp框架对象存储提供者**IBlobProvider**的阿里云实现
## 配置使用
模块按需引用,需要引用阿里云公共基础认证模块
模块按需引用
事先定义**appsettings.json**文件
```json
{
"Aliyun": {
"Auth": {
"AccessKeyId": "你的阿里云访问标识",
"AccessKeySecret": "你的阿里云访问密钥"
},
"OSS": {
"BucketName": "你定义的BucketName",
"Endpoint": "http://oss-cn-shanghai.aliyuncs.com",

2
aspnet-core/modules/common/LINGYUN.Abp.Core/LINGYUN.Abp.Core.csproj

@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Core" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Core" Version="4.2.1" />
</ItemGroup>
</Project>

2
aspnet-core/modules/common/LINGYUN.Abp.DistributedLock.Redis/LINGYUN.Abp.DistributedLock.Redis.csproj

@ -12,7 +12,7 @@
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="5.0.0" />
<PackageReference Include="Polly" Version="7.2.1" />
<PackageReference Include="Volo.Abp.Core" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Core" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

2
aspnet-core/modules/common/LINGYUN.Abp.Domain.Entities.Events/LINGYUN.Abp.Domain.Entities.Events.csproj

@ -6,7 +6,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="4.2.1" />
</ItemGroup>
</Project>

4
aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.csproj

@ -12,8 +12,8 @@
<ItemGroup>
<PackageReference Include="DotNetCore.CAP" Version="3.1.2" />
<PackageReference Include="Volo.Abp.BackgroundWorkers" Version="4.1.2" />
<PackageReference Include="Volo.Abp.EventBus" Version="4.1.2" />
<PackageReference Include="Volo.Abp.BackgroundWorkers" Version="4.2.1" />
<PackageReference Include="Volo.Abp.EventBus" Version="4.2.1" />
</ItemGroup>
</Project>

2
aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN.Abp.ExceptionHandling.Emailing.csproj

@ -22,7 +22,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Emailing" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Emailing" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

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

@ -18,7 +18,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Localization" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Localization" Version="4.2.1" />
</ItemGroup>

2
aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling/LINGYUN.Abp.ExceptionHandling.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Localization" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Localization" Version="4.2.1" />
</ItemGroup>
</Project>

2
aspnet-core/modules/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN.Abp.Features.LimitValidation.Redis.csproj

@ -11,7 +11,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Options" Version="5.0.0" />
<PackageReference Include="StackExchange.Redis" Version="2.0.593" />
<PackageReference Include="Volo.Abp.Core" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Core" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

2
aspnet-core/modules/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN.Abp.Features.LimitValidation.csproj

@ -18,7 +18,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Features" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Features" Version="4.2.1" />
</ItemGroup>
</Project>

2
aspnet-core/modules/common/LINGYUN.Abp.Hangfire.MySqlStorage/LINGYUN.Abp.Hangfire.Storage.MySql.csproj

@ -9,7 +9,7 @@
<ItemGroup>
<PackageReference Include="Hangfire.MySqlStorage" Version="2.0.3" />
<PackageReference Include="Volo.Abp.HangFire" Version="4.1.2" />
<PackageReference Include="Volo.Abp.HangFire" Version="4.2.1" />
</ItemGroup>
</Project>

2
aspnet-core/modules/common/LINGYUN.Abp.Hangfire.Storage.SqlServer/LINGYUN.Abp.Hangfire.Storage.SqlServer.csproj

@ -9,7 +9,7 @@
<ItemGroup>
<PackageReference Include="HangFire.SqlServer" Version="1.7.19" />
<PackageReference Include="Volo.Abp.HangFire" Version="4.1.2" />
<PackageReference Include="Volo.Abp.HangFire" Version="4.2.1" />
</ItemGroup>
</Project>

4
aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN.Abp.IM.SignalR.csproj

@ -8,8 +8,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.SignalR" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="4.1.2" />
<PackageReference Include="Volo.Abp.AspNetCore.SignalR" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

4
aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN.Abp.IM.csproj

@ -8,8 +8,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Auditing" Version="4.1.2" />
<PackageReference Include="Volo.Abp.EventBus" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Auditing" Version="4.2.1" />
<PackageReference Include="Volo.Abp.EventBus" Version="4.2.1" />
</ItemGroup>
</Project>

4
aspnet-core/modules/common/LINGYUN.Abp.IdentityModel/LINGYUN.Abp.IdentityModel.csproj

@ -13,8 +13,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Caching" Version="4.1.2" />
<PackageReference Include="Volo.Abp.IdentityModel" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Caching" Version="4.2.1" />
<PackageReference Include="Volo.Abp.IdentityModel" Version="4.2.1" />
</ItemGroup>
</Project>

6
aspnet-core/modules/common/LINGYUN.Abp.Location.Amap/LINGYUN.Abp.Location.Amap.csproj

@ -17,9 +17,9 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="3.1.2" />
<PackageReference Include="Volo.Abp.Json" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Localization" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Threading" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Json" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Localization" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Threading" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

6
aspnet-core/modules/common/LINGYUN.Abp.Location.Baidu/LINGYUN.Abp.Location.Baidu.csproj

@ -20,9 +20,9 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="5.0.0" />
<PackageReference Include="Volo.Abp.Localization" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Json" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Threading" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Localization" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Json" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Threading" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

6
aspnet-core/modules/common/LINGYUN.Abp.Location.Tencent/LINGYUN.Abp.Location.Tencent.csproj

@ -20,9 +20,9 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="5.0.0" />
<PackageReference Include="Volo.Abp.Localization" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Json" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Threading" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Localization" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Json" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Threading" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

2
aspnet-core/modules/common/LINGYUN.Abp.Location/LINGYUN.Abp.Location.csproj

@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Core" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Core" Version="4.2.1" />
</ItemGroup>
</Project>

4
aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN.Abp.Notifications.SignalR.csproj

@ -8,8 +8,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.SignalR" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="4.1.2" />
<PackageReference Include="Volo.Abp.AspNetCore.SignalR" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

3
aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/Hubs/NotificationsHub.cs

@ -12,8 +12,7 @@ namespace LINGYUN.Abp.Notifications.SignalR.Hubs
[Authorize]
public class NotificationsHub : OnlineClientHubBase
{
private INotificationStore _notificationStore;
protected INotificationStore NotificationStore => LazyGetRequiredService(ref _notificationStore);
protected INotificationStore NotificationStore => LazyServiceProvider.LazyGetRequiredService<INotificationStore>();
protected override async Task OnClientConnectedAsync(IOnlineClient client)
{

2
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Sms/LINGYUN.Abp.Notifications.Sms.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Sms" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Sms" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

6
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN.Abp.Notifications.csproj

@ -8,9 +8,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.EventBus" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Json" Version="4.1.2" />
<PackageReference Include="Volo.Abp.BackgroundJobs" Version="4.1.2" />
<PackageReference Include="Volo.Abp.EventBus" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Json" Version="4.2.1" />
<PackageReference Include="Volo.Abp.BackgroundJobs" Version="4.2.1" />
</ItemGroup>
</Project>

2
aspnet-core/modules/common/LINGYUN.Abp.RealTime.SignalR/LINGYUN.Abp.RealTime.SignalR.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.SignalR" Version="4.1.2" />
<PackageReference Include="Volo.Abp.AspNetCore.SignalR" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

7
aspnet-core/modules/common/LINGYUN.Abp.RealTime.SignalR/LINGYUN/Abp/RealTime/SignalR/Hubs/OnlineClientHubBase.cs

@ -9,11 +9,8 @@ namespace LINGYUN.Abp.RealTime.SignalR
{
public abstract class OnlineClientHubBase : AbpHub, IClient
{
private IWebClientInfoProvider _webClientInfoProvider;
protected IWebClientInfoProvider WebClientInfoProvider => LazyGetRequiredService(ref _webClientInfoProvider);
private IOnlineClientManager _onlineClientManager;
protected IOnlineClientManager OnlineClientManager => LazyGetRequiredService(ref _onlineClientManager);
protected IWebClientInfoProvider WebClientInfoProvider => LazyServiceProvider.LazyGetRequiredService<IWebClientInfoProvider>();
protected IOnlineClientManager OnlineClientManager => LazyServiceProvider.LazyGetRequiredService<IOnlineClientManager>();
public override async Task OnConnectedAsync()
{

2
aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN.Abp.RealTime.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Core" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Core" Version="4.2.1" />
</ItemGroup>
</Project>

2
aspnet-core/modules/common/LINGYUN.Abp.Rules/LINGYUN.Abp.Rules.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="4.2.1" />
</ItemGroup>
</Project>

2
aspnet-core/modules/common/LINGYUN.Abp.Settings/LINGYUN.Abp.Settings.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Settings" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Settings" Version="4.2.1" />
</ItemGroup>
</Project>

7
aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN.Abp.Sms.Aliyun.csproj

@ -19,14 +19,11 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="aliyun-net-sdk-core" Version="1.5.8" />
<PackageReference Include="Volo.Abp.Json" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Localization" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Sms" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Sms" Version="4.2.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.Aliyun.Authorization\LINGYUN.Abp.Aliyun.Authorization.csproj" />
<ProjectReference Include="..\..\cloud-aliyun\LINGYUN.Abp.Aliyun\LINGYUN.Abp.Aliyun.csproj" />
</ItemGroup>
</Project>

13
aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINYUN/Abp/Sms/Aliyun/AbpAliyunSmsModule.cs

@ -1,7 +1,6 @@
using LINGYUN.Abp.Aliyun.Authorization;
using LINGYUN.Abp.Aliyun;
using LINYUN.Abp.Aliyun.Localization;
using LINYUN.Abp.Sms.Aliyun.Localization;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Json;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.Sms;
@ -11,16 +10,11 @@ namespace LINYUN.Abp.Sms.Aliyun
{
[DependsOn(
typeof(AbpSmsModule),
typeof(AbpJsonModule),
typeof(AbpLocalizationModule),
typeof(AbpAliyunAuthorizationModule))]
typeof(AbpAliyunModule))]
public class AbpAliyunSmsModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var configuration = context.Services.GetConfiguration();
Configure<AliyunSmsOptions>(configuration.GetSection("Aliyun:Sms"));
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpAliyunSmsModule>();
@ -30,6 +24,7 @@ namespace LINYUN.Abp.Sms.Aliyun
{
options.Resources
.Add<AliyunSmsResource>("en")
.AddBaseTypes(typeof(AliyunResource))
.AddVirtualJson("/LINYUN/Abp/Sms/Aliyun/Localization/Resources");
});
}

22
aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINYUN/Abp/Sms/Aliyun/AliyunSmsException.cs

@ -1,28 +1,12 @@
using Microsoft.Extensions.Logging;
using Volo.Abp;
using Volo.Abp.ExceptionHandling;
using Volo.Abp.Localization;
using Volo.Abp.Logging;
using LINYUN.Abp.Aliyun;
namespace LINYUN.Abp.Sms.Aliyun
{
public class AliyunSmsException : AbpException, IHasErrorCode, ILocalizeErrorMessage, IHasLogLevel
public class AliyunSmsException : AbpAliyunException
{
public AliyunSmsException(string code, string message)
:base(message)
:base(code, message)
{
Code = code;
LogLevel = LogLevel.Warning;
}
public LogLevel LogLevel { get; set; }
public string Code { get; }
public string LocalizeMessage(LocalizationContext context)
{
return AliyunSmsResponse.GetErrorMessage(Code, Message)
.Localize(context.LocalizerFactory);
}
}
}

38
aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINYUN/Abp/Sms/Aliyun/AliyunSmsOptions.cs

@ -1,38 +0,0 @@
namespace LINYUN.Abp.Sms.Aliyun
{
public class AliyunSmsOptions
{
/// <summary>
/// 区域Id
/// </summary>
public string RegionId { get; set; } = "default";
/// <summary>
/// 阿里云sms服务域名
/// </summary>
public string Domain { get; set; } = "dysmsapi.aliyuncs.com";
/// <summary>
/// 调用方法名称
/// </summary>
public string ActionName { get; set; } = "SendSms";
/// <summary>
/// 默认版本号
/// </summary>
public string Version { get; set; } = "2017-05-25";
/// <summary>
/// 默认签名
/// </summary>
public string DefaultSignName { get; set; }
/// <summary>
/// 默认短信模板号
/// </summary>
public string DefaultTemplateCode { get; set; }
/// <summary>
/// 开发人员号码,当应用处于开发模式时,默认所有信息都会发送到此号码
/// </summary>
public string DeveloperPhoneNumber { get; set; } = "13800138000";
/// <summary>
/// 展示错误给客户端
/// </summary>
public bool VisableErrorToClient { get; set; } = false;
}
}

87
aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINYUN/Abp/Sms/Aliyun/AliyunSmsSender.cs

@ -1,19 +1,17 @@
using Aliyun.Acs.Core;
using Aliyun.Acs.Core.Exceptions;
using Aliyun.Acs.Core.Http;
using Aliyun.Acs.Core.Profile;
using LINGYUN.Abp.Aliyun.Authorization;
using LINYUN.Abp.Sms.Aliyun.Localization;
using LINYUN.Abp.Aliyun;
using LINYUN.Abp.Sms.Aliyun.Settings;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Options;
using System;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Json;
using Volo.Abp.Settings;
using Volo.Abp.Sms;
namespace LINYUN.Abp.Sms.Aliyun
@ -22,69 +20,71 @@ namespace LINYUN.Abp.Sms.Aliyun
[ExposeServices(typeof(ISmsSender), typeof(AliyunSmsSender))]
public class AliyunSmsSender : ISmsSender
{
protected AbpAliyunOptions AuthOptions { get; }
protected AliyunSmsOptions Options { get; }
protected IJsonSerializer JsonSerializer { get; }
protected IHostEnvironment Environment { get; }
protected ISettingProvider SettingProvider { get; }
protected IServiceProvider ServiceProvider { get; }
protected IAcsClientFactory AcsClientFactory { get; }
public AliyunSmsSender(
IHostEnvironment environment,
IJsonSerializer jsonSerializer,
ISettingProvider settingProvider,
IServiceProvider serviceProvider,
IOptions<AliyunSmsOptions> options,
IOptions<AbpAliyunOptions> authOptions)
IAcsClientFactory acsClientFactory)
{
Options = options.Value;
AuthOptions = authOptions.Value;
Environment = environment;
JsonSerializer = jsonSerializer;
SettingProvider = settingProvider;
ServiceProvider = serviceProvider;
AcsClientFactory = acsClientFactory;
}
public Task SendAsync(SmsMessage smsMessage)
public virtual async Task SendAsync(SmsMessage smsMessage)
{
var domain = await SettingProvider.GetOrNullAsync(AliyunSmsSettingNames.Sms.Domain);
var action = await SettingProvider.GetOrNullAsync(AliyunSmsSettingNames.Sms.ActionName);
var version = await SettingProvider.GetOrNullAsync(AliyunSmsSettingNames.Sms.Version);
Check.NotNullOrWhiteSpace(domain, AliyunSmsSettingNames.Sms.Domain);
Check.NotNullOrWhiteSpace(action, AliyunSmsSettingNames.Sms.ActionName);
Check.NotNullOrWhiteSpace(version, AliyunSmsSettingNames.Sms.Version);
CommonRequest request = new CommonRequest
{
Method = MethodType.POST,
Domain = Options.Domain,
Action = Options.ActionName,
Version = Options.Version
Domain = domain,
Action = action,
Version = version
};
TryAddTemplateCode(request, smsMessage);
TryAddSignName(request, smsMessage);
TryAddSendPhone(request, smsMessage);
await TryAddTemplateCodeAsync(request, smsMessage);
await TryAddSignNameAsync(request, smsMessage);
await TryAddSendPhoneAsync(request, smsMessage);
TryAddTemplateParam(request, smsMessage);
try
{
IClientProfile profile = DefaultProfile.GetProfile(Options.RegionId, AuthOptions.AccessKeyId, AuthOptions.AccessKeySecret);
IAcsClient client = new DefaultAcsClient(profile);
var client = await AcsClientFactory.CreateAsync();
CommonResponse response = client.GetCommonResponse(request);
var responseContent = Encoding.Default.GetString(response.HttpResponse.Content);
var aliyunResponse = JsonSerializer.Deserialize<AliyunSmsResponse>(responseContent);
if (!aliyunResponse.IsSuccess())
{
if (Options.VisableErrorToClient)
if (await SettingProvider.IsTrueAsync(AliyunSmsSettingNames.Sms.VisableErrorToClient))
{
throw new AliyunSmsException(aliyunResponse.Code, aliyunResponse.Message);
throw new UserFriendlyException(aliyunResponse.Code, aliyunResponse.Message);
}
throw new AbpException($"Text message sending failed, code:{aliyunResponse.Code}, message:{aliyunResponse.Message}!");
throw new AliyunSmsException(aliyunResponse.Code, $"Text message sending failed, code:{aliyunResponse.Code}, message:{aliyunResponse.Message}!");
}
}
catch(ServerException se)
{
throw new AbpException("Sending text messages to aliyun server is abnormal", se);
throw new AliyunSmsException(se.ErrorCode, $"Sending text messages to aliyun server is abnormal,type: {se.ErrorType}, error: {se.ErrorMessage}");
}
catch(ClientException ce)
{
throw new AbpException("A client exception occurred in sending SMS messages", ce);
throw new AliyunSmsException(ce.ErrorCode, $"A client exception occurred in sending SMS messages,type: {ce.ErrorType}, error: {ce.ErrorMessage}");
}
return Task.CompletedTask;
}
private void TryAddTemplateCode(CommonRequest request, SmsMessage smsMessage)
private async Task TryAddTemplateCodeAsync(CommonRequest request, SmsMessage smsMessage)
{
if (smsMessage.Properties.TryGetValue("TemplateCode", out object template) && template != null)
{
@ -93,12 +93,13 @@ namespace LINYUN.Abp.Sms.Aliyun
}
else
{
Check.NotNullOrWhiteSpace(Options.DefaultTemplateCode, nameof(Options.DefaultTemplateCode));
request.AddQueryParameters("TemplateCode", Options.DefaultTemplateCode);
var defaultTemplateCode = await SettingProvider.GetOrNullAsync(AliyunSmsSettingNames.Sms.DefaultTemplateCode);
Check.NotNullOrWhiteSpace(defaultTemplateCode, "TemplateCode");
request.AddQueryParameters("TemplateCode", defaultTemplateCode);
}
}
private void TryAddSignName(CommonRequest request, SmsMessage smsMessage)
private async Task TryAddSignNameAsync(CommonRequest request, SmsMessage smsMessage)
{
if (smsMessage.Properties.TryGetValue("SignName", out object signName) && signName != null)
{
@ -107,21 +108,23 @@ namespace LINYUN.Abp.Sms.Aliyun
}
else
{
Check.NotNullOrWhiteSpace(Options.DefaultSignName, nameof(Options.DefaultSignName));
request.AddQueryParameters("SignName", Options.DefaultSignName);
var defaultSignName = await SettingProvider.GetOrNullAsync(AliyunSmsSettingNames.Sms.DefaultSignName);
Check.NotNullOrWhiteSpace(defaultSignName, "SignName");
request.AddQueryParameters("SignName", defaultSignName);
}
}
private void TryAddSendPhone(CommonRequest request, SmsMessage smsMessage)
private async Task TryAddSendPhoneAsync(CommonRequest request, SmsMessage smsMessage)
{
if (Environment.IsDevelopment())
if (smsMessage.PhoneNumber.IsNullOrWhiteSpace())
{
var defaultPhoneNumber = await SettingProvider.GetOrNullAsync(AliyunSmsSettingNames.Sms.DefaultPhoneNumber);
// check phone number length...
Check.NotNullOrWhiteSpace(
Options.DeveloperPhoneNumber,
nameof(Options.DeveloperPhoneNumber),
defaultPhoneNumber,
AliyunSmsSettingNames.Sms.DefaultPhoneNumber,
maxLength: 11, minLength: 11);
request.AddQueryParameters("PhoneNumbers", Options.DeveloperPhoneNumber);
request.AddQueryParameters("PhoneNumbers", defaultPhoneNumber);
}
else
{

14
aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINYUN/Abp/Sms/Aliyun/Localization/Resources/zh-Hans.json

@ -1,6 +1,20 @@
{
"culture": "zh-Hans",
"texts": {
"DisplayName:ActionName": "阿里云身份认证凭据",
"Description:ActionName": "阿里云身份认证凭据",
"DisplayName:DefaultSignName": "地域ID",
"Description:DefaultSignName": "正在使用的地域ID",
"DisplayName:DefaultTemplateCode": "AccessKey Id",
"Description:DefaultTemplateCode": "访问密钥标识",
"DisplayName:DeveloperPhoneNumber": "AccessKey Secret",
"Description:DeveloperPhoneNumber": "访问密钥",
"DisplayName:Domain": "阿里云sms服务域名",
"Description:Domain": "使用STS Token访问",
"DisplayName:Version": "角色全局资源描述符",
"Description:Version": "格式:acs:ram::$accountID:role/$roleName/$RoleSessionName,详情见阿里云访问控制API",
"DisplayName:RoleSessionName": "角色全局资源描述符",
"Description:RoleSessionName": "格式:acs:ram::$accountID:role/$roleName/$RoleSessionName,详情见阿里云访问控制API",
"SendMessageFailed": "发送短信错误:{0}",
"SMS_SIGNATURE_SCENE_ILLEGAL": "短信所使用签名场景非法",
"DENY_IP_RANGE": "源IP地址所在的地区被禁用",

43
aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINYUN/Abp/Sms/Aliyun/Settings/AliyunSmsSettingNames.cs

@ -0,0 +1,43 @@
using LINYUN.Abp.Aliyun.Settings;
namespace LINYUN.Abp.Sms.Aliyun.Settings
{
public static class AliyunSmsSettingNames
{
/// <summary>
/// 短信服务
/// </summary>
public class Sms
{
public const string Prefix = AliyunSettingNames.Prefix + ".Sms";
/// <summary>
/// 阿里云sms服务域名
/// </summary>
public const string Domain = Prefix + ".Domain";
/// <summary>
/// 调用方法名称
/// </summary>
public const string ActionName = Prefix + ".ActionName";
/// <summary>
/// 默认版本号
/// </summary>
public const string Version = Prefix + ".Version";
/// <summary>
/// 默认签名
/// </summary>
public const string DefaultSignName = Prefix + ".DefaultSignName";
/// <summary>
/// 默认短信模板号
/// </summary>
public const string DefaultTemplateCode = Prefix + ".DefaultTemplateCode";
/// <summary>
/// 默认号码
/// </summary>
public const string DefaultPhoneNumber = Prefix + ".DefaultPhoneNumber";
/// <summary>
/// 展示错误给客户端
/// </summary>
public const string VisableErrorToClient = Prefix + ".VisableErrorToClient";
}
}
}

74
aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/LINYUN/Abp/Sms/Aliyun/Settings/AliyunSmsSettingProvider.cs

@ -0,0 +1,74 @@
using LINYUN.Abp.Aliyun.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Settings;
namespace LINYUN.Abp.Sms.Aliyun.Settings
{
public class AliyunSmsSettingProvider : SettingDefinitionProvider
{
public override void Define(ISettingDefinitionContext context)
{
context.Add(CreateAliyunSettings());
}
private SettingDefinition[] CreateAliyunSettings()
{
return new SettingDefinition[]
{
new SettingDefinition(
AliyunSmsSettingNames.Sms.ActionName,
defaultValue: "SendSms",
displayName: L("DisplayName:ActionName"),
description: L("Description:ActionName"),
isVisibleToClients: false
),
new SettingDefinition(
AliyunSmsSettingNames.Sms.DefaultSignName,
displayName: L("DisplayName:DefaultSignName"),
description: L("Description:DefaultSignName"),
isVisibleToClients: false,
isEncrypted: true
),
new SettingDefinition(
AliyunSmsSettingNames.Sms.DefaultTemplateCode,
displayName: L("DisplayName:DefaultTemplateCode"),
description: L("Description:DefaultTemplateCode"),
isVisibleToClients: false,
isEncrypted: true
),
new SettingDefinition(
AliyunSmsSettingNames.Sms.DefaultPhoneNumber,
displayName: L("DisplayName:DefaultPhoneNumber"),
description: L("Description:DefaultPhoneNumber"),
isVisibleToClients: false
),
new SettingDefinition(
AliyunSmsSettingNames.Sms.Domain,
defaultValue: "dysmsapi.aliyuncs.com",
displayName: L("DisplayName:Domain"),
description: L("Description:Domain"),
isVisibleToClients: false
),
new SettingDefinition(
AliyunSmsSettingNames.Sms.Version,
defaultValue: "2017-05-25",
displayName: L("DisplayName:Version"),
description: L("Description:Version"),
isVisibleToClients: false
),
new SettingDefinition(
AliyunSmsSettingNames.Sms.VisableErrorToClient,
defaultValue: false.ToString(),
displayName: L("DisplayName:VisableErrorToClient"),
description: L("Description:VisableErrorToClient"),
isVisibleToClients: false
)
};
}
private ILocalizableString L(string name)
{
return LocalizableString.Create<AliyunResource>(name);
}
}
}

38
aspnet-core/modules/common/LINGYUN.Abp.Sms.Aliyun/README.md

@ -4,30 +4,7 @@ abp框架短信发送接口**ISmsSender**的阿里云实现
## 配置使用
模块按需引用,需要引用阿里云公共基础认证模块
事先定义**appsettings.json**文件
```json
{
"Aliyun": {
"Auth": {
"AccessKeyId": "你的阿里云访问标识",
"AccessKeySecret": "你的阿里云访问密钥"
},
"Sms": {
"RegionId": "cn-hangzhou",
"Domain": "dysmsapi.aliyuncs.com",
"Version": "2017-05-25",
"DefaultSignName": "你的阿里云短信签名,SmsMessage.Properties[SignName]不存在则使用DefaultSignName",
"DefaultTemplateCode": "你的阿里云短信模板,SmsMessage.Properties[TemplateCode]不存在则使用DefaultTemplateCode",
"DeveloperPhoneNumber": "这是用于在开发模式下的短信号码,用于统一接收短信",
"VisableErrorToClient": true
}
}
}
```
模块按需引用
```csharp
[DependsOn(typeof(AbpAliyunSmsModule))]
@ -36,3 +13,16 @@ public class YouProjectModule : AbpModule
// other
}
```
## 配置项说明
* AliyunSettingNames.Sms.Domain 可选,阿里云sms服务域名,默认 dysmsapi.aliyuncs.com
* AliyunSettingNames.Sms.ActionName 必须,调用方法名称,默认 SendSms
* AliyunSettingNames.Sms.Version 必须,R默认版本号,默认 2017-05-25
* AliyunSettingNames.Sms.DefaultSignName 可选,默认签名,当用户调用未传递签名时,默认使用的短信签名
* AliyunSettingNames.Sms.DefaultTemplateCode 可选,默认短信模板号,,当用户调用未传递短信模板时,默认使用的短信模板
* AliyunSettingNames.Sms.DefaultPhoneNumber 可选,默认发送号码,当用户调用未传递接收者号码时,默认使用的接收人号码
* AliyunSettingNames.Sms.VisableErrorToClient 可选,展示错误给客户端,当调用短信接口出现错误时,是否返回错误明细给客户端,默认 false
## 其他
网络因素在高并发下可能会出现预期外的异常,考虑使用二级缓存

12
aspnet-core/modules/console/LINGYUN.Abp.Encryption.Console/AbpEncryptionConsoleModule.cs

@ -0,0 +1,12 @@
using Volo.Abp.Modularity;
using Volo.Abp.Security;
namespace LINGYUN.Abp.Encryption.Console
{
[DependsOn(
typeof(AbpSecurityModule))]
public class AbpEncryptionConsoleModule : AbpModule
{
}
}

12
aspnet-core/modules/console/LINGYUN.Abp.Encryption.Console/LINGYUN.Abp.Encryption.Console.csproj

@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Security" Version="4.2.1" />
</ItemGroup>
</Project>

42
aspnet-core/modules/console/LINGYUN.Abp.Encryption.Console/Program.cs

@ -0,0 +1,42 @@
using Microsoft.Extensions.DependencyInjection;
using System;
using Volo.Abp;
using Volo.Abp.Security.Encryption;
using static System.Console;
namespace LINGYUN.Abp.Encryption.Console
{
class Program
{
static void Main(string[] args)
{
WriteLine("Hello World!");
var application = AbpApplicationFactory.Create<AbpEncryptionConsoleModule>();
application.Initialize();
WriteLine("D:解密 E:加密");
var opt = ReadLine();
bool en = false;
if ("E".Equals(opt, StringComparison.InvariantCultureIgnoreCase))
{
en = true;
WriteLine("请输入需要加密的字符串");
}
else
{
WriteLine("请输入需要解密的字符串");
}
var sourceChr = ReadLine();
var encryptionService = application.ServiceProvider.GetRequiredService<IStringEncryptionService>();
WriteLine(en ? encryptionService.Encrypt(sourceChr) : encryptionService.Decrypt(sourceChr));
application.Shutdown();
ReadKey();
}
}
}

4
aspnet-core/modules/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN.Abp.FeatureManagement.Client.csproj

@ -13,8 +13,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Authorization" Version="4.1.2" />
<PackageReference Include="Volo.Abp.FeatureManagement.Domain" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Authorization" Version="4.2.1" />
<PackageReference Include="Volo.Abp.FeatureManagement.Domain" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

8
aspnet-core/modules/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/Client/ClientFeatureManagementProvider.cs

@ -1,4 +1,5 @@
using LINGYUN.Abp.Features.Client;
using System.Threading.Tasks;
using Volo.Abp.Clients;
using Volo.Abp.DependencyInjection;
using Volo.Abp.FeatureManagement;
@ -20,14 +21,15 @@ namespace LINGYUN.Abp.FeatureManagement.Client
CurrentClient = currentClient;
}
protected override string NormalizeProviderKey(string providerKey)
protected override Task<string> NormalizeProviderKeyAsync(string providerKey)
{
if (providerKey != null)
{
return providerKey;
base.NormalizeProviderKeyAsync(providerKey);
}
return CurrentClient.Id;
return Task.FromResult(CurrentClient.Id);
}
}
}

2
aspnet-core/modules/features/LINGYUN.Abp.Features.Client/LINGYUN.Abp.Features.Client.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Features" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Features" Version="4.2.1" />
</ItemGroup>
</Project>

2
aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.Application.Contracts/LINGYUN.Abp.FileManagement.Application.Contracts.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Application" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

2
aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.Domain.Shared/LINGYUN.Abp.FileManagement.Domain.Shared.csproj

@ -18,7 +18,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Validation" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Validation" Version="4.2.1" />
</ItemGroup>
</Project>

4
aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.Domain/LINGYUN.Abp.FileManagement.Domain.csproj

@ -7,8 +7,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.BlobStoring.FileSystem" Version="4.1.2" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="4.1.2" />
<PackageReference Include="Volo.Abp.BlobStoring.FileSystem" Version="4.2.1" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

2
aspnet-core/modules/file-management/LINGYUN.Abp.FileManagement.HttpApi/LINGYUN.Abp.FileManagement.HttpApi.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="4.1.2" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="4.2.1" />
</ItemGroup>
<ItemGroup>

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

Loading…
Cancel
Save