Browse Source

chore: Nullable type enable

pull/1544/head
colin 5 days ago
parent
commit
0822480b6d
  1. 7
      aspnet-core/LINGYUN.MicroService.Aspire.slnx
  2. 7
      aspnet-core/LINGYUN.MicroService.SingleProject.slnx
  3. 9
      aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityClaimTypeDataSeeder.cs
  4. 8
      aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityUserRoleDataSeeder.cs
  5. 2
      aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService.EntityFrameworkCore/DataSeeds/NotificationDataSeeder.cs
  6. 1
      aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService/LINGYUN.Abp.MicroService.MessageService.csproj
  7. 2
      aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService/MessageServiceModule.cs
  8. 6
      aspnet-core/aspire/LINGYUN.Abp.MicroService.TaskService.EntityFrameworkCore/TaskServiceDataSeeder.cs
  9. 1
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WebhookService/LINGYUN.Abp.MicroService.WebhookService.csproj
  10. 2
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WebhookService/WebhookServiceModule.cs
  11. 2
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/LINGYUN.Abp.MicroService.WorkflowService.csproj
  12. 3
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.Configure.cs
  13. 2
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.cs
  14. 8
      aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/AuditLoggingIndexInitializer.cs
  15. 48
      aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogManager.cs
  16. 3
      aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogWriter.cs
  17. 20
      aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchEntityChangeStore.cs
  18. 48
      aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogManager.cs
  19. 2
      aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogWriter.cs
  20. 32
      aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/AuditLogManager.cs
  21. 14
      aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/EntityChangeStore.cs
  22. 32
      aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/SecurityLogManager.cs
  23. 6
      aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLogAction.cs
  24. 2
      aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLoggingQueue.cs
  25. 4
      aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultAuditLogManager.cs
  26. 4
      aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultEntityChangeStore.cs
  27. 4
      aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultSecurityLogManager.cs
  28. 4
      aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityChangeWithUsername.cs
  29. 4
      aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityPropertyChange.cs
  30. 2
      aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IAuditLogManager.cs
  31. 2
      aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IEntityChangeStore.cs
  32. 2
      aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/ISecurityLogManager.cs
  33. 4
      aspnet-core/framework/calendars/LINGYUN.Abp.Calendar/LINGYUN/Abp/Calendar/WorkdayCalendarInfo.cs
  34. 6
      aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AliyunBasicSessionCredentialsCacheItem.cs
  35. 4
      aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobProviderConfiguration.cs
  36. 4
      aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentCloudBlobProvider.cs
  37. 4
      aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/Volo/Abp/Sms/TencentSmsSenderExtensions.cs
  38. 4
      aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQCacheItem.cs
  39. 4
      aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQOptions.cs
  40. 23
      aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQOptionsManager.cs
  41. 8
      aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.SettingManagement/LINGYUN/Abp/Tencent/SettingManagement/TencentCloudSettingAppService.cs
  42. 124
      aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/AbstractTencentCloudClientFactory.cs
  43. 12
      aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/TencentCloudClientCacheItem.cs
  44. 2
      aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/TencentCloudClientFactory.cs
  45. 4
      aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.HttpOverrides/LINGYUN/Abp/AspNetCore/WebClientInfo/RequestForwardedHeaderWebClientInfoProvider.cs
  46. 30
      aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs
  47. 4
      aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Wrapper/LINGYUN/Abp/AspNetCore/Wrapper/AbpExceptionHandlingWrapperMiddleware.cs
  48. 2
      aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Wrapper/LINGYUN/Abp/AspNetCore/Wrapper/HttpResponseWrapperContext.cs
  49. 2
      aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProvider.cs
  50. 6
      aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProviderConfiguration.cs
  51. 6
      aspnet-core/framework/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/DefaultDbSchemaMigrator.cs
  52. 2
      aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPBootstrapper.cs
  53. 6
      aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPConsumerServiceSelector.cs
  54. 10
      aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPMessageExtensions.cs
  55. 12
      aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPSubscribeInvoker.cs
  56. 4
      aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCapSerializer.cs
  57. 8
      aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/CAPDistributedEventBus.cs
  58. 6
      aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/CustomDistributedEventSubscriber.cs
  59. 2
      aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/Internal/AwaitableInfo.cs
  60. 2
      aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/Internal/CoercedAwaitableInfo.cs
  61. 2
      aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/Internal/ObjectMethodExecutorFSharpSupport.cs
  62. 12
      aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/AbpEmailExceptionHandlingOptions.cs
  63. 6
      aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/AbpExceptionSubscriberBase.cs
  64. 6
      aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/AbpRedisRequiresLimitFeatureOptions.cs
  65. 8
      aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/RedisRequiresLimitFeatureChecker.cs
  66. 6
      aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/FeaturesLimitValidationInterceptor.cs
  67. 6
      aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN/Abp/Idempotent/IdempotentCheckContext.cs
  68. 11
      aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN/Abp/Idempotent/IdempotentChecker.cs
  69. 2
      aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN/Abp/Idempotent/IdempotentInterceptor.cs
  70. 6
      aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN/Abp/Idempotent/IdempotentKeyNormalizer.cs
  71. 6
      aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN/Abp/Idempotent/IdempotentKeyNormalizerContext.cs
  72. 28
      aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationHttpClient.cs
  73. 4
      aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationOptions.cs
  74. 2
      aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationResolveProvider.cs
  75. 26
      aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/AddressComponent.cs
  76. 4
      aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/AddressDetail.cs
  77. 2
      aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduGeocode.cs
  78. 20
      aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduPoi.cs
  79. 10
      aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduReGeocode.cs
  80. 4
      aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduRoad.cs
  81. 2
      aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/Content.cs
  82. 4
      aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/IpPoint.cs
  83. 10
      aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/PoiRegion.cs
  84. 2
      aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Response/BaiduIpGeocodeResponse.cs
  85. 12
      aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/AddressComponent.cs
  86. 16
      aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/AddressInfo.cs
  87. 8
      aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/Area.cs
  88. 4
      aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/FormattedAddress.cs
  89. 8
      aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/Poi.cs
  90. 2
      aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentGeocode.cs
  91. 2
      aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentIPGeocode.cs
  92. 2
      aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentReGeocode.cs
  93. 4
      aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Response/TencentLocationResponse.cs
  94. 18
      aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationHttpClient.cs
  95. 6
      aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationOptions.cs
  96. 2
      aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationResolveProvider.cs
  97. 4
      aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Utils/TencentSecretKeyCaculater.cs
  98. 2
      aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/GecodeLocation.cs
  99. 2
      aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/ILocationResolveProvider.cs
  100. 12
      aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/IPGecodeLocation.cs

7
aspnet-core/LINGYUN.MicroService.Aspire.slnx

@ -170,13 +170,6 @@
<Project Path="framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN.Abp.FeatureManagement.Client.csproj" />
<Project Path="framework/features/LINGYUN.Abp.Features.Client/LINGYUN.Abp.Features.Client.csproj" />
</Folder>
<Folder Name="/framework/hangfire/">
<Project Path="framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/LINGYUN.Abp.BackgroundJobs.Hangfire.csproj" />
<Project Path="framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN.Abp.BackgroundWorkers.Hangfire.csproj" />
<Project Path="framework/common/LINGYUN.Abp.Hangfire.Dashboard/LINGYUN.Abp.Hangfire.Dashboard.csproj" />
<Project Path="framework/common/LINGYUN.Abp.Hangfire.MySqlStorage/LINGYUN.Abp.Hangfire.Storage.MySql.csproj" />
<Project Path="framework/common/LINGYUN.Abp.Hangfire.Storage.SqlServer/LINGYUN.Abp.Hangfire.Storage.SqlServer.csproj" />
</Folder>
<Folder Name="/framework/localization/">
<Project Path="framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN.Abp.AspNetCore.Mvc.Localization.csproj" />
<Project Path="framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN.Abp.Localization.CultureMap.csproj" />

7
aspnet-core/LINGYUN.MicroService.SingleProject.slnx

@ -14,10 +14,6 @@
<Project Path="framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN.Abp.BlobStoring.Aliyun.csproj" />
<Project Path="framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN.Abp.Sms.Aliyun.csproj" />
</Folder>
<Folder Name="/framework/authentication/">
<Project Path="framework/authentication/LINGYUN.Abp.Authentication.QQ/LINGYUN.Abp.Authentication.QQ.csproj" />
<Project Path="framework/authentication/LINGYUN.Abp.Authentication.WeChat/LINGYUN.Abp.Authentication.WeChat.csproj" />
</Folder>
<Folder Name="/framework/authorization/">
<Project Path="framework/authorization/LINGYUN.Abp.Authorization.OrganizationUnits/LINGYUN.Abp.Authorization.OrganizationUnits.csproj" />
<Project Path="modules/identity/LINGYUN.Abp.Identity.OrganizaztionUnits/LINGYUN.Abp.Identity.OrganizaztionUnits.csproj" />
@ -155,7 +151,6 @@
<Project Path="framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN.Abp.AspNetCore.Mvc.Wrapper.csproj" />
</Folder>
<Folder Name="/hosts/">
<Project Path="services/LY.AIO.Applications.Single/LY.AIO.Applications.Single.csproj" />
<Project Path="services/LY.MicroService.Applications.Single/LY.MicroService.Applications.Single.csproj" />
</Folder>
<Folder Name="/migrations/" />
@ -347,8 +342,6 @@
<Project Path="modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN.Platform.EntityFrameworkCore.csproj" />
<Project Path="modules/platform/LINGYUN.Platform.HttpApi.Client/LINGYUN.Platform.HttpApi.Client.csproj" />
<Project Path="modules/platform/LINGYUN.Platform.HttpApi/LINGYUN.Platform.HttpApi.csproj" />
<Project Path="modules/platform/LINGYUN.Platform.Settings.VueVbenAdmin/LINGYUN.Platform.Settings.VueVbenAdmin.csproj" />
<Project Path="modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN.Platform.Theme.VueVbenAdmin.csproj" />
</Folder>
<Folder Name="/modules/saas/">
<Project Path="modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN.Abp.Saas.Application.Contracts.csproj" />

9
aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityClaimTypeDataSeeder.cs

@ -1,5 +1,6 @@
using JetBrains.Annotations;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using OpenIddict.Abstractions;
using System.Threading.Tasks;
using Volo.Abp.Data;
@ -23,6 +24,8 @@ public class IdentityClaimTypeDataSeeder : ITransientDependency
GuidGenerator = guidGenerator;
IdentityClaimTypeManager = identityClaimTypeManager;
IdentityClaimTypeRepository = identityClaimTypeRepository;
Logger = NullLogger<IdentityClaimTypeDataSeeder>.Instance;
}
public async virtual Task SeedAsync(DataSeedContext context)
@ -67,9 +70,9 @@ public class IdentityClaimTypeDataSeeder : ITransientDependency
[NotNull] string name,
bool required = false,
bool isStatic = false,
[CanBeNull] string regex = null,
[CanBeNull] string regexDescription = null,
[CanBeNull] string description = null,
[CanBeNull] string? regex = null,
[CanBeNull] string? regexDescription = null,
[CanBeNull] string? description = null,
IdentityClaimValueType valueType = IdentityClaimValueType.String)
{
if (!await IdentityClaimTypeRepository.AnyAsync(name))

8
aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityUserRoleDataSeeder.cs

@ -55,7 +55,7 @@ public class IdentityUserRoleDataSeeder : ITransientDependency
await IdentityOptions.SetAsync();
const string adminRoleName = "admin";
var adminUserName = context?[AdminUserNamePropertyName] as string ?? AdminUserNameDefaultValue;
var adminUserName = context[AdminUserNamePropertyName] as string ?? AdminUserNameDefaultValue;
Guid adminRoleId;
if (!await RoleManager.RoleExistsAsync(adminRoleName))
@ -74,7 +74,7 @@ public class IdentityUserRoleDataSeeder : ITransientDependency
else
{
var adminRole = await RoleManager.FindByNameAsync(adminRoleName);
adminRoleId = adminRole.Id;
adminRoleId = adminRole!.Id;
}
var adminUserId = GuidGenerator.Create();
@ -83,8 +83,8 @@ public class IdentityUserRoleDataSeeder : ITransientDependency
{
adminUserId = adminUserGuid;
}
var adminEmailAddress = context?[AdminEmailPropertyName] as string ?? AdminEmailDefaultValue;
var adminPassword = context?[AdminPasswordPropertyName] as string ?? AdminPasswordDefaultValue;
var adminEmailAddress = context[AdminEmailPropertyName] as string ?? AdminEmailDefaultValue;
var adminPassword = context[AdminPasswordPropertyName] as string ?? AdminPasswordDefaultValue;
var adminUser = await UserManager.FindByNameAsync(adminUserName);
if (adminUser == null)

2
aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService.EntityFrameworkCore/DataSeeds/NotificationDataSeeder.cs

@ -100,7 +100,7 @@ public class NotificationDataSeeder : ITransientDependency
new NotificationTemplate(
TenantNotificationNames.NewTenantRegistered,
formUser: adminEmailAddress,
data: new Dictionary<string, object>
data: new Dictionary<string, object?>
{
{ "name", adminUserName },
{ "email", adminEmailAddress },

1
aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService/LINGYUN.Abp.MicroService.MessageService.csproj

@ -78,7 +78,6 @@
<ProjectReference Include="..\..\modules\realtime-notifications\LINGYUN.Abp.Notifications.WxPusher\LINGYUN.Abp.Notifications.WxPusher.csproj" />
<ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.BackgroundTasks.Quartz\LINGYUN.Abp.BackgroundTasks.Quartz.csproj" />
<ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.BackgroundTasks.DistributedLocking\LINGYUN.Abp.BackgroundTasks.DistributedLocking.csproj" />
<ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.BackgroundTasks.ExceptionHandling\LINGYUN.Abp.BackgroundTasks.ExceptionHandling.csproj" />
<ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.Notifications.Jobs\LINGYUN.Abp.Notifications.Jobs.csproj" />
<ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.TaskManagement.EntityFrameworkCore\LINGYUN.Abp.TaskManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\localization-management\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore.csproj" />

2
aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService/MessageServiceModule.cs

@ -3,7 +3,6 @@ using LINGYUN.Abp.AspNetCore.Mvc.Wrapper;
using LINGYUN.Abp.AuditLogging.Elasticsearch;
using LINGYUN.Abp.Authorization.OrganizationUnits;
using LINGYUN.Abp.BackgroundTasks.DistributedLocking;
using LINGYUN.Abp.BackgroundTasks.ExceptionHandling;
using LINGYUN.Abp.BackgroundTasks.Quartz;
using LINGYUN.Abp.Claims.Mapping;
using LINGYUN.Abp.Data.DbMigrator;
@ -74,7 +73,6 @@ namespace LINGYUN.Abp.MicroService.MessageService;
typeof(AbpIdentityWeChatWorkModule),
typeof(AbpBackgroundTasksQuartzModule),
typeof(AbpBackgroundTasksDistributedLockingModule),
typeof(AbpBackgroundTasksExceptionHandlingModule),
typeof(TaskManagementEntityFrameworkCoreModule),
typeof(AbpMessageServiceEntityFrameworkCoreModule),
typeof(AbpNotificationsEntityFrameworkCoreModule),

6
aspnet-core/aspire/LINGYUN.Abp.MicroService.TaskService.EntityFrameworkCore/TaskServiceDataSeeder.cs

@ -90,7 +90,7 @@ public class TaskServiceDataSeeder : ITransientDependency
Source = JobSource.System,
LockTimeOut = Options.JobFetchLockTimeOut,
TenantId = tenantId,
Type = typeof(BackgroundPollingJob).AssemblyQualifiedName,
Type = typeof(BackgroundPollingJob).AssemblyQualifiedName!,
};
}
@ -111,7 +111,7 @@ public class TaskServiceDataSeeder : ITransientDependency
Priority = JobPriority.High,
Source = JobSource.System,
TenantId = tenantId,
Type = typeof(BackgroundCleaningJob).AssemblyQualifiedName,
Type = typeof(BackgroundCleaningJob).AssemblyQualifiedName!,
};
}
@ -133,7 +133,7 @@ public class TaskServiceDataSeeder : ITransientDependency
Priority = JobPriority.High,
Source = JobSource.System,
TenantId = tenantId,
Type = typeof(BackgroundCheckingJob).AssemblyQualifiedName,
Type = typeof(BackgroundCheckingJob).AssemblyQualifiedName!,
};
}
}

1
aspnet-core/aspire/LINGYUN.Abp.MicroService.WebhookService/LINGYUN.Abp.MicroService.WebhookService.csproj

@ -64,7 +64,6 @@
<ProjectReference Include="..\..\modules\webhooks\LINGYUN.Abp.WebhooksManagement.HttpApi\LINGYUN.Abp.WebhooksManagement.HttpApi.csproj" />
<ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.BackgroundTasks.Quartz\LINGYUN.Abp.BackgroundTasks.Quartz.csproj" />
<ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.BackgroundTasks.DistributedLocking\LINGYUN.Abp.BackgroundTasks.DistributedLocking.csproj" />
<ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.BackgroundTasks.ExceptionHandling\LINGYUN.Abp.BackgroundTasks.ExceptionHandling.csproj" />
</ItemGroup>
<ItemGroup>

2
aspnet-core/aspire/LINGYUN.Abp.MicroService.WebhookService/WebhookServiceModule.cs

@ -3,7 +3,6 @@ using LINGYUN.Abp.AspNetCore.Mvc.Wrapper;
using LINGYUN.Abp.AuditLogging.Elasticsearch;
using LINGYUN.Abp.Authorization.OrganizationUnits;
using LINGYUN.Abp.BackgroundTasks.DistributedLocking;
using LINGYUN.Abp.BackgroundTasks.ExceptionHandling;
using LINGYUN.Abp.BackgroundTasks.Quartz;
using LINGYUN.Abp.Claims.Mapping;
using LINGYUN.Abp.Dapr.Client.Wrapper;
@ -46,7 +45,6 @@ namespace LINGYUN.Abp.MicroService.WebhookService;
typeof(AbpWebhooksEventBusModule),
typeof(AbpBackgroundTasksQuartzModule),
typeof(AbpBackgroundTasksDistributedLockingModule),
typeof(AbpBackgroundTasksExceptionHandlingModule),
typeof(WebhookServiceMigrationsEntityFrameworkCoreModule),
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpAuthorizationOrganizationUnitsModule),

2
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/LINGYUN.Abp.MicroService.WorkflowService.csproj

@ -12,7 +12,6 @@
<PackageReference Include="DotNetCore.CAP.Dashboard" />
<PackageReference Include="DotNetCore.CAP.PostgreSql" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" />
<PackageReference Include="Elsa.Activities.Email" />
<PackageReference Include="Elsa.Activities.Http" />
<PackageReference Include="Elsa.Activities.UserTask" />
<PackageReference Include="Elsa.Activities.Temporal.Quartz" />
@ -74,7 +73,6 @@
<ProjectReference Include="..\..\modules\platform\LINGYUN.Abp.Sms.Platform\LINGYUN.Abp.Sms.Platform.csproj" />
<ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.BackgroundTasks.Quartz\LINGYUN.Abp.BackgroundTasks.Quartz.csproj" />
<ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.BackgroundTasks.DistributedLocking\LINGYUN.Abp.BackgroundTasks.DistributedLocking.csproj" />
<ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.BackgroundTasks.ExceptionHandling\LINGYUN.Abp.BackgroundTasks.ExceptionHandling.csproj" />
<ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.Quartz.PostgresSqlInstaller\LINGYUN.Abp.Quartz.PostgresSqlInstaller.csproj" />
<ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.TaskManagement.EntityFrameworkCore\LINGYUN.Abp.TaskManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\text-templating\LINGYUN.Abp.TextTemplating.EntityFrameworkCore\LINGYUN.Abp.TextTemplating.EntityFrameworkCore.csproj" />

3
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.Configure.cs

@ -3,7 +3,6 @@ using Elsa;
using Elsa.Options;
using Elsa.Rebus.RabbitMq;
using LINGYUN.Abp.BackgroundTasks;
using LINGYUN.Abp.BlobStoring.BlobManagement;
using LINGYUN.Abp.Localization.CultureMap;
using LINGYUN.Abp.LocalizationManagement;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
@ -45,7 +44,6 @@ using Volo.Abp.Threading;
using Volo.Abp.Timing;
using Volo.Abp.VirtualFileSystem;
using ConsoleStartup = Elsa.Activities.Console.Startup;
using EmailStartup = Elsa.Activities.Email.Startup;
using HttpStartup = Elsa.Activities.Http.Startup;
using JavaScriptStartup = Elsa.Scripting.JavaScript.Startup;
using TemporalQuartzStartup = Elsa.Activities.Temporal.Quartz.Startup;
@ -150,7 +148,6 @@ public partial class WorkflowServiceModule
typeof(HttpStartup),
typeof(UserTaskStartup),
typeof(TemporalQuartzStartup),
typeof(EmailStartup),
typeof(JavaScriptStartup),
typeof(WebhooksStartup),
};

2
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.cs

@ -3,7 +3,6 @@ using LINGYUN.Abp.AspNetCore.Mvc.Wrapper;
using LINGYUN.Abp.AuditLogging.Elasticsearch;
using LINGYUN.Abp.Authorization.OrganizationUnits;
using LINGYUN.Abp.BackgroundTasks.DistributedLocking;
using LINGYUN.Abp.BackgroundTasks.ExceptionHandling;
using LINGYUN.Abp.BackgroundTasks.Quartz;
using LINGYUN.Abp.BlobStoring.BlobManagement;
using LINGYUN.Abp.Claims.Mapping;
@ -61,7 +60,6 @@ namespace LINGYUN.Abp.MicroService.WorkflowService;
typeof(AbpAspNetCoreMultiTenancyModule),
typeof(AbpBackgroundTasksQuartzModule),
typeof(AbpBackgroundTasksDistributedLockingModule),
typeof(AbpBackgroundTasksExceptionHandlingModule),
typeof(AbpQuartzPostgresSqlInstallerModule),
typeof(TaskManagementEntityFrameworkCoreModule),
typeof(AbpFeatureManagementEntityFrameworkCoreModule),

8
aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/AuditLoggingIndexInitializer.cs

@ -148,13 +148,13 @@ public class AuditLoggingIndexInitializer : IAuditLoggingIndexInitializer, ISing
if (!putTemplateResponse.IsValidResponse)
{
var errorBuilder = new StringBuilder();
if (putTemplateResponse.TryGetOriginalException(out var ex))
if (putTemplateResponse.TryGetOriginalException(out var ex) && ex != null)
{
errorBuilder.AppendLine(ex.Message);
Logger.LogWarning(ex, "Failed to initialize index and audit log may not be retrieved.");
return;
}
else if (putTemplateResponse.TryGetElasticsearchServerError(out var error))
else if (putTemplateResponse.TryGetElasticsearchServerError(out var error) && error != null)
{
errorBuilder.AppendLine(error.ToString());
}
@ -220,13 +220,13 @@ public class AuditLoggingIndexInitializer : IAuditLoggingIndexInitializer, ISing
if (!putTemplateResponse.IsValidResponse)
{
var errorBuilder = new StringBuilder();
if (putTemplateResponse.TryGetOriginalException(out var ex))
if (putTemplateResponse.TryGetOriginalException(out var ex) && ex != null)
{
errorBuilder.AppendLine(ex.Message);
Logger.LogWarning(ex, "Failed to initialize index and security log may not be retrieved.");
return;
}
else if (putTemplateResponse.TryGetElasticsearchServerError(out var error))
else if (putTemplateResponse.TryGetElasticsearchServerError(out var error) && error != null)
{
errorBuilder.AppendLine(error.ToString());
}

48
aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogManager.cs

@ -43,14 +43,14 @@ public class ElasticsearchAuditLogManager : IAuditLogManager, ITransientDependen
public async virtual Task<long> GetCountAsync(
DateTime? startTime = null,
DateTime? endTime = null,
string httpMethod = null,
string url = null,
string? httpMethod = null,
string? url = null,
Guid? userId = null,
string userName = null,
string applicationName = null,
string correlationId = null,
string clientId = null,
string clientIpAddress = null,
string? userName = null,
string? applicationName = null,
string? correlationId = null,
string? clientId = null,
string? clientIpAddress = null,
int? maxExecutionDuration = null,
int? minExecutionDuration = null,
bool? hasException = null,
@ -87,19 +87,19 @@ public class ElasticsearchAuditLogManager : IAuditLogManager, ITransientDependen
}
public async virtual Task<List<AuditLog>> GetListAsync(
string sorting = null,
string? sorting = null,
int maxResultCount = 50,
int skipCount = 0,
DateTime? startTime = null,
DateTime? endTime = null,
string httpMethod = null,
string url = null,
string? httpMethod = null,
string? url = null,
Guid? userId = null,
string userName = null,
string applicationName = null,
string correlationId = null,
string clientId = null,
string clientIpAddress = null,
string? userName = null,
string? applicationName = null,
string? correlationId = null,
string? clientId = null,
string? clientIpAddress = null,
int? maxExecutionDuration = null,
int? minExecutionDuration = null,
bool? hasException = null,
@ -159,7 +159,7 @@ public class ElasticsearchAuditLogManager : IAuditLogManager, ITransientDependen
return searchResponse.Documents.ToList();
}
public async virtual Task<AuditLog> GetAsync(
public async virtual Task<AuditLog?> GetAsync(
Guid id,
bool includeDetails = false,
CancellationToken cancellationToken = default)
@ -212,14 +212,14 @@ public class ElasticsearchAuditLogManager : IAuditLogManager, ITransientDependen
protected virtual List<Query> BuildQueryDescriptor(
DateTime? startTime = null,
DateTime? endTime = null,
string httpMethod = null,
string url = null,
string? httpMethod = null,
string? url = null,
Guid? userId = null,
string userName = null,
string applicationName = null,
string correlationId = null,
string clientId = null,
string clientIpAddress = null,
string? userName = null,
string? applicationName = null,
string? correlationId = null,
string? clientId = null,
string? clientIpAddress = null,
int? maxExecutionDuration = null,
int? minExecutionDuration = null,
bool? hasException = null,
@ -346,7 +346,7 @@ public class ElasticsearchAuditLogManager : IAuditLogManager, ITransientDependen
};
protected virtual string GetField(string field)
{
if (_fieldMaps.TryGetValue(field, out string mapField))
if (_fieldMaps.TryGetValue(field, out var mapField))
{
return _elasticsearchOptions.FieldCamelCase ? mapField.ToCamelCase() : mapField.ToPascalCase();
}

3
aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogWriter.cs

@ -1,5 +1,6 @@
using Elastic.Clients.Elasticsearch;
using Elastic.Clients.Elasticsearch.Core.Bulk;
using Elastic.Transport.Products.Elasticsearch;
using LINGYUN.Abp.Elasticsearch;
using Microsoft.Extensions.Logging;
using System;
@ -46,7 +47,7 @@ public class ElasticsearchAuditLogWriter : IAuditLogWriter, ITransientDependency
if (!response.IsValidResponse)
{
_logger.LogWarning("Could not save the audit log object: " + Environment.NewLine + auditLog.ToString());
if (response.TryGetOriginalException(out var ex))
if (response.TryGetOriginalException(out var ex) && ex != null)
{
_logger.LogWarning(ex, ex.Message);
}

20
aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchEntityChangeStore.cs

@ -39,7 +39,7 @@ public class ElasticsearchEntityChangeStore : IEntityChangeStore, ITransientDepe
Logger = NullLogger<ElasticsearchEntityChangeStore>.Instance;
}
public async virtual Task<EntityChange> GetAsync(
public async virtual Task<EntityChange?> GetAsync(
Guid entityChangeId,
CancellationToken cancellationToken = default)
{
@ -89,8 +89,8 @@ public class ElasticsearchEntityChangeStore : IEntityChangeStore, ITransientDepe
DateTime? startTime = null,
DateTime? endTime = null,
EntityChangeType? changeType = null,
string entityId = null,
string entityTypeFullName = null,
string? entityId = null,
string? entityTypeFullName = null,
CancellationToken cancellationToken = default)
{
var client = _clientFactory.Create();
@ -127,15 +127,15 @@ public class ElasticsearchEntityChangeStore : IEntityChangeStore, ITransientDepe
}
public async virtual Task<List<EntityChange>> GetListAsync(
string sorting = null,
string? sorting = null,
int maxResultCount = 50,
int skipCount = 0,
Guid? auditLogId = null,
DateTime? startTime = null,
DateTime? endTime = null,
EntityChangeType? changeType = null,
string entityId = null,
string entityTypeFullName = null,
string? entityId = null,
string? entityTypeFullName = null,
bool includeDetails = false,
CancellationToken cancellationToken = default)
{
@ -204,7 +204,7 @@ public class ElasticsearchEntityChangeStore : IEntityChangeStore, ITransientDepe
.ToList();
}
public async virtual Task<EntityChangeWithUsername> GetWithUsernameAsync(
public async virtual Task<EntityChangeWithUsername?> GetWithUsernameAsync(
Guid entityChangeId,
CancellationToken cancellationToken = default)
{
@ -288,7 +288,7 @@ public class ElasticsearchEntityChangeStore : IEntityChangeStore, ITransientDepe
foreach (var entityChanges in entityChangesList)
{
foreach (var entityChange in entityChanges.Where(e => e.EntityId.Equals(entityId) && e.EntityTypeFullName.Equals(entityTypeFullName)))
foreach (var entityChange in entityChanges.Where(e => string.Equals(e.EntityId, entityId) && string.Equals(e.EntityTypeFullName, entityTypeFullName)))
{
result.Add(
new EntityChangeWithUsername
@ -309,8 +309,8 @@ public class ElasticsearchEntityChangeStore : IEntityChangeStore, ITransientDepe
DateTime? startTime = null,
DateTime? endTime = null,
EntityChangeType? changeType = null,
string entityId = null,
string entityTypeFullName = null,
string? entityId = null,
string? entityTypeFullName = null,
Guid? entityChangeId = null)
{
var queries = new List<Query>();

48
aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogManager.cs

@ -38,7 +38,7 @@ public class ElasticsearchSecurityLogManager : ISecurityLogManager, ITransientDe
Logger = NullLogger<ElasticsearchSecurityLogManager>.Instance;
}
public async virtual Task<SecurityLog> GetAsync(
public async virtual Task<SecurityLog?> GetAsync(
Guid id,
bool includeDetails = false,
CancellationToken cancellationToken = default)
@ -80,19 +80,19 @@ public class ElasticsearchSecurityLogManager : ISecurityLogManager, ITransientDe
}
public async virtual Task<List<SecurityLog>> GetListAsync(
string sorting = null,
string? sorting = null,
int maxResultCount = 50,
int skipCount = 0,
DateTime? startTime = null,
DateTime? endTime = null,
string applicationName = null,
string identity = null,
string action = null,
string? applicationName = null,
string? identity = null,
string? action = null,
Guid? userId = null,
string userName = null,
string clientId = null,
string clientIpAddress = null,
string correlationId = null,
string? userName = null,
string? clientId = null,
string? clientIpAddress = null,
string? correlationId = null,
bool includeDetails = false,
CancellationToken cancellationToken = default)
{
@ -134,14 +134,14 @@ public class ElasticsearchSecurityLogManager : ISecurityLogManager, ITransientDe
public async virtual Task<long> GetCountAsync(
DateTime? startTime = null,
DateTime? endTime = null,
string applicationName = null,
string identity = null,
string action = null,
string? applicationName = null,
string? identity = null,
string? action = null,
Guid? userId = null,
string userName = null,
string clientId = null,
string clientIpAddress = null,
string correlationId = null,
string? userName = null,
string? clientId = null,
string? clientIpAddress = null,
string? correlationId = null,
CancellationToken cancellationToken = default)
{
var client = _clientFactory.Create();
@ -172,14 +172,14 @@ public class ElasticsearchSecurityLogManager : ISecurityLogManager, ITransientDe
protected virtual List<Query> BuildQueryDescriptor(
DateTime? startTime = null,
DateTime? endTime = null,
string applicationName = null,
string identity = null,
string action = null,
string? applicationName = null,
string? identity = null,
string? action = null,
Guid? userId = null,
string userName = null,
string clientId = null,
string clientIpAddress = null,
string correlationId = null)
string? userName = null,
string? clientId = null,
string? clientIpAddress = null,
string? correlationId = null)
{
var queries = new List<Query>();
@ -256,7 +256,7 @@ public class ElasticsearchSecurityLogManager : ISecurityLogManager, ITransientDe
};
protected virtual string GetField(string field)
{
if (_fieldMaps.TryGetValue(field, out string mapField))
if (_fieldMaps.TryGetValue(field, out var mapField))
{
return _elasticsearchOptions.FieldCamelCase ? mapField.ToCamelCase() : mapField.ToPascalCase();
}

2
aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogWriter.cs

@ -51,7 +51,7 @@ public class ElasticsearchSecurityLogWriter : ISecurityLogWriter, ITransientDepe
if (!response.IsValidResponse)
{
_logger.LogWarning("Could not save the security log object: " + Environment.NewLine + securityLog.ToString());
if (response.TryGetOriginalException(out var ex))
if (response.TryGetOriginalException(out var ex) && ex != null)
{
_logger.LogWarning(ex, ex.Message);
}

32
aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/AuditLogManager.cs

@ -31,14 +31,14 @@ public class AuditLogManager : IAuditLogManager, ITransientDependency
public async virtual Task<long> GetCountAsync(
DateTime? startTime = null,
DateTime? endTime = null,
string httpMethod = null,
string url = null,
string? httpMethod = null,
string? url = null,
Guid? userId = null,
string userName = null,
string applicationName = null,
string correlationId = null,
string clientId = null,
string clientIpAddress = null,
string? userName = null,
string? applicationName = null,
string? correlationId = null,
string? clientId = null,
string? clientIpAddress = null,
int? maxExecutionDuration = null,
int? minExecutionDuration = null,
bool? hasException = null,
@ -64,19 +64,19 @@ public class AuditLogManager : IAuditLogManager, ITransientDependency
}
public async virtual Task<List<AuditLog>> GetListAsync(
string sorting = null,
string? sorting = null,
int maxResultCount = 50,
int skipCount = 0,
DateTime? startTime = null,
DateTime? endTime = null,
string httpMethod = null,
string url = null,
string? httpMethod = null,
string? url = null,
Guid? userId = null,
string userName = null,
string applicationName = null,
string correlationId = null,
string clientId = null,
string clientIpAddress = null,
string? userName = null,
string? applicationName = null,
string? correlationId = null,
string? clientId = null,
string? clientIpAddress = null,
int? maxExecutionDuration = null,
int? minExecutionDuration = null,
bool? hasException = null,
@ -108,7 +108,7 @@ public class AuditLogManager : IAuditLogManager, ITransientDependency
return ObjectMapper.Map<List<Volo.Abp.AuditLogging.AuditLog>, List<AuditLog>>(auditLogs);
}
public async virtual Task<AuditLog> GetAsync(
public async virtual Task<AuditLog?> GetAsync(
Guid id,
bool includeDetails = false,
CancellationToken cancellationToken = default)

14
aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/EntityChangeStore.cs

@ -30,7 +30,7 @@ public class EntityChangeStore : IEntityChangeStore, ITransientDependency
}
public async virtual Task<EntityChange> GetAsync(
public async virtual Task<EntityChange?> GetAsync(
Guid entityChangeId,
CancellationToken cancellationToken = default)
{
@ -46,8 +46,8 @@ public class EntityChangeStore : IEntityChangeStore, ITransientDependency
DateTime? startTime = null,
DateTime? endTime = null,
EntityChangeType? changeType = null,
string entityId = null,
string entityTypeFullName = null,
string? entityId = null,
string? entityTypeFullName = null,
CancellationToken cancellationToken = default)
{
return await AuditLogRepository.GetEntityChangeCountAsync(
@ -61,15 +61,15 @@ public class EntityChangeStore : IEntityChangeStore, ITransientDependency
}
public async virtual Task<List<EntityChange>> GetListAsync(
string sorting = null,
string? sorting = null,
int maxResultCount = 50,
int skipCount = 0,
Guid? auditLogId = null,
DateTime? startTime = null,
DateTime? endTime = null,
EntityChangeType? changeType = null,
string entityId = null,
string entityTypeFullName = null,
string? entityId = null,
string? entityTypeFullName = null,
bool includeDetails = false,
CancellationToken cancellationToken = default)
{
@ -89,7 +89,7 @@ public class EntityChangeStore : IEntityChangeStore, ITransientDependency
return ObjectMapper.Map<List<Volo.Abp.AuditLogging.EntityChange>, List<EntityChange>>(entityChanges);
}
public async virtual Task<EntityChangeWithUsername> GetWithUsernameAsync(
public async virtual Task<EntityChangeWithUsername?> GetWithUsernameAsync(
Guid entityChangeId,
CancellationToken cancellationToken = default)
{

32
aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/SecurityLogManager.cs

@ -36,7 +36,7 @@ public class SecurityLogManager : ISecurityLogManager, ITransientDependency
}
}
public async virtual Task<SecurityLog> GetAsync(
public async virtual Task<SecurityLog?> GetAsync(
Guid id,
bool includeDetails = false,
CancellationToken cancellationToken = default)
@ -56,19 +56,19 @@ public class SecurityLogManager : ISecurityLogManager, ITransientDependency
}
public async virtual Task<List<SecurityLog>> GetListAsync(
string sorting = null,
string? sorting = null,
int maxResultCount = 50,
int skipCount = 0,
DateTime? startTime = null,
DateTime? endTime = null,
string applicationName = null,
string identity = null,
string action = null,
string? applicationName = null,
string? identity = null,
string? action = null,
Guid? userId = null,
string userName = null,
string clientId = null,
string clientIpAddress = null,
string correlationId = null,
string? userName = null,
string? clientId = null,
string? clientIpAddress = null,
string? correlationId = null,
bool includeDetails = false,
CancellationToken cancellationToken = default)
{
@ -96,14 +96,14 @@ public class SecurityLogManager : ISecurityLogManager, ITransientDependency
public async virtual Task<long> GetCountAsync(
DateTime? startTime = null,
DateTime? endTime = null,
string applicationName = null,
string identity = null,
string action = null,
string? applicationName = null,
string? identity = null,
string? action = null,
Guid? userId = null,
string userName = null,
string clientId = null,
string clientIpAddress = null,
string correlationId = null,
string? userName = null,
string? clientId = null,
string? clientIpAddress = null,
string? correlationId = null,
CancellationToken cancellationToken = default)
{
return await IdentitySecurityLogRepository.GetCountAsync(

6
aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLogAction.cs

@ -13,11 +13,11 @@ public class AuditLogAction : IHasExtraProperties
public Guid AuditLogId { get; set; }
public string ServiceName { get; set; }
public string ServiceName { get; set; } = default!;
public string MethodName { get; set; }
public string MethodName { get; set; } = default!;
public string Parameters { get; set; }
public string Parameters { get; set; } = default!;
public DateTime ExecutionTime { get; set; }

2
aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLoggingQueue.cs

@ -14,7 +14,7 @@ public abstract class AuditLoggingQueue<TLog>
private readonly int _batchSize;
private readonly int _maxConcurrency;
private volatile Task _consumerTask;
private volatile Task? _consumerTask;
private readonly SemaphoreSlim _flushSemaphore;
private readonly CancellationTokenSource _cts = new CancellationTokenSource();
protected AuditLoggingQueue(

4
aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultAuditLogManager.cs

@ -76,7 +76,7 @@ public class DefaultAuditLogManager : IAuditLogManager, ISingletonDependency
return Task.FromResult("");
}
public virtual Task<AuditLog> GetAsync(
public virtual Task<AuditLog?> GetAsync(
Guid id,
bool includeDetails = false,
CancellationToken cancellationToken = default)
@ -84,7 +84,7 @@ public class DefaultAuditLogManager : IAuditLogManager, ISingletonDependency
Logger.LogDebug("No audit log manager is available!");
AuditLog? auditLog = null;
return Task.FromResult(auditLog!);
return Task.FromResult(auditLog);
}
public virtual Task DeleteAsync(Guid id, CancellationToken cancellationToken = default)

4
aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultEntityChangeStore.cs

@ -44,10 +44,10 @@ public class DefaultEntityChangeStore : IEntityChangeStore, ISingletonDependency
return Task.FromResult(new List<EntityChange>());
}
public Task<EntityChangeWithUsername> GetWithUsernameAsync(Guid entityChangeId, CancellationToken cancellationToken = default)
public Task<EntityChangeWithUsername?> GetWithUsernameAsync(Guid entityChangeId, CancellationToken cancellationToken = default)
{
EntityChangeWithUsername? entityChange = null;
return Task.FromResult(entityChange!);
return Task.FromResult(entityChange);
}
public Task<List<EntityChangeWithUsername>> GetWithUsernameAsync(string entityId, string entityTypeFullName, CancellationToken cancellationToken = default)

4
aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultSecurityLogManager.cs

@ -67,7 +67,7 @@ public class DefaultSecurityLogManager : ISecurityLogManager, ISingletonDependen
return Task.CompletedTask;
}
public virtual Task<SecurityLog> GetAsync(
public virtual Task<SecurityLog?> GetAsync(
Guid id,
bool includeDetails = false,
CancellationToken cancellationToken = default)
@ -75,7 +75,7 @@ public class DefaultSecurityLogManager : ISecurityLogManager, ISingletonDependen
Logger.LogDebug("No security log manager is available!");
SecurityLog? securityLog = null;
return Task.FromResult(securityLog!);
return Task.FromResult(securityLog);
}
public virtual Task DeleteAsync(Guid id, CancellationToken cancellationToken = default)

4
aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityChangeWithUsername.cs

@ -2,7 +2,7 @@
public class EntityChangeWithUsername
{
public EntityChange EntityChange { get; set; }
public EntityChange EntityChange { get; set; } = default!;
public string UserName { get; set; }
public string? UserName { get; set; }
}

4
aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityPropertyChange.cs

@ -17,9 +17,9 @@ public class EntityPropertyChange
public string? OriginalValue { get; set; }
public string PropertyName { get; set; }
public string PropertyName { get; set; } = default!;
public string PropertyTypeFullName { get; set; }
public string PropertyTypeFullName { get; set; } = default!;
public EntityPropertyChange()
{

2
aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IAuditLogManager.cs

@ -8,7 +8,7 @@ namespace LINGYUN.Abp.AuditLogging;
public interface IAuditLogManager
{
Task<AuditLog> GetAsync(
Task<AuditLog?> GetAsync(
Guid id,
bool includeDetails = false,
CancellationToken cancellationToken = default);

2
aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IEntityChangeStore.cs

@ -34,7 +34,7 @@ public interface IEntityChangeStore
bool includeDetails = false,
CancellationToken cancellationToken = default);
Task<EntityChangeWithUsername> GetWithUsernameAsync(
Task<EntityChangeWithUsername?> GetWithUsernameAsync(
Guid entityChangeId,
CancellationToken cancellationToken = default);

2
aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/ISecurityLogManager.cs

@ -7,7 +7,7 @@ namespace LINGYUN.Abp.AuditLogging;
public interface ISecurityLogManager
{
Task<SecurityLog> GetAsync(
Task<SecurityLog?> GetAsync(
Guid id,
bool includeDetails = false,
CancellationToken cancellationToken = default);

4
aspnet-core/framework/calendars/LINGYUN.Abp.Calendar/LINGYUN/Abp/Calendar/WorkdayCalendarInfo.cs

@ -10,7 +10,7 @@ public class WorkdayCalendarInfo
/// <summary>
/// 日历名称
/// </summary>
public string Name { get; set; }
public string Name { get; set; } = default!;
/// <summary>
/// 默认日历
/// </summary>
@ -18,7 +18,7 @@ public class WorkdayCalendarInfo
/// <summary>
/// 工作日范围
/// </summary>
public DayOfWeek[] Workdays { get; set; }
public DayOfWeek[] Workdays { get; set; } = default!;
/// <summary>
/// 工作时间范围
/// </summary>

6
aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AliyunBasicSessionCredentialsCacheItem.cs

@ -5,9 +5,9 @@ namespace LINGYUN.Abp.Aliyun;
[Serializable]
public class AliyunBasicSessionCredentialsCacheItem
{
public string AccessKeyId { get; set; }
public string AccessKeySecret { get; set; }
public string SecurityToken { get; set; }
public string AccessKeyId { get; set; } = default!;
public string AccessKeySecret { get; set; } = default!;
public string SecurityToken { get; set; } = default!;
public DateTime? Expiration { get; set; }
public AliyunBasicSessionCredentialsCacheItem()

4
aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobProviderConfiguration.cs

@ -16,7 +16,7 @@ public class TencentBlobProviderConfiguration
/// <summary>
/// 区域
/// </summary>
public string Region {
public string? Region {
get => _containerConfiguration.GetConfiguration<string>(TencentBlobProviderConfigurationNames.Region);
set => _containerConfiguration.SetConfiguration(TencentBlobProviderConfigurationNames.Region, value);
}
@ -39,7 +39,7 @@ public class TencentBlobProviderConfiguration
/// <summary>
/// 创建命名空间时防盗链列表
/// </summary>
public List<string> CreateBucketReferer {
public List<string>? CreateBucketReferer {
get => _containerConfiguration.GetConfigurationOrDefault(TencentBlobProviderConfigurationNames.CreateBucketReferer, new List<string>());
set {
if (value == null)

4
aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentCloudBlobProvider.cs

@ -58,7 +58,7 @@ public class TencentCloudBlobProvider : BlobProviderBase, ITransientDependency
return await BlobExistsAsync(ossClient, args, blobName);
}
public override async Task<Stream> GetOrNullAsync(BlobProviderGetArgs args)
public override async Task<Stream?> GetOrNullAsync(BlobProviderGetArgs args)
{
var ossClient = await GetOssClientAsync(args);
var blobName = TencentBlobNameCalculator.Calculate(args);
@ -129,7 +129,7 @@ public class TencentCloudBlobProvider : BlobProviderBase, ITransientDependency
return ossClient;
}
protected async virtual Task CreateBucketIfNotExists(CosXml cos, BlobProviderArgs args, IList<string> refererList = null)
protected async virtual Task CreateBucketIfNotExists(CosXml cos, BlobProviderArgs args, IList<string>? refererList = null)
{
if (!await BucketExistsAsync(cos, args))
{

4
aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/Volo/Abp/Sms/TencentSmsSenderExtensions.cs

@ -18,7 +18,7 @@ public static class TencentSmsSenderExtensions
this ISmsSender smsSender,
string templateCode,
string phoneNumber,
IDictionary<string, object> templateParams = null)
IDictionary<string, object>? templateParams = null)
{
var smsMessage = new SmsMessage(phoneNumber, nameof(TencentCloudSmsSender));
smsMessage.Properties.Add("TemplateCode", templateCode);
@ -43,7 +43,7 @@ public static class TencentSmsSenderExtensions
string signName,
string templateCode,
string phoneNumber,
IDictionary<string, object> templateParams = null)
IDictionary<string, object>? templateParams = null)
{
var smsMessage = new SmsMessage(phoneNumber, nameof(TencentCloudSmsSender));
smsMessage.Properties.Add("SignName", signName);

4
aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQCacheItem.cs

@ -5,8 +5,8 @@ namespace LINGYUN.Abp.Tencent.QQ;
public class AbpTencentQQCacheItem
{
public const string CacheKeyFormat = "pn:tenant-cloud,n:qq";
public string AppId { get; set; }
public string AppKey { get; set; }
public string AppId { get; set; } = default!;
public string AppKey { get; set; } = default!;
public bool IsMobile { get; set; }
public AbpTencentQQCacheItem()
{

4
aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQOptions.cs

@ -8,14 +8,14 @@ public class AbpTencentQQOptions
/// <remarks>
/// see: https://wiki.connect.qq.com/%e5%87%86%e5%a4%87%e5%b7%a5%e4%bd%9c_oauth2-0
/// </remarks>
public string AppId { get; set; }
public string AppId { get; set; } = default!;
/// <summary>
/// 在QQ互联上申请的AppKey
/// </summary>
/// <remarks>
/// see: https://wiki.connect.qq.com/%e5%87%86%e5%a4%87%e5%b7%a5%e4%bd%9c_oauth2-0
/// </remarks>
public string AppKey { get; set; }
public string AppKey { get; set; } = default!;
/// <summary>
/// 是否移动端样式
/// </summary>

23
aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQOptionsManager.cs

@ -3,6 +3,7 @@ using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Options;
using System;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Options;
using Volo.Abp.Settings;
@ -34,20 +35,20 @@ public class AbpTencentQQOptionsManager : AbpDynamicOptionsManager<AbpTencentQQO
protected async virtual Task<AbpTencentQQCacheItem> GetCacheItemAsync()
{
var cacheKey = AbpTencentQQCacheItem.CalculateCacheKey();
var cacheItem = TencentCache.Get<AbpTencentQQCacheItem>(cacheKey);
if (cacheItem == null)
{
var appId = await SettingProvider.GetOrNullAsync(TencentQQSettingNames.QQConnect.AppId);
var appKey = await SettingProvider.GetOrNullAsync(TencentQQSettingNames.QQConnect.AppKey);
var isMobile = await SettingProvider.IsTrueAsync(TencentQQSettingNames.QQConnect.IsMobile);
var cacheItem = await TencentCache.GetOrCreateAsync(
cacheKey,
async (cache) =>
{
var appId = await SettingProvider.GetOrNullAsync(TencentQQSettingNames.QQConnect.AppId);
var appKey = await SettingProvider.GetOrNullAsync(TencentQQSettingNames.QQConnect.AppKey);
var isMobile = await SettingProvider.IsTrueAsync(TencentQQSettingNames.QQConnect.IsMobile);
Check.NotNullOrWhiteSpace(appId, nameof(appId));
Check.NotNullOrWhiteSpace(appKey, nameof(appKey));
cache.SetAbsoluteExpiration(TimeSpan.FromMinutes(2d));
return new AbpTencentQQCacheItem(appId, appKey, isMobile);
});
cacheItem = new AbpTencentQQCacheItem(appId, appKey, isMobile);
TencentCache.Set(cacheKey, cacheItem, TimeSpan.FromMinutes(2d));
}
return cacheItem;
}
}

8
aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.SettingManagement/LINGYUN/Abp/Tencent/SettingManagement/TencentCloudSettingAppService.cs

@ -42,7 +42,7 @@ public class TencentCloudSettingAppService : ApplicationService, ITencentCloudSe
return await GetAllForProviderAsync(GlobalSettingValueProvider.ProviderName, null);
}
protected async virtual Task<SettingGroupResult> GetAllForProviderAsync(string providerName, string providerKey)
protected async virtual Task<SettingGroupResult> GetAllForProviderAsync(string providerName, string? providerKey = null)
{
var settingGroups = new SettingGroupResult();
@ -61,7 +61,7 @@ public class TencentCloudSettingAppService : ApplicationService, ITencentCloudSe
await SettingManager.GetOrNullAsync(TencentCloudSettingNames.EndPoint, providerName, providerKey),
ValueType.Option,
providerName)
.AddOptions(GetAvailableRegionOptions());
?.AddOptions(GetAvailableRegionOptions());
basicSetting.AddDetail(
await SettingDefinitionManager.GetAsync(TencentCloudSettingNames.SecretId),
StringLocalizerFactory,
@ -94,8 +94,8 @@ public class TencentCloudSettingAppService : ApplicationService, ITencentCloudSe
await SettingManager.GetOrNullAsync(TencentCloudSettingNames.Connection.HttpMethod, providerName, providerKey),
ValueType.Option,
providerName)
.AddOption("POST", "POST")
.AddOption("GET", "GET");
?.AddOption("POST", "POST")
?.AddOption("GET", "GET");
connectionSetting.AddDetail(
await SettingDefinitionManager.GetAsync(TencentCloudSettingNames.Connection.Timeout),
StringLocalizerFactory,

124
aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/AbstractTencentCloudClientFactory.cs

@ -31,37 +31,39 @@ public abstract class AbstractTencentCloudClientFactory<TClient>
protected async virtual Task<TencentCloudClientCacheItem> GetClientCacheItemAsync()
{
return await ClientCache.GetOrCreateAsync(
TencentCloudClientCacheItem.CalculateCacheKey("client-options"),
async (cache) =>
var cacheKey = TencentCloudClientCacheItem.CalculateCacheKey("client-options");
var cacheItem = ClientCache.Get<TencentCloudClientCacheItem>(cacheKey);
if (cacheItem == null)
{
var secretId = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.SecretId);
var secretKey = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.SecretKey);
var endpoint = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.EndPoint);
var durationSecond = await SettingProvider.GetAsync(TencentCloudSettingNames.DurationSecond, 3600);
Check.NotNullOrWhiteSpace(secretId, TencentCloudSettingNames.SecretId);
Check.NotNullOrWhiteSpace(secretKey, TencentCloudSettingNames.SecretKey);
var method = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.Connection.HttpMethod);
var webProxy = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.Connection.WebProxy);
var timeout = await SettingProvider.GetAsync(TencentCloudSettingNames.Connection.Timeout, 60);
cacheItem = new TencentCloudClientCacheItem
{
var secretId = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.SecretId);
var secretKey = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.SecretKey);
var endpoint = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.EndPoint);
var durationSecond = await SettingProvider.GetAsync(TencentCloudSettingNames.DurationSecond, 3600);
Check.NotNullOrWhiteSpace(secretId, TencentCloudSettingNames.SecretId);
Check.NotNullOrWhiteSpace(secretKey, TencentCloudSettingNames.SecretKey);
var method = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.Connection.HttpMethod);
var webProxy = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.Connection.WebProxy);
var timeout = await SettingProvider.GetAsync(TencentCloudSettingNames.Connection.Timeout, 60);
cache.SetAbsoluteExpiration(TimeSpan.FromSeconds(durationSecond));
return new TencentCloudClientCacheItem
{
SecretId = secretId,
SecretKey = secretKey,
// 连接区域
EndPoint = endpoint,
DurationSecond = durationSecond,
HttpMethod = method,
WebProxy = webProxy,
Timeout = timeout,
};
});
SecretId = secretId,
SecretKey = secretKey,
// 连接区域
EndPoint = endpoint,
DurationSecond = durationSecond,
HttpMethod = method,
WebProxy = webProxy,
Timeout = timeout,
};
ClientCache.Set(cacheKey, cacheItem, TimeSpan.FromSeconds(durationSecond));
}
return cacheItem;
}
}
@ -89,36 +91,38 @@ public abstract class AbstractTencentCloudClientFactory<TClient, TConfiguration>
protected async virtual Task<TencentCloudClientCacheItem> GetClientCacheItemAsync()
{
return await ClientCache.GetOrCreateAsync(
TencentCloudClientCacheItem.CalculateCacheKey("client-options"),
async (cache) =>
var cacheKey = TencentCloudClientCacheItem.CalculateCacheKey("client-options");
var cacheItem = ClientCache.Get<TencentCloudClientCacheItem>(cacheKey);
if (cacheItem == null)
{
var secretId = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.SecretId);
var secretKey = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.SecretKey);
var endpoint = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.EndPoint);
var durationSecond = await SettingProvider.GetAsync(TencentCloudSettingNames.DurationSecond, 3600);
Check.NotNullOrWhiteSpace(secretId, TencentCloudSettingNames.SecretId);
Check.NotNullOrWhiteSpace(secretKey, TencentCloudSettingNames.SecretKey);
var method = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.Connection.HttpMethod);
var webProxy = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.Connection.WebProxy);
var timeout = await SettingProvider.GetAsync(TencentCloudSettingNames.Connection.Timeout, 60);
cacheItem = new TencentCloudClientCacheItem
{
var secretId = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.SecretId);
var secretKey = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.SecretKey);
var endpoint = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.EndPoint);
var durationSecond = await SettingProvider.GetAsync(TencentCloudSettingNames.DurationSecond, 3600);
Check.NotNullOrWhiteSpace(secretId, TencentCloudSettingNames.SecretId);
Check.NotNullOrWhiteSpace(secretKey, TencentCloudSettingNames.SecretKey);
var method = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.Connection.HttpMethod);
var webProxy = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.Connection.WebProxy);
var timeout = await SettingProvider.GetAsync(TencentCloudSettingNames.Connection.Timeout, 60);
cache.SetAbsoluteExpiration(TimeSpan.FromSeconds(durationSecond));
return new TencentCloudClientCacheItem
{
SecretId = secretId,
SecretKey = secretKey,
// 连接区域
EndPoint = endpoint,
DurationSecond = durationSecond,
HttpMethod = method,
WebProxy = webProxy,
Timeout = timeout,
};
});
SecretId = secretId,
SecretKey = secretKey,
// 连接区域
EndPoint = endpoint,
DurationSecond = durationSecond,
HttpMethod = method,
WebProxy = webProxy,
Timeout = timeout,
};
ClientCache.Set(cacheKey, cacheItem, TimeSpan.FromSeconds(durationSecond));
}
return cacheItem;
}
}

12
aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/TencentCloudClientCacheItem.cs

@ -3,12 +3,12 @@
public class TencentCloudClientCacheItem
{
public const string CacheKeyFormat = "pn:tenant-cloud,n:{0}";
public string SecretId { get; set; }
public string SecretKey { get; set; }
public string EndPoint { get; set; }
public string WebProxy { get; set; }
public string ApiEndPoint { get; set; }
public string HttpMethod { get; set; }
public string SecretId { get; set; } = default!;
public string SecretKey { get; set; } = default!;
public string? EndPoint { get; set; }
public string? WebProxy { get; set; }
public string? ApiEndPoint { get; set; }
public string? HttpMethod { get; set; }
public int Timeout { get; set; }
public int DurationSecond { get; set; }

2
aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/TencentCloudClientFactory.cs

@ -46,7 +46,7 @@ public class TencentCloudClientFactory<TClient> : AbstractTencentCloudClientFact
// 通过反射创建客户端实例
// TODO: 如果影响到性能需要调整到通过Options手动创建实例
return (TClient)clientCtr.Invoke(new object[] { cred, cloudCache.EndPoint, clientProfile });
return (TClient)clientCtr.Invoke(new object?[] { cred, cloudCache.EndPoint, clientProfile });
}
throw new AbpException($"Failed to specify initialization Type for client {typeof(TClient).FullName}. Client instance could not be created");

4
aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.HttpOverrides/LINGYUN/Abp/AspNetCore/WebClientInfo/RequestForwardedHeaderWebClientInfoProvider.cs

@ -24,9 +24,9 @@ public class RequestForwardedHeaderWebClientInfoProvider : HttpContextWebClientI
Options = options.Value;
}
protected override string GetClientIpAddress()
protected override string? GetClientIpAddress()
{
string forwardedForHeader = null;
string? forwardedForHeader = null;
var requestHeaders = HttpContextAccessor.HttpContext?.Request?.Headers;
if (requestHeaders != null &&
Options.ForwardedHeaders.HasFlag(ForwardedHeaders.XForwardedFor) &&

30
aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs

@ -50,23 +50,25 @@ public class MvcCachedApplicationConfigurationClient : ICachedApplicationConfigu
return configuration;
}
configuration = await Cache.GetOrAddAsync(
cacheKey,
async () => await Proxy.Service.GetAsync(new ApplicationConfigurationRequestOptions()),
() => new DistributedCacheEntryOptions
{
AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(CurrentUser.IsAuthenticated
? MvcClientCacheOptions.UserCacheExpirationSeconds
: MvcClientCacheOptions.AnonymousCacheExpirationSeconds)
}
);
if (httpContext != null)
var configurationDto = await Cache.GetAsync(cacheKey);
if (configurationDto != null)
{
httpContext.Items[cacheKey] = configuration;
httpContext?.Items[cacheKey] = configurationDto;
return configurationDto;
}
return configuration;
configurationDto = await Proxy.Service.GetAsync(new ApplicationConfigurationRequestOptions());
await Cache.SetAsync(cacheKey, configurationDto, new DistributedCacheEntryOptions
{
AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(CurrentUser.IsAuthenticated
? MvcClientCacheOptions.UserCacheExpirationSeconds
: MvcClientCacheOptions.AnonymousCacheExpirationSeconds)
});
httpContext?.Items[cacheKey] = configurationDto;
return configurationDto;
}
public ApplicationConfigurationDto Get()

4
aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Wrapper/LINGYUN/Abp/AspNetCore/Wrapper/AbpExceptionHandlingWrapperMiddleware.cs

@ -126,8 +126,8 @@ public class AbpExceptionHandlingWrapperMiddleware : IMiddleware, ITransientDepe
httpContext.Response.Headers.Append("Content-Type", "application/json");
var wrapResult = new WrapResult(
exceptionWrapContext.ErrorInfo.Code,
exceptionWrapContext.ErrorInfo.Message,
exceptionWrapContext.ErrorInfo.Code!,
exceptionWrapContext.ErrorInfo.Message!,
exceptionWrapContext.ErrorInfo.Details);
await httpContext.Response.WriteAsync(jsonSerializer.Serialize(wrapResult));
}

2
aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Wrapper/LINGYUN/Abp/AspNetCore/Wrapper/HttpResponseWrapperContext.cs

@ -10,7 +10,7 @@ public class HttpResponseWrapperContext
public HttpResponseWrapperContext(
HttpContext httpContext,
int httpStatusCode,
IDictionary<string, string> httpHeaders = null)
IDictionary<string, string>? httpHeaders = null)
{
HttpContext = httpContext;
HttpStatusCode = httpStatusCode;

2
aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProvider.cs

@ -61,7 +61,7 @@ public class AliyunBlobProvider : BlobProviderBase, ITransientDependency
return await BlobExistsAsync(ossClient, args, blobName);
}
public override async Task<Stream> GetOrNullAsync(BlobProviderGetArgs args)
public override async Task<Stream?> GetOrNullAsync(BlobProviderGetArgs args)
{
using var ossClient = await GetOssClientAsync(args);
var blobName = AliyunBlobNameCalculator.Calculate(args);

6
aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProviderConfiguration.cs

@ -34,7 +34,7 @@ public class AliyunBlobProviderConfiguration
/// 签名版本(可选项:v1、v4)
/// 默认: v1
/// </summary>
public string SignatureVersion {
public string? SignatureVersion {
get => _containerConfiguration.GetConfigurationOrDefault(AliyunBlobProviderConfigurationNames.SignatureVersion, DefaultSignatureVersion);
set => _containerConfiguration.SetConfiguration(AliyunBlobProviderConfigurationNames.SignatureVersion, value);
}
@ -63,7 +63,7 @@ public class AliyunBlobProviderConfiguration
/// <summary>
/// 创建命名空间时防盗链列表
/// </summary>
public List<string> CreateBucketReferer
public List<string>? CreateBucketReferer
{
get => _containerConfiguration.GetConfigurationOrDefault(AliyunBlobProviderConfigurationNames.CreateBucketReferer, new List<string>());
set
@ -85,7 +85,7 @@ public class AliyunBlobProviderConfiguration
set => _containerConfiguration.SetConfiguration(AliyunBlobProviderConfigurationNames.PresignedGetExpirySeconds, value);
}
public string Endpoint {
public string? Endpoint {
get => _containerConfiguration.GetConfigurationOrDefault<string>(AliyunBlobProviderConfigurationNames.Endpoint, null);
set => _containerConfiguration.SetConfiguration(AliyunBlobProviderConfigurationNames.Endpoint, value);
}

6
aspnet-core/framework/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/DefaultDbSchemaMigrator.cs

@ -33,7 +33,7 @@ public class DefaultDbSchemaMigrator : IDbSchemaMigrator, ITransientDependency
{
var connectionStringName = ConnectionStringNameAttribute.GetConnStringName<TDbContext>();
string connectionString = null;
string? connectionString = null;
if (_currentTenant.IsAvailable)
{
var connectionStringResolver = _serviceProvider.GetRequiredService<IConnectionStringResolver>();
@ -57,10 +57,10 @@ public class DefaultDbSchemaMigrator : IDbSchemaMigrator, ITransientDependency
return;
}
connectionString??= defaultConnectionString;
connectionString ??= defaultConnectionString;
var dbContextBuilder = new DbContextOptionsBuilder<TDbContext>();
using var dbContext = configureDbContext(connectionString, dbContextBuilder);
using var dbContext = configureDbContext(connectionString!, dbContextBuilder);
await dbContext.Database.MigrateAsync();
}

2
aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPBootstrapper.cs

@ -15,7 +15,7 @@ public class AbpCAPBootstrapper : IBootstrapper
private readonly ILogger<IBootstrapper> _logger;
private readonly IServiceProvider _serviceProvider;
private CancellationTokenSource _cts;
private CancellationTokenSource? _cts;
private bool _disposed;
private IEnumerable<IProcessingServer> _processors = default!;

6
aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPConsumerServiceSelector.cs

@ -112,7 +112,7 @@ public class AbpCAPConsumerServiceSelector : ConsumerServiceSelector
);
// TODO: 事件名称定义在事件参数类型,就无法创建多个订阅者类了,增加可选配置,让用户决定事件名称定义在哪里
var eventName = EventNameAttribute.GetNameOrDefault(eventType);
var topicAttr = method.GetCustomAttributes<TopicAttribute>(true);
var topicAttr = method!.GetCustomAttributes<TopicAttribute>(true);
var topicAttributes = topicAttr.ToList();
topicAttributes.Add(new CapSubscribeAttribute(eventName));
@ -121,10 +121,10 @@ public class AbpCAPConsumerServiceSelector : ConsumerServiceSelector
{
SetSubscribeAttribute(attr);
var parameters = method.GetParameters()
var parameters = method!.GetParameters()
.Select(parameter => new ParameterDescriptor
{
Name = parameter.Name,
Name = parameter.Name!,
ParameterType = parameter.ParameterType,
IsFromCap = parameter.GetCustomAttributes(typeof(FromCapAttribute)).Any()
}).ToList();

10
aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPMessageExtensions.cs

@ -18,9 +18,9 @@ public static class AbpCAPMessageExtensions
this Message message,
out Guid? tenantId)
{
if (message.Headers.TryGetValue(AbpCAPHeaders.TenantId, out string tenantStr))
if (message.Headers.TryGetValue(AbpCAPHeaders.TenantId, out var tenantStr))
{
if (Guid.TryParse(tenantStr, out Guid id))
if (Guid.TryParse(tenantStr, out var id))
{
tenantId = id;
return true;
@ -37,7 +37,7 @@ public static class AbpCAPMessageExtensions
public static Guid? GetTenantIdOrNull(
this Message message)
{
if (message.TryGetTenantId(out Guid? tenantId))
if (message.TryGetTenantId(out var tenantId))
{
return tenantId;
}
@ -51,7 +51,7 @@ public static class AbpCAPMessageExtensions
/// <returns></returns>
public static bool TryGetCorrelationId(
this Message message,
out string correlationId)
out string? correlationId)
{
return message.Headers.TryGetValue(AbpCAPHeaders.CorrelationId, out correlationId);
}
@ -60,7 +60,7 @@ public static class AbpCAPMessageExtensions
/// </summary>
/// <param name="message"></param>
/// <returns></returns>
public static string GetCorrelationIdOrNull(this Message message)
public static string? GetCorrelationIdOrNull(this Message message)
{
if (message.TryGetCorrelationId(out var correlationId))
{

12
aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPSubscribeInvoker.cs

@ -82,7 +82,7 @@ public class AbpCAPSubscribeInvoker : ISubscribeInvoker
var message = context.DeliverMessage;
var parameterDescriptors = context.ConsumerDescriptor.Parameters;
var executeParameters = new object[parameterDescriptors.Count];
var executeParameters = new object?[parameterDescriptors.Count];
// 租户数据可能在消息标头中
var tenantId = message.GetTenantIdOrNull();
var correlationId = message.GetCorrelationIdOrNull();
@ -154,7 +154,7 @@ public class AbpCAPSubscribeInvoker : ISubscribeInvoker
using (_currentTenant.Change(tenantId))
{
var filter = provider.GetService<ISubscribeFilter>();
object resultObj = null;
object? resultObj = null;
try
{
@ -204,7 +204,7 @@ public class AbpCAPSubscribeInvoker : ISubscribeInvoker
else
{
var capHeader = executeParameters.FirstOrDefault(x => x is CapHeader) as CapHeader;
IDictionary<string, string> callbackHeader = null;
IDictionary<string, string?>? callbackHeader = null;
// TODO: CapHeader.ResponseHeader
return new ConsumerExecutedResult(resultObj, message.GetId(), callbackName, callbackHeader);
}
@ -245,10 +245,10 @@ public class AbpCAPSubscribeInvoker : ISubscribeInvoker
var srvType = context.ConsumerDescriptor.ServiceTypeInfo?.AsType();
var implType = context.ConsumerDescriptor.ImplTypeInfo.AsType();
object obj = null;
object? obj = null;
if (srvType != null)
{
obj = provider.GetServices(srvType).FirstOrDefault(o => o.GetType() == implType);
obj = provider.GetServices(srvType).FirstOrDefault(o => o?.GetType() == implType);
}
if (obj == null)
@ -265,7 +265,7 @@ public class AbpCAPSubscribeInvoker : ISubscribeInvoker
/// <param name="class"></param>
/// <param name="parameter"></param>
/// <returns></returns>
private async Task<object> ExecuteWithParameterAsync(ObjectMethodExecutor executor, object @class, object[] parameter)
private async Task<object?> ExecuteWithParameterAsync(ObjectMethodExecutor executor, object @class, object?[]? parameter)
{
if (executor.IsMethodAsync)
{

4
aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCapSerializer.cs

@ -41,7 +41,7 @@ public class AbpCapSerializer : ISerializer
return ValueTask.FromResult(new TransportMessage(message.Headers, jsonBytes));
}
public ValueTask<Message> DeserializeAsync(TransportMessage transportMessage, Type valueType)
public ValueTask<Message> DeserializeAsync(TransportMessage transportMessage, Type? valueType)
{
if (valueType == null || ReadOnlyMemory<byte>.Empty.Equals(transportMessage.Body) || transportMessage.Body.Length == 0)
{
@ -67,7 +67,7 @@ public class AbpCapSerializer : ISerializer
// return JsonSerializer.Deserialize<Message>(json, _jsonSerializerOptions.JsonSerializerOptions);
}
public object Deserialize(object value, Type valueType)
public object? Deserialize(object value, Type valueType)
{
if (value is JsonElement jToken)
{

8
aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/CAPDistributedEventBus.cs

@ -196,7 +196,7 @@ public class CAPDistributedEventBus : DistributedEventBusBase, IDistributedEvent
return handlerFactoryList.ToArray();
}
protected override Type GetEventTypeByEventName(string eventName)
protected override Type? GetEventTypeByEventName(string eventName)
{
return EventTypes.GetOrDefault(eventName);
}
@ -265,15 +265,15 @@ public class CAPDistributedEventBus : DistributedEventBusBase, IDistributedEvent
}
}
protected virtual async Task PublishToCapAsync(Type eventType, object eventData, Guid? messageId, string correlationId = null)
protected virtual async Task PublishToCapAsync(Type eventType, object eventData, Guid? messageId, string? correlationId = null)
{
var (eventName, resolvedData) = ResolveEventForPublishing(eventType, eventData);
await PublishToCapAsync(eventName, resolvedData, null, correlationId);
}
protected virtual async Task PublishToCapAsync(string eventName, object eventData, Guid? messageId, string correlationId = null)
protected virtual async Task PublishToCapAsync(string eventName, object eventData, Guid? messageId, string? correlationId = null)
{
var headers = new Dictionary<string, string>();
var headers = new Dictionary<string, string?>();
if (messageId.HasValue)
{
headers.TryAdd(AbpCAPHeaders.MessageId, messageId.ToString());

6
aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/CustomDistributedEventSubscriber.cs

@ -82,7 +82,7 @@ internal class CustomDistributedEventSubscriber : ICustomDistributedEventSubscri
new[] { eventType }
);
var eventName = EventNameAttribute.GetNameOrDefault(eventType);
var topicAttr = method.GetCustomAttributes<TopicAttribute>(true);
var topicAttr = method!.GetCustomAttributes<TopicAttribute>(true);
var topicAttributes = topicAttr.ToList();
topicAttributes.Add(new CapSubscribeAttribute(eventName));
@ -91,10 +91,10 @@ internal class CustomDistributedEventSubscriber : ICustomDistributedEventSubscri
{
SetSubscribeAttribute(attr);
var parameters = method.GetParameters()
var parameters = method!.GetParameters()
.Select(parameter => new ParameterDescriptor
{
Name = parameter.Name,
Name = parameter.Name!,
ParameterType = parameter.ParameterType,
IsFromCap = parameter.GetCustomAttributes(typeof(FromCapAttribute)).Any()
}).ToList();

2
aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/Internal/AwaitableInfo.cs

@ -8,6 +8,7 @@ using System.Runtime.CompilerServices;
namespace LINGYUN.Abp.EventBus.CAP.Internal;
#nullable disable
internal readonly struct AwaitableInfo
{
public Type AwaiterType { get; }
@ -114,3 +115,4 @@ internal readonly struct AwaitableInfo
return true;
}
}
#nullable enable

2
aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/Internal/CoercedAwaitableInfo.cs

@ -6,6 +6,7 @@ using System.Linq.Expressions;
namespace LINGYUN.Abp.EventBus.CAP.Internal;
#nullable disable
internal readonly struct CoercedAwaitableInfo
{
public AwaitableInfo AwaitableInfo { get; }
@ -51,3 +52,4 @@ internal readonly struct CoercedAwaitableInfo
return false;
}
}
#nullable enable

2
aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/Internal/ObjectMethodExecutorFSharpSupport.cs

@ -10,6 +10,7 @@ using System.Threading.Tasks;
namespace LINGYUN.Abp.EventBus.CAP.Internal;
#nullable disable
/// <summary>
/// Helper for detecting whether a given type is FSharpAsync`1, and if so, supplying
/// an <see cref="Expression" /> for mapping instances of that type to a C# awaitable.
@ -136,3 +137,4 @@ internal static class ObjectMethodExecutorFSharpSupport
&& string.Equals(type1.Name, type2.Name, StringComparison.Ordinal);
}
}
#nullable enable

12
aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/AbpEmailExceptionHandlingOptions.cs

@ -12,19 +12,19 @@ public class AbpEmailExceptionHandlingOptions
/// <summary>
/// 默认邮件标题
/// </summary>
public string DefaultTitle { get; set; }
public string? DefaultTitle { get; set; }
/// <summary>
/// 默认邮件内容头
/// </summary>
public string DefaultContentHeader { get; set; }
public string? DefaultContentHeader { get; set; }
/// <summary>
/// 默认邮件内容底
/// </summary>
public string DefaultContentFooter { get; set; }
public string? DefaultContentFooter { get; set; }
/// <summary>
/// 默认异常收件人
/// </summary>
public string DefaultReceiveEmail { get; set; }
public string? DefaultReceiveEmail { get; set; }
/// <summary>
/// 异常类型指定收件人处理映射列表
/// </summary>
@ -60,9 +60,9 @@ public class AbpEmailExceptionHandlingOptions
}
}
public string GetReceivedEmailOrDefault(Type exceptionType)
public string? GetReceivedEmailOrDefault(Type exceptionType)
{
if (Handlers.TryGetValue(exceptionType, out string receivedUsers))
if (Handlers.TryGetValue(exceptionType, out var receivedUsers))
{
return receivedUsers;
}

6
aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/AbpExceptionSubscriberBase.cs

@ -14,12 +14,12 @@ public abstract class AbpExceptionSubscriberBase : ExceptionSubscriber
protected IServiceScopeFactory ServiceScopeFactory { get; }
protected AbpExceptionHandlingOptions Options { get; }
public IAbpLazyServiceProvider ServiceProvider { get; set; }
public IAbpLazyServiceProvider ServiceProvider { get; set; } = default!;
protected ILoggerFactory LoggerFactory => ServiceProvider.LazyGetService<ILoggerFactory>();
protected ILoggerFactory? LoggerFactory => ServiceProvider.LazyGetService<ILoggerFactory>();
protected ILogger Logger => _lazyLogger.Value;
private Lazy<ILogger> _lazyLogger => new Lazy<ILogger>(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true);
private Lazy<ILogger> _lazyLogger => new Lazy<ILogger>(() => LoggerFactory?.CreateLogger(GetType().FullName!) ?? NullLogger.Instance, true);
protected AbpExceptionSubscriberBase(

6
aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/AbpRedisRequiresLimitFeatureOptions.cs

@ -5,9 +5,9 @@ namespace LINGYUN.Abp.Features.LimitValidation.Redis;
public class AbpRedisRequiresLimitFeatureOptions : IOptions<AbpRedisRequiresLimitFeatureOptions>
{
public string Configuration { get; set; }
public string InstanceName { get; set; }
public ConfigurationOptions ConfigurationOptions { get; set; }
public string Configuration { get; set; } = default!;
public string? InstanceName { get; set; }
public ConfigurationOptions? ConfigurationOptions { get; set; }
AbpRedisRequiresLimitFeatureOptions IOptions<AbpRedisRequiresLimitFeatureOptions>.Value
{
get { return this; }

8
aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/RedisRequiresLimitFeatureChecker.cs

@ -22,10 +22,10 @@ public class RedisRequiresLimitFeatureChecker : IRequiresLimitFeatureChecker
public ILogger<RedisRequiresLimitFeatureChecker> Logger { protected get; set; }
private volatile ConnectionMultiplexer _connection;
private volatile ConfigurationOptions _redisConfig;
private IDatabaseAsync _redis;
private IServer _server;
private volatile ConnectionMultiplexer? _connection;
private volatile ConfigurationOptions? _redisConfig;
private IDatabaseAsync _redis = default!;
private IServer _server = default!;
private readonly IClock _clock;
private readonly IVirtualFileProvider _virtualFileProvider;

6
aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/FeaturesLimitValidationInterceptor.cs

@ -74,7 +74,7 @@ public class FeaturesLimitValidationInterceptor : AbpInterceptor, ITransientDepe
await _limitFeatureChecker.ProcessAsync(context);
}
protected async virtual Task<RequiresLimitFeatureAttribute> GetRequiresLimitFeature(MethodInfo methodInfo)
protected async virtual Task<RequiresLimitFeatureAttribute?> GetRequiresLimitFeature(MethodInfo methodInfo)
{
var limitFeature = methodInfo.GetCustomAttribute<RequiresLimitFeatureAttribute>(false);
if (limitFeature != null)
@ -82,14 +82,14 @@ public class FeaturesLimitValidationInterceptor : AbpInterceptor, ITransientDepe
// 限制次数定义的不是范围参数,则不参与限制功能
var featureLimitDefinition = await _featureDefinitionManager.GetOrNullAsync(limitFeature.LimitFeature);
if (featureLimitDefinition == null ||
!typeof(NumericValueValidator).IsAssignableFrom(featureLimitDefinition.ValueType.Validator.GetType()))
!typeof(NumericValueValidator).IsAssignableFrom(featureLimitDefinition.ValueType?.Validator.GetType()))
{
return null;
}
// 时长刻度定义的不是范围参数,则不参与限制功能
var featureIntervalDefinition = await _featureDefinitionManager.GetOrNullAsync(limitFeature.IntervalFeature);
if (featureIntervalDefinition == null ||
!typeof(NumericValueValidator).IsAssignableFrom(featureIntervalDefinition.ValueType.Validator.GetType()))
!typeof(NumericValueValidator).IsAssignableFrom(featureIntervalDefinition.ValueType?.Validator.GetType()))
{
return null;
}

6
aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN/Abp/Idempotent/IdempotentCheckContext.cs

@ -8,16 +8,16 @@ public class IdempotentCheckContext
public Type Target { get; }
public MethodInfo Method { get; }
public string IdempotentKey { get; }
public IReadOnlyDictionary<string, object> ArgumentsDictionary { get; }
public IReadOnlyDictionary<string, object?>? ArgumentsDictionary { get; }
public IdempotentCheckContext(
Type target,
MethodInfo method,
string idempotentKey,
IReadOnlyDictionary<string, object>? argumentsDictionary)
IReadOnlyDictionary<string, object?>? argumentsDictionary)
{
Target = target;
Method = method;
IdempotentKey = idempotentKey;
ArgumentsDictionary = argumentsDictionary ?? new Dictionary<string, object>();
ArgumentsDictionary = argumentsDictionary ?? new Dictionary<string, object?>();
}
}

11
aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN/Abp/Idempotent/IdempotentChecker.cs

@ -61,15 +61,18 @@ public class IdempotentChecker : IIdempotentChecker, ITransientDependency
var matchValue = regex.Match(attr.RedirectUrl).Value;
var replaceMatchKey = "{" + matchValue + "}";
var redirectUrl = "";
foreach (var arg in context.ArgumentsDictionary)
if (context.ArgumentsDictionary != null)
{
if (arg.Value != null && string.Equals(arg.Key, matchValue, StringComparison.InvariantCultureIgnoreCase))
foreach (var arg in context.ArgumentsDictionary)
{
redirectUrl = attr.RedirectUrl!.Replace(replaceMatchKey, arg.Value.ToString());
if (arg.Value != null && string.Equals(arg.Key, matchValue, StringComparison.InvariantCultureIgnoreCase))
{
redirectUrl = attr.RedirectUrl!.Replace(replaceMatchKey, arg.Value.ToString());
}
}
}
if (redirectUrl.IsNullOrWhiteSpace())
if (redirectUrl.IsNullOrWhiteSpace() && context.ArgumentsDictionary != null)
{
foreach (var arg in context.ArgumentsDictionary)
{

2
aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN/Abp/Idempotent/IdempotentInterceptor.cs

@ -27,7 +27,7 @@ public class IdempotentInterceptor : AbpInterceptor, ITransientDependency
return;
}
var targetType = ProxyHelper.GetUnProxiedType(invocation.TargetObject);
var targetType = ProxyHelper.GetUnProxiedType(invocation.TargetObject!);
var keyNormalizerContext = new IdempotentKeyNormalizerContext(
targetType,

6
aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN/Abp/Idempotent/IdempotentKeyNormalizer.cs

@ -36,7 +36,9 @@ public class IdempotentKeyNormalizer : IIdempotentKeyNormalizer, ITransientDepen
var index = 0;
foreach (var key in attr.KeyMap)
{
if (context.ArgumentsDictionary.TryGetValue(key, out var value))
if (context.ArgumentsDictionary != null &&
context.ArgumentsDictionary.TryGetValue(key, out var value) &&
value != null)
{
var objectToString = _jsonSerializer.Serialize(value);
var objectMd5 = objectToString.ToMd5();
@ -52,7 +54,7 @@ public class IdempotentKeyNormalizer : IIdempotentKeyNormalizer, ITransientDepen
}
else
{
var args = context.ArgumentsDictionary.ToImmutableArray();
var args = context.ArgumentsDictionary?.ToImmutableArray() ?? [];
for (var i = 0; i < args.Length; i++)
{
var arg = args[i];

6
aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN/Abp/Idempotent/IdempotentKeyNormalizerContext.cs

@ -8,15 +8,15 @@ public class IdempotentKeyNormalizerContext
{
public Type Target { get; }
public MethodInfo Method { get; }
public IReadOnlyDictionary<string, object> ArgumentsDictionary { get; }
public IReadOnlyDictionary<string, object?>? ArgumentsDictionary { get; }
public IdempotentKeyNormalizerContext(
Type target,
MethodInfo method,
IReadOnlyDictionary<string, object>? argumentsDictionary)
IReadOnlyDictionary<string, object?>? argumentsDictionary)
{
Target = target;
Method = method;
ArgumentsDictionary = argumentsDictionary ?? new Dictionary<string, object>();
ArgumentsDictionary = argumentsDictionary ?? new Dictionary<string, object?>();
}
}

28
aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationHttpClient.cs

@ -54,7 +54,7 @@ public class BaiduLocationHttpClient : ITransientDependency
}
var requestUrl = BuildRequestUrl(baiduMapUrl, baiduMapPath, requestParamters);
var responseContent = await MakeRequestAndGetResultAsync(requestUrl);
var baiduLocationResponse = JsonConvert.DeserializeObject<BaiduIpGeocodeResponse>(responseContent);
var baiduLocationResponse = JsonConvert.DeserializeObject<BaiduIpGeocodeResponse>(responseContent)!;
if (!baiduLocationResponse.IsSuccess())
{
var localizerFactory = ServiceProvider.GetRequiredService<IStringLocalizerFactory>();
@ -84,7 +84,7 @@ public class BaiduLocationHttpClient : ITransientDependency
return location;
}
public async virtual Task<GecodeLocation> GeocodeAsync(string address, string city = null)
public async virtual Task<GecodeLocation> GeocodeAsync(string address, string? city = null)
{
var requestParamters = new Dictionary<string, string>
{
@ -106,7 +106,7 @@ public class BaiduLocationHttpClient : ITransientDependency
}
var requestUrl = BuildRequestUrl(baiduMapUrl, baiduMapPath, requestParamters);
var responseContent = await MakeRequestAndGetResultAsync(requestUrl);
var baiduLocationResponse = JsonConvert.DeserializeObject<BaiduGeocodeResponse>(responseContent);
var baiduLocationResponse = JsonConvert.DeserializeObject<BaiduGeocodeResponse>(responseContent)!;
if (!baiduLocationResponse.IsSuccess())
{
var localizerFactory = ServiceProvider.GetRequiredService<IStringLocalizerFactory>();
@ -157,7 +157,7 @@ public class BaiduLocationHttpClient : ITransientDependency
var requestUrl = BuildRequestUrl(baiduMapUrl, baiduMapPath, requestParamters);
var responseContent = await MakeRequestAndGetResultAsync(requestUrl);
var baiduLocationResponse = JsonConvert.DeserializeObject<BaiduReGeocodeResponse>(responseContent);
var baiduLocationResponse = JsonConvert.DeserializeObject<BaiduReGeocodeResponse>(responseContent)!;
if (!baiduLocationResponse.IsSuccess())
{
var localizerFactory = ServiceProvider.GetRequiredService<IStringLocalizerFactory>();
@ -173,16 +173,16 @@ public class BaiduLocationHttpClient : ITransientDependency
}
var location = new ReGeocodeLocation
{
Street = baiduLocationResponse.Result.AddressComponent.Street,
AdCode = baiduLocationResponse.Result.AddressComponent.AdCode.ToString(),
Street = baiduLocationResponse.Result.AddressComponent?.Street,
AdCode = baiduLocationResponse.Result.AddressComponent?.AdCode,
Address = baiduLocationResponse.Result.FormattedAddress,
FormattedAddress = baiduLocationResponse.Result.SematicDescription,
City = baiduLocationResponse.Result.AddressComponent.City,
Country = baiduLocationResponse.Result.AddressComponent.Country,
District = baiduLocationResponse.Result.AddressComponent.District,
Number = baiduLocationResponse.Result.AddressComponent.StreetNumber,
Province = baiduLocationResponse.Result.AddressComponent.Province,
Town = baiduLocationResponse.Result.AddressComponent.Town,
City = baiduLocationResponse.Result.AddressComponent?.City,
Country = baiduLocationResponse.Result.AddressComponent?.Country,
District = baiduLocationResponse.Result.AddressComponent?.District,
Number = baiduLocationResponse.Result.AddressComponent?.StreetNumber,
Province = baiduLocationResponse.Result.AddressComponent?.Province,
Town = baiduLocationResponse.Result.AddressComponent?.Town,
Pois = baiduLocationResponse.Result.Pois.Select(p =>
{
var poi = new Poi
@ -208,8 +208,8 @@ public class BaiduLocationHttpClient : ITransientDependency
if (location.Pois.Any())
{
var nearPoi = location.Pois.OrderBy(x => x.Distance).FirstOrDefault();
location.Address = nearPoi.Address;
location.FormattedAddress = nearPoi.Name;
location.Address = nearPoi?.Address;
location.FormattedAddress = nearPoi?.Name;
}
location.AddAdditional("BaiduLocation", baiduLocationResponse.Result);

4
aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationOptions.cs

@ -7,11 +7,11 @@ public class BaiduLocationOptions
/// <summary>
/// 用户申请注册的key
/// </summary>
public string AccessKey { get; set; }
public string AccessKey { get; set; } = default!;
/// <summary>
/// 用户申请注册的AccessSecret
/// </summary>
public string AccessSecret { get; set; }
public string AccessSecret { get; set; } = default!;
/// <summary>
/// 坐标的类型,目前支持的坐标类型包括:
/// bd09ll(百度经纬度坐标)

2
aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationResolveProvider.cs

@ -25,7 +25,7 @@ public class BaiduLocationResolveProvider : ILocationResolveProvider
return await BaiduLocationHttpClient.ReGeocodeAsync(lat, lng, radius);
}
public async virtual Task<GecodeLocation> GeocodeAsync(string address, string city = null)
public async virtual Task<GecodeLocation> GeocodeAsync(string address, string? city = null)
{
return await BaiduLocationHttpClient.GeocodeAsync(address, city);
}

26
aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/AddressComponent.cs

@ -11,7 +11,7 @@ public class AddressComponent
/// <summary>
/// 国家
/// </summary>
public string Country { get; set; }
public string? Country { get; set; }
/// <summary>
/// 国家国家编码
/// </summary>
@ -23,21 +23,21 @@ public class AddressComponent
/// </summary>
[JsonProperty("country_code_iso")]
[JsonPropertyName("country_code_iso")]
public string CountryCodeIso { get; set; }
public string? CountryCodeIso { get; set; }
/// <summary>
/// 国家英文缩写(两位)
/// </summary>
[JsonProperty("country_code_iso2")]
[JsonPropertyName("country_code_iso2")]
public string CountryCodeIso2 { get; set; }
public string? CountryCodeIso2 { get; set; }
/// <summary>
/// 省名
/// </summary>
public string Province { get; set; }
public string? Province { get; set; }
/// <summary>
/// 城市名
/// </summary>
public string City { get; set; }
public string? City { get; set; }
/// <summary>
/// 城市所在级别(仅国外有参考意义。
/// 国外行政区划与中国有差异,城市对应的层级不一定为『city』。
@ -49,37 +49,37 @@ public class AddressComponent
/// <summary>
/// 区县名
/// </summary>
public string District { get; set; }
public string? District { get; set; }
/// <summary>
/// 乡镇名
/// </summary>
public string Town { get; set; }
public string? Town { get; set; }
/// <summary>
/// 乡镇id
/// </summary>
[JsonProperty("town_code")]
[JsonPropertyName("town_code")]
public string TownCode { get; set; }
public string? TownCode { get; set; }
/// <summary>
/// 街道名(行政区划中的街道层级)
/// </summary>
public string Street { get; set; }
public string? Street { get; set; }
/// <summary>
/// 街道门牌号
/// </summary>
[JsonProperty("street_number")]
[JsonPropertyName("street_number")]
public string StreetNumber { get; set; }
public string? StreetNumber { get; set; }
/// <summary>
/// 行政区划代码
/// </summary>
public string AdCode { get; set; }
public string? AdCode { get; set; }
/// <summary>
/// 相对当前坐标点的方向,当有门牌号的时候返回数据
/// </summary>
public string Direction { get; set; }
public string? Direction { get; set; }
/// <summary>
/// 相对当前坐标点的距离,当有门牌号的时候返回数据
/// </summary>
public string Distance { get; set; }
public string? Distance { get; set; }
}

4
aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/AddressDetail.cs

@ -7,7 +7,7 @@ public class AddressDetail
{
[JsonProperty("city")]
[JsonPropertyName("city")]
public string City { get; set; }
public string City { get; set; } = default!;
[JsonProperty("city_code")]
[JsonPropertyName("city_code")]
@ -15,5 +15,5 @@ public class AddressDetail
[JsonProperty("province")]
[JsonPropertyName("province")]
public string Province { get; set; }
public string? Province { get; set; }
}

2
aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduGeocode.cs

@ -6,5 +6,5 @@ public class BaiduGeocode
public int Precise { get; set; }
public int Confidence { get; set; }
public int Comprehension { get; set; }
public string Level { get; set; }
public string? Level { get; set; }
}

20
aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduPoi.cs

@ -10,23 +10,23 @@ public class BaiduPoi
/// </summary>
[JsonProperty("addr")]
[JsonPropertyName("addr")]
public string Address { get; set; }
public string Address { get; set; } = default!;
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
public string Name { get; set; } = default!;
/// <summary>
/// 标记
/// </summary>
public string Tag { get; set; }
public string? Tag { get; set; }
/// <summary>
/// 和当前坐标点的方向
/// </summary>
public string Direction { get; set; }
public string? Direction { get; set; }
/// <summary>
/// 离坐标点距离
/// </summary>
public string Distance { get; set; }
public string? Distance { get; set; }
/// <summary>
/// poi坐标{x,y}
/// </summary>
@ -35,28 +35,28 @@ public class BaiduPoi
/// <summary>
/// 坐标类型
/// </summary>
public string PoiType { get; set; }
public string? PoiType { get; set; }
/// <summary>
/// 电话
/// </summary>
[JsonProperty("tel")]
[JsonPropertyName("tel")]
public string TelPhone { get; set; }
public string? TelPhone { get; set; }
/// <summary>
/// poi唯一标识
/// </summary>
public string Uid { get; set; }
public string Uid { get; set; } = default!;
/// <summary>
/// 邮编
/// </summary>
[JsonProperty("zip")]
[JsonPropertyName("zip")]
public string Post { get; set; }
public string? Post { get; set; }
/// <summary>
/// poi对应的主点poi(如,海底捞的主点为上地华联,该字段则为上地华联的poi信息。
/// 如无,该字段为空),包含子字段和pois基础召回字段相同。
/// </summary>
[JsonProperty("parent_poi")]
[JsonPropertyName("parent_poi")]
public BaiduPoi ParentPoi { get; set; }
public BaiduPoi? ParentPoi { get; set; }
}

10
aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduReGeocode.cs

@ -11,22 +11,22 @@ public class BaiduReGeocode
/// </summary>
[JsonProperty("location")]
[JsonPropertyName("location")]
public BaiduLocation Location { get; set; }
public BaiduLocation Location { get; set; } = default!;
/// <summary>
/// 结构化地址信息
/// </summary>
[JsonProperty("formatted_address")]
[JsonPropertyName("formatted_address")]
public string FormattedAddress { get; set; }
public string? FormattedAddress { get; set; }
/// <summary>
/// 坐标所在商圈信息,如 "人民大学,中关村,苏州街"。
/// 最多返回3个。
/// </summary>
public string Business { get; set; }
public string? Business { get; set; }
/// <summary>
/// 地址元素列表
/// </summary>
public AddressComponent AddressComponent { get; set; }
public AddressComponent? AddressComponent { get; set; }
/// <summary>
/// 周边poi数组
/// </summary>
@ -44,7 +44,7 @@ public class BaiduReGeocode
/// </summary>
[JsonProperty("sematic_description")]
[JsonPropertyName("sematic_description")]
public string SematicDescription { get; set; }
public string? SematicDescription { get; set; }
public BaiduReGeocode()
{
AddressComponent = new AddressComponent();

4
aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduRoad.cs

@ -5,9 +5,9 @@
/// </summary>
public class BaiduRoad
{
public string Name { get; set; }
public string Name { get; set; } = default!;
/// <summary>
/// 传入的坐标点距离道路的大概距离
/// </summary>
public string Distance { get; set; }
public string? Distance { get; set; }
}

2
aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/Content.cs

@ -5,7 +5,7 @@ namespace LINGYUN.Abp.Location.Baidu.Model;
public class Content
{
public string Address { get; set; }
public string Address { get; set; } = default!;
[JsonProperty("address_detail")]
[JsonPropertyName("address_detail")]

4
aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/IpPoint.cs

@ -4,8 +4,8 @@ namespace LINGYUN.Abp.Location.Baidu.Model;
public class IpPoint
{
public string X { get; set; }
public string Y { get; set; }
public string X { get; set; } = default!;
public string Y { get; set; } = default!;
public Point ToPoint()
{

10
aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/PoiRegion.cs

@ -11,23 +11,23 @@ public class PoiRegion
/// <summary>
/// 归属区域面名称
/// </summary>
public string Name { get; set; }
public string Name { get; set; } = default!;
/// <summary>
/// 归属区域面类型
/// </summary>
public string Tag { get; set; }
public string? Tag { get; set; }
/// <summary>
/// 请求中的坐标与所归属区域面的相对位置关系
/// </summary>
[JsonProperty("direction_desc")]
[JsonPropertyName("direction_desc")]
public string DirectionDesc { get; set; }
public string? DirectionDesc { get; set; }
/// <summary>
/// poi唯一标识
/// </summary>
public string Uid { get; set; }
public string Uid { get; set; } = default!;
/// <summary>
/// 离坐标点距离
/// </summary>
public string Distance { get; set; }
public string? Distance { get; set; }
}

2
aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Response/BaiduIpGeocodeResponse.cs

@ -4,7 +4,7 @@ namespace LINGYUN.Abp.Location.Baidu.Response;
public class BaiduIpGeocodeResponse : BaiduLocationResponse
{
public string Address { get; set; }
public string Address { get; set; } = default!;
public Content Content { get; set; } = new Content();
}

12
aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/AddressComponent.cs

@ -11,30 +11,30 @@ public class AddressComponent
/// 国家
/// </summary>
[JsonProperty("nation")]
public string Nation { get; set; }
public string? Nation { get; set; }
/// <summary>
/// 省
/// </summary>
[JsonProperty("province")]
public string Province { get; set; }
public string? Province { get; set; }
/// <summary>
/// 市
/// </summary>
[JsonProperty("city")]
public string City { get; set; }
public string? City { get; set; }
/// <summary>
/// 区,可能为空字串
/// </summary>
[JsonProperty("district")]
public string District { get; set; }
public string? District { get; set; }
/// <summary>
/// 街道,可能为空字串
/// </summary>
[JsonProperty("street")]
public string Street { get; set; }
public string? Street { get; set; }
/// <summary>
/// 门牌,可能为空字串
/// </summary>
[JsonProperty("street_number")]
public string StreetNumber { get; set; }
public string? StreetNumber { get; set; }
}

16
aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/AddressInfo.cs

@ -8,42 +8,42 @@ namespace LINGYUN.Abp.Location.Tencent.Model;
public class AddressInfo
{
[JsonProperty("adcode")]
public string AdCode { get; set; }
public string AdCode { get; set; } = default!;
/// <summary>
/// 城市代码
/// </summary>
[JsonProperty("city_code")]
public string CityCode { get; set; }
public string? CityCode { get; set; }
/// <summary>
/// 行政区划代码
/// </summary>
[JsonProperty("nation_code")]
public string NationCode { get; set; }
public string? NationCode { get; set; }
/// <summary>
/// 行政区划名称
/// </summary>
[JsonProperty("name")]
public string Name { get; set; }
public string? Name { get; set; }
/// <summary>
/// 国家
/// </summary>
[JsonProperty("nation")]
public string Nation { get; set; }
public string? Nation { get; set; }
/// <summary>
/// 省/直辖市
/// </summary>
[JsonProperty("province")]
public string Province { get; set; }
public string? Province { get; set; }
/// <summary>
/// 市/地级区 及同级行政区划
/// </summary>
[JsonProperty("city")]
public string City { get; set; }
public string? City { get; set; }
/// <summary>
/// 区/县级市 及同级行政区划
/// </summary>
[JsonProperty("district")]
public string District { get; set; }
public string? District { get; set; }
/// <summary>
/// 行政区划中心点坐标
/// </summary>

8
aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/Area.cs

@ -11,12 +11,12 @@ public class Area
/// 地点唯一标识
/// </summary>
[JsonProperty("id")]
public string Id { get; set; }
public string Id { get; set; } = default!;
/// <summary>
/// 名称/标题
/// </summary>
[JsonProperty("title")]
public string Title { get; set; }
public string? Title { get; set; }
/// <summary>
/// 坐标
/// </summary>
@ -26,11 +26,11 @@ public class Area
/// 此参考位置到输入坐标的直线距离
/// </summary>
[JsonProperty("_distance")]
public string Distance { get; set; }
public string? Distance { get; set; }
/// <summary>
/// 此参考位置到输入坐标的方位关系,
/// 如:北、南、内
/// </summary>
[JsonProperty("_dir_desc")]
public string DirDescription { get; set; }
public string? DirDescription { get; set; }
}

4
aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/FormattedAddress.cs

@ -11,10 +11,10 @@ public class FormattedAddress
/// 经过腾讯地图优化过的描述方式,更具人性化特点
/// </summary>
[JsonProperty("recommend")]
public string ReCommend { get; set; }
public string? ReCommend { get; set; }
/// <summary>
/// 大致位置,可用于对位置的粗略描述
/// </summary>
[JsonProperty("rough")]
public string Rough { get; set; }
public string? Rough { get; set; }
}

8
aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/Poi.cs

@ -11,22 +11,22 @@ public class Poi
/// 地点唯一标识
/// </summary>
[JsonProperty("id")]
public string Id { get; set; }
public string Id { get; set; } = default!;
/// <summary>
/// 名称/标题
/// </summary>
[JsonProperty("title")]
public string Title { get; set; }
public string Title { get; set; } = default!;
/// <summary>
/// 地址
/// </summary>
[JsonProperty("address")]
public string Address { get; set; }
public string Address { get; set; } = default!;
/// <summary>
/// POI分类
/// </summary>
[JsonProperty("category")]
public string CateGory { get; set; }
public string CateGory { get; set; } = default!;
/// <summary>
/// 坐标
/// </summary>

2
aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentGeocode.cs

@ -39,5 +39,5 @@ public class GeocodeAddressInfo
/// 行政区划代码
/// </summary>
[JsonProperty("adcode")]
public string AdCode { get; set; }
public string AdCode { get; set; } = default!;
}

2
aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentIPGeocode.cs

@ -11,7 +11,7 @@ public class TencentIPGeocode
/// 用于定位的IP地址
/// </summary>
[JsonProperty("ip")]
public string IpAddress { get; set; }
public string IpAddress { get; set; } = default!;
/// <summary>
/// 定位坐标
/// </summary>

2
aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentReGeocode.cs

@ -11,7 +11,7 @@ public class TencentReGeocode
/// 地址描述
/// </summary>
[JsonProperty("address")]
public string Address { get; set; }
public string? Address { get; set; }
/// <summary>
/// 位置描述
/// </summary>

4
aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Response/TencentLocationResponse.cs

@ -20,12 +20,12 @@ public abstract class TencentLocationResponse
/// 状态说明
/// </summary>
[JsonProperty("message")]
public string Message { get; set; }
public string Message { get; set; } = default!;
/// <summary>
/// 本次请求的唯一标识
/// </summary>
[JsonProperty("request_id")]
public string RequestId { get; set; }
public string RequestId { get; set; } = default!;
/// <summary>
/// 是否请求成功
/// </summary>

18
aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationHttpClient.cs

@ -39,7 +39,7 @@ public class TencentLocationHttpClient : ITransientDependency
public async virtual Task<IPGecodeLocation> IPGeocodeAsync(string ipAddress)
{
var requestParamters = new Dictionary<string, string>
var requestParamters = new Dictionary<string, string?>
{
{ "callback", Options.Callback },
{ "ip", ipAddress },
@ -74,9 +74,9 @@ public class TencentLocationHttpClient : ITransientDependency
return location;
}
public async virtual Task<GecodeLocation> GeocodeAsync(string address, string city = null)
public async virtual Task<GecodeLocation> GeocodeAsync(string address, string? city = null)
{
var requestParamters = new Dictionary<string, string>
var requestParamters = new Dictionary<string, string?>
{
{ "address", address },
{ "callback", Options.Callback },
@ -109,7 +109,7 @@ public class TencentLocationHttpClient : ITransientDependency
public async virtual Task<ReGeocodeLocation> ReGeocodeAsync(double lat, double lng, int radius = 1000)
{
var requestParamters = new Dictionary<string, string>
var requestParamters = new Dictionary<string, string?>
{
{ "callback", Options.Callback },
{ "get_poi", Options.GetPoi },
@ -157,8 +157,8 @@ public class TencentLocationHttpClient : ITransientDependency
location.Pois.Any())
{
var nearPoi = location.Pois.OrderBy(x => x.Distance).FirstOrDefault();
location.Address = nearPoi.Address;
location.FormattedAddress = nearPoi.Name;
location.Address = nearPoi?.Address;
location.FormattedAddress = nearPoi?.Name;
}
location.AddAdditional("TencentLocation", tencentLocationResponse.Result);
@ -185,12 +185,12 @@ public class TencentLocationHttpClient : ITransientDependency
return CancellationTokenProvider.Token;
}
protected async virtual Task<TResponse> GetTencentMapResponseAsync<TResponse>(string url, string path, IDictionary<string, string> paramters)
protected async virtual Task<TResponse> GetTencentMapResponseAsync<TResponse>(string url, string path, IDictionary<string, string?> paramters)
where TResponse : TencentLocationResponse
{
var requestUrl = BuildRequestUrl(url, path, paramters);
var responseContent = await MakeRequestAndGetResultAsync(requestUrl);
var tencentLocationResponse = JsonConvert.DeserializeObject<TResponse>(responseContent);
var tencentLocationResponse = JsonConvert.DeserializeObject<TResponse>(responseContent)!;
if (!tencentLocationResponse.IsSuccessed)
{
if (Options.VisableErrorToClient)
@ -206,7 +206,7 @@ public class TencentLocationHttpClient : ITransientDependency
return tencentLocationResponse;
}
protected virtual string BuildRequestUrl(string uri, string path, IDictionary<string, string> paramters)
protected virtual string BuildRequestUrl(string uri, string path, IDictionary<string, string?> paramters)
{
var requestUrlBuilder = new StringBuilder(128);
requestUrlBuilder.Append(uri);

6
aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationOptions.cs

@ -2,10 +2,10 @@
public class TencentLocationOptions
{
public string AccessKey { get; set; }
public string SecretKey { get; set; }
public string AccessKey { get; set; } = default!;
public string SecretKey { get; set; } = default!;
public string GetPoi { get; set; } = "1";
public string Output { get; set; } = "JSON";
public string Callback { get; set; }
public string? Callback { get; set; }
public bool VisableErrorToClient { get; set; } = false;
}

2
aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationResolveProvider.cs

@ -25,7 +25,7 @@ public class TencentLocationResolveProvider : ILocationResolveProvider
return await TencentLocationHttpClient.ReGeocodeAsync(lat, lng, radius);
}
public async virtual Task<GecodeLocation> GeocodeAsync(string address, string city = null)
public async virtual Task<GecodeLocation> GeocodeAsync(string address, string? city = null)
{
return await TencentLocationHttpClient.GeocodeAsync(address, city);
}

4
aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Utils/TencentSecretKeyCaculater.cs

@ -22,7 +22,7 @@ public class TencentSecretKeyCaculater
}
}
private static string HttpBuildQuery(IDictionary<string, string> querystring_arrays)
private static string HttpBuildQuery(IDictionary<string, string?> querystring_arrays)
{
StringBuilder sb = new StringBuilder();
@ -37,7 +37,7 @@ public class TencentSecretKeyCaculater
return sb.ToString();
}
public static string CalcSecretKey(string url, string secretKey, IDictionary<string, string> querystring_arrays)
public static string CalcSecretKey(string url, string secretKey, IDictionary<string, string?> querystring_arrays)
{
var queryString = HttpBuildQuery(querystring_arrays);

2
aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/GecodeLocation.cs

@ -20,7 +20,7 @@ public class GecodeLocation : Location
/// <summary>
/// 能精确理解的地址类型
/// </summary>
public string Level { get; set; }
public string? Level { get; set; }
/// <summary>
/// 附加信息
/// </summary>

2
aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/ILocationResolveProvider.cs

@ -6,7 +6,7 @@ public interface ILocationResolveProvider
{
Task<IPGecodeLocation> IPGeocodeAsync(string ipAddress);
Task<GecodeLocation> GeocodeAsync(string address, string city = null);
Task<GecodeLocation> GeocodeAsync(string address, string? city = null);
Task<ReGeocodeLocation> ReGeocodeAsync(double lat, double lng, int radius = 50);
}

12
aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/IPGecodeLocation.cs

@ -7,7 +7,7 @@ public class IPGecodeLocation
/// <summary>
/// IP地址
/// </summary>
public string IpAddress { get; set; }
public string IpAddress { get; set; } = default!;
/// <summary>
/// 定位坐标
/// </summary>
@ -15,23 +15,23 @@ public class IPGecodeLocation
/// <summary>
/// 国家
/// </summary>
public string Country { get; set; }
public string? Country { get; set; }
/// <summary>
/// 城市
/// </summary>
public string City { get; set; }
public string? City { get; set; }
/// <summary>
/// 省份
/// </summary>
public string Province { get; set; }
public string? Province { get; set; }
/// <summary>
/// 区县
/// </summary>
public string District { get; set; }
public string? District { get; set; }
/// <summary>
/// adcode
/// </summary>
public string AdCode { get; set; }
public string? AdCode { get; set; }
public IDictionary<string, object> Additionals { get; } = new Dictionary<string, object>();

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

Loading…
Cancel
Save